RicoSuter / VisualJsonEditor

A JSON schema based file editor for Windows.
http://visualjsoneditor.org
MIT License
349 stars 87 forks source link

Default values being assigned to nullable/optional members #36

Open Pxtl opened 3 years ago

Pxtl commented 3 years ago

Hiya, I love this program, but as I'm getting deeper into it I'm running into some bad pain-points.

If I open a json file with a given schema, and the type is

[
  "string",
  "null"
]

and save, it saves it as "" even if I didn't change anything. This is particularly bad if I have a format associated, since I get errors for violating the format... when I wouldn't violate the format if it had been left null or missing.

This is also bad for "format": "date-time" values, since there it's even setting in midnight year 0 when the value is supposed to be null.

RicoSuter commented 3 years ago

I’m not actively using and maintaining this app. Would you be willing to look into this issue and create a PR? Also we should update the used NJsonSchema version as there might be some bug fixes there as well.