diff --git a/json2yamlschema.py b/json2yamlschema.py index fd1bd96..02d0c19 100644 --- a/json2yamlschema.py +++ b/json2yamlschema.py @@ -26,6 +26,8 @@ def parser(json_data,indent): for key in json_data: write(indent + ' %s:' % key) parser(json_data[key], indent+' ') + elif type(json_data) is None: + write(indent + 'type: string') elif type(json_data) is list: write(indent + 'type: array') write(indent + 'items:') diff --git a/json2yamlschemaSORTED.py b/json2yamlschemaSORTED.py index ed75f72..8223ccd 100644 --- a/json2yamlschemaSORTED.py +++ b/json2yamlschemaSORTED.py @@ -27,6 +27,8 @@ def parser(json_data): for key in json_data: d[key] = parser(json_data[key]) return d + elif type(json_data) is None: + write(indent + 'type: string') elif type(json_data) is list: d['type'] = 'array' if len(json_data) != 0: