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

Nullable attribute should be required to be false for collection valued navigation properties.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Component/s: CSDL XML
    • Labels:
      None
    • Environment:

      [Proposed]

      Description

      ODATA-24 simplified relationships by moving association information into the navigation property. In doing so, cardinality was represented by the type of the navigation property being either a single entity or a collection of entities. For a single entity, optionality of the entity (i.e., 0 or 1) is represented by a nullable attribute (whose default is false).

      For navigation properties that return collections of entities, nullable=true doesn't make sense; the collection always exists, it may just be empty. Thus, collection-valued navigation properties should either:
      1) always specify nullable=false
      2) explicitly prohibit specifying nullable=true, or
      3) disallow the nullable attribute

      Note that there is precedence for the set of valid attributes depending on the type (i.e., in specifying property facets).

        Attachments

          Activity

          Hide
          ralfhandl Ralf Handl added a comment - - edited

          Using false as default for Nullable is inconsistent with its default value for "normal" properties. I recommend keeping "true" as the default.

          Added the restriction to non-colllection types.

          Show
          ralfhandl Ralf Handl added a comment - - edited Using false as default for Nullable is inconsistent with its default value for "normal" properties. I recommend keeping "true" as the default. Added the restriction to non-colllection types.
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          This doesn't quite address the issue. The point is, it isn't valid to specify nullable=true for a collection valued property; the collection is always there, it may just be empty.

          The easiest way to support this would be to require setting nullable=false for collection-valued properties.

          Show
          mikep Michael Pizzo (Inactive) added a comment - This doesn't quite address the issue. The point is, it isn't valid to specify nullable=true for a collection valued property; the collection is always there, it may just be empty. The easiest way to support this would be to require setting nullable=false for collection-valued properties.

            People

            • Assignee:
              mikep Michael Pizzo (Inactive)
              Reporter:
              mikep Michael Pizzo (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: