If null is provided as data, then the JSON schema validation will fail, if we don't allow type of null for optional references. The reference object must allow null to pass JSON schema validation, which is wrong.
The shorthand syntax of:
{
"shorthand": true,
"schema": {
"customerId": "/Customer/CustomerId",
"externalId?": "/Acme/ExternalId"
}
}
should be translated into
{
"type": "object",
"properties": {
"customerId": {
"$ref": "#/definitions/Customer/CustomerId",
"namespace": "/Customer"
},
"externalId": {
"oneOf": [
{"type": "null"},
{"$ref": "#/definitions/Acme/ExternalId"}
],
"namespace": "/Acme"
}
},
"required": [
"customerId"
],
"additionalProperties": false
}
If null is provided as data, then the JSON schema validation will fail, if we don't allow type of
nullfor optional references. The reference object must allownullto pass JSON schema validation, which is wrong.The shorthand syntax of:
{ "shorthand": true, "schema": { "customerId": "/Customer/CustomerId", "externalId?": "/Acme/ExternalId" } }should be translated into
{ "type": "object", "properties": { "customerId": { "$ref": "#/definitions/Customer/CustomerId", "namespace": "/Customer" }, "externalId": { "oneOf": [ {"type": "null"}, {"$ref": "#/definitions/Acme/ExternalId"} ], "namespace": "/Acme" } }, "required": [ "customerId" ], "additionalProperties": false }