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

odata.type shouldn't require "#" for primitive types

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_COS
    • Fix Version/s: V4.01_WD01
    • Component/s: JSON Format
    • Environment:

      Simplified Payload;[Proposed]

    • Proposal:
      Hide

      For 4.01 responses, the # is optional for primitive types.

      Responses must only be returned without the "#" if the request does not specify odata.maximumversion=4.0.

      Clients must only specify payloads that omit the "#" to services that support 4.01.

      An @odata.type annotation that does not contain a # is a primitive type.

      "@type":"String"
      "@type": "#Sales.Customer"
      (note: as part of default namespaces, Customer doesn't need to be qualified):
      "@type": "#Customer"

      Show
      For 4.01 responses, the # is optional for primitive types. Responses must only be returned without the "#" if the request does not specify odata.maximumversion=4.0. Clients must only specify payloads that omit the "#" to services that support 4.01. An @odata.type annotation that does not contain a # is a primitive type. "@type":"String" "@type": "#Sales.Customer" (note: as part of default namespaces, Customer doesn't need to be qualified): "@type": "#Customer"
    • Resolution:
      Show
      https://www.oasis-open.org/apps/org/workgroup/odata/download.php/59030/odata-json-format-v4.01-wd01.docx

      Description

      In JSON we currently require primitive types to be written as fragments, i.e.:

      "@odata.type":"#Double"

      The hash is not really required in this case, and doesn't really make sense as it is not a reference within the metadata document. Note that, in Atom, it is written without the hash, as in:

      <metadata:Salary metadata:type="Double">50000</metadata:Salary>

      In order not to make a breaking change for JSON we should continue to allow, but not require, the "#" for primitive types.

      Perhaps even add to an implementation note for 4.0 that clients should support primitive types without the "#".

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: