Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1625

Cannot specify null as DefaultValue in CSDL XML

    XMLWordPrintable

    Details

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

      Description

      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?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              heiko.theissen Heiko Theissen
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: