Closed ZenixineZ closed 1 year ago
Schema:
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "field1": { "type": "string" }, "field2": { "type": "string" } }, "required": ["field1"] }
Object:
{ "field1": "test", "field2": null }
Error: At /field2 of null - unexpected instance type
At /field2 of null - unexpected instance type
Is there anyway for it to allow null values for non-required fields?
This is more a question for Stackoverflow.
Try: "field2": { "type": ["null", "string"] }
"field2": { "type": ["null", "string"] }
My god I feel foolish. Thank you for the response and sorry I bothered you
Schema:
Object:
Error:
At /field2 of null - unexpected instance type
Is there anyway for it to allow null values for non-required fields?