Cannot specify null as DefaultValue in CSDL XML

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major
    • V4.02
    • Affects Version/s: V4.01_OS
    • Component/s: CSDL XML
    • None

      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?

            Assignee:
            Unassigned
            Reporter:
            heiko.theissen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: