Clarify representation of GEO literals and streams in annotations (XML, JSON)

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major
    • V4.02
    • Affects Version/s: None
    • Component/s: CSDL JSON, CSDL XML
    • None
    • Hide

      In CSDL JSON a constant annotation (property) value is the type-specific JSON representation of that value, see [OData-JSON].

      • For Edm.Geo* this is the GeoJSON value
      • For properties of type Edm.Stream this is
        • native JSON for streams of media type application/json or one of its subtypes, optionally with format parameters
        • a string containing the plain text for streams of media types text/*
        • a string containing the base64url-encoded value for all other media types (same as Edm.Binary)

      In CSDL XML a constant annotation (property) value is represented according to the appropriate alternative in the primitiveValue rule defined in [OData‑ABNF], using element or attribute notation:

      • a constant string expression for Edm.Geo* whose value is the appropriate full_Xxx_Literal for Edm.Geo*, e.g. fullPointLiteral for Edm.GeometryPoint and Edm.GeographyPoint
      • a constant string expression for Edm.Stream with media types application/json or text/*
      • a constant binary expression for Edm.Stream for all other media types

      For stream values the annotation (property) MUST be annotated with term Core.MediaType and the media type of the stream as its value.

      Services SHOULD only return these annotation values in CSDL documents with Version 4.02 or later.

      Clients SHOULD already ignore unknown annotations. This now extends to annotations containing literal Edm.Stream and Edm.Geo* values.

      Show
      In CSDL JSON a constant annotation (property) value is the type-specific JSON representation of that value, see [OData-JSON] . For Edm.Geo* this is the GeoJSON value For properties of type Edm.Stream this is native JSON for streams of media type application/json or one of its subtypes, optionally with format parameters a string containing the plain text for streams of media types text/* a string containing the base64url-encoded value for all other media types (same as Edm.Binary) In CSDL XML a constant annotation (property) value is represented according to the appropriate alternative in the primitiveValue rule defined in [OData‑ABNF] , using element or attribute notation: a constant string expression for Edm.Geo* whose value is the appropriate full_Xxx_Literal for Edm.Geo*, e.g. fullPointLiteral for Edm.GeometryPoint and Edm.GeographyPoint a constant string expression for Edm.Stream with media types application/json or text/* a constant binary expression for Edm.Stream for all other media types For stream values the annotation (property) MUST be annotated with term Core.MediaType and the media type of the stream as its value. Services SHOULD only return these annotation values in CSDL documents with Version 4.02 or later. Clients SHOULD already ignore unknown annotations. This now extends to annotations containing literal Edm.Stream and Edm.Geo* values.
    • Show
      https://github.com/oasis-tcs/odata-specs/pull/161

      Section 14.3 Constant Expression defines representations for primitive constant values in annotations, with two exceptions:

      • Edm.Stream
      • Edm.Geo*

      We currently have no concrete use cases for either, but it's a gap.

            Assignee:
            handl
            Reporter:
            handl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: