To be able to omit a nullable property, it must be given a DefaultValue of null, because the client SHOULD NOT assume a DefaultValue otherwise (https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/odata-csdl-xml-v4.01.html#sec_DefaultValue).
In CSDL JSON, this can be expressed as
{"PropertyName": {"$Nullable": true, "$DefaultValue": null}}
But in CSDL XML, it cannot be expressed:
<Property Name="PropertyName" Type="Edm.String" Nullable="true" DefaultValue="null" />
would mean the string "null" as DefaultValue.
Questions:
- Can the server assume a DefaultValue if none is specified?
- OData-Protocol, section 8.2.8.6 instructs the client to interpret a missing property without DefaultValue as having null value. Does the "SHOULD NOT" rule above apply only to the case without omit-values preference?