json-schema-compatibility icon indicating copy to clipboard operation
json-schema-compatibility copied to clipboard

handle null values

Open xstex opened this issue 9 years ago • 0 comments

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

xstex avatar Mar 04 '16 15:03 xstex