JSON Schema treats null as a separate data type, requiring an "anyOf" construct for nullable properties:
"Supplier":{
"anyOf":[
,
{ "type":"null" }],
If we accept that OData-unaware JSON Schema validators will complain wrongly if they encounter a null value, we could shorten this to
"Supplier":
{ "$ref":"#/definitions/ODataDemo.Supplier", "nullable":true }This would increase readability for humans and OData-aware machines and significantly reduce the optical size of the JSON CSDL due to the reduced number of line breaks added by pretty printers and JSON Viewers. The actual byte size reduction isn't significant.
Combined with ODATA-842 this would reduce
"Created":{
"anyOf":[
{
"allOf":[
],
"pattern":"(^[^.]*$|[.][0-9]
$)"
},
]
}
to just
"Created":
{ "type":"string", "format":"date-time", "precision":6 "nullable":true }