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

CSDL ReturnType element needs to specify rules for Nullable and Collection with entity types

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_CS01
    • Fix Version/s: V4.01_CS02
    • Component/s: CSDL JSON , CSDL XML
    • Labels:
      None
    • Environment:

      Applied

      Description

      It is reasonable to assume:

      • A collection of entities never contains null because the “null entity” has no meaning.
      • A function returning a single entity would have to return 204 No Content to signal “no entity returned”, similar to following a single-valued navigation property with nothing associated at that point in time.

      Therefore:

      • A function returning entities behaves like a navigation property.
      • A function returning structured or primitive instances behaves like a structural property.

      In regard to CSDL XML/JSON 4.01, we should specify:

      Nullable should never be specified for a Collection(SomeEntityType), and it must always be considered to be false by default. This would bring consistency with navigation properties.

      Going one step further, we should probably apply this reasoning to Parameter elements, i.e. a parameter of type Collection(SomeEntityType) should also never have an explicit Nullable facet.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              evan.ireland.2 Evan Ireland
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: