json-schema-compatibility
json-schema-compatibility copied to clipboard
handle null values
conversion fails with following json:
{
"$schema": "http://json-schema.org/draft-03/schema#",
"type": "object",
"properties": {
"data": {
"type": "array",
"default": null
}
}
}
it fails when handling null value:
TypeError: Cannot read property 'type' of null at convert3to4 main.js:23:11)
i think a quick fix would just be to return null if obj is null