VisualJsonEditor icon indicating copy to clipboard operation
VisualJsonEditor copied to clipboard

Default values being assigned to nullable/optional members

Open Pxtl opened this issue 4 years ago • 1 comments

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.

Pxtl avatar Apr 22 '21 21:04 Pxtl

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.

RicoSuter avatar Apr 26 '21 14:04 RicoSuter