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

Further clarify restrictions around open types

    XMLWordPrintable

    Details

    • Proposal:
      Hide

      1) Close ODATA-1498 with no further action. It clarifies what was originally intended, and that clarification has been applied. Use this issue to track restrictions around how primitives are interpreted within an untyped collection.

      2) Add a note to [OData-JSON] that "A primitive value within an untyped collection is interpreted as a Edm.Boolean, Edm.String, or Edm.Double."

      3) Clarify that an enum value within an untyped collection should be represented as a string, using the member name.

      4) Clarify that any collection within an untyped collection is itself untyped.

      Show
      1) Close ODATA-1498 with no further action. It clarifies what was originally intended, and that clarification has been applied. Use this issue to track restrictions around how primitives are interpreted within an untyped collection. 2) Add a note to [OData-JSON] that "A primitive value within an untyped collection is interpreted as a Edm.Boolean, Edm.String, or Edm.Double." 3) Clarify that an enum value within an untyped collection should be represented as a string, using the member name. 4) Clarify that any collection within an untyped collection is itself untyped.

      Description

      ODATA-1498 clarifies that "A collection of primitive values that occurs in a property of type Edm.Untyped is interpreted as a collection of Edm.Boolean, Edm.String, and Edm.Decimal, depending on the JavaScript type."

      This rule is true because we can't specify the type of a primitive value within a collection. However, the wording is misleading, because:
      1) It's a bit ambiguous what "occurs in a property of type Edm.Untyped" references – is that to say, that the property is an untyped collection of primitives, or is an untyped collection that contains a collection of untyped primitives, or...? 

      2) It doesn't mention Collection(Edm.Untyped)

      3) It implies that the collection is a collection of one of the javascript types, as opposed to an individual value within any untyped collection being interpreted as one of these types.  i.e., the collection itself is untyped, and can contain primitives of any of these three types.

      Better wording would be something like "A primitive value within an untyped collection is interpreted as a Edm.Boolean, Edm.String, or Edm.Decimal."

      In addition, we should note that a collection nested within a collection will always be an untyped collection; this is because there is no place to put a type annotation for the collection, and we say that, once you enter the untyped world, you remain untyped unless type information is explicitly supplied.

       

        Attachments

          Activity

            People

            • Assignee:
              mikep Michael Pizzo
              Reporter:
              mikep Michael Pizzo
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: