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

Embed "JSON properties" in OData JSON requests and responses

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: V4.01_CS01
    • Fix Version/s: V4.01_CS02
    • Component/s: JSON Format
    • Labels:
    • Environment:

      Applied

    • Proposal:
      Hide

      "JSON properties" are represented in metadata as properties of type Edm.Stream, which may be annotated with the existing annotation Core.AcceptableMediaTypes, listing application/json to specify that the stream property contains JSON.

      Streams that are annotated as the application/json media type (or one of its subtypes, optionally with format parameters) through @mediaContentType instance annotation are represented as native JSON in JSON requests and responses, they are NOT represented as a base64url-encoded string values. (Note: this is similar to what we  do in the JSON Batch format for JSON request and response bodies.). The odata.mediaContentType control information is only necessary if the embedded JSON happens to be a JSON string, in all other cases it can be heuristically determined that the stream value is JSON. For dynamic JSON properties represented with inline JSON value the odata.mediaContentType control information is always necessary to distinguish them from dynamic Edm.Untyped properties.

      The term Core.AutoExpand is extended to also apply to (stream) properties, enabling "JSON properties" to be implicitly expanded by the service if it is contained in a JSON response. Auto-expanded "JSON properties" MAY be part of the default selection, i.e. represented inline if no $select query option is specified.

      Show
      "JSON properties" are represented in metadata as properties of type Edm.Stream , which may be annotated with the existing annotation Core.AcceptableMediaTypes , listing application/json  to specify that the stream property contains JSON. Streams that are annotated as the application/json media type (or one of its subtypes, optionally with format parameters) through @mediaContentType instance annotation are represented as native JSON in JSON requests and responses, they are NOT represented as a base64url-encoded string values. (Note: this is similar to what we  do in the JSON Batch format for JSON request and response bodies.). The odata.mediaContentType control information is only necessary if the embedded JSON happens to be a JSON string, in all other cases it can be heuristically determined that the stream value is JSON. For dynamic JSON properties represented with inline JSON value the odata.mediaContentType control information is always necessary to distinguish them from dynamic Edm.Untyped properties. The term  Core.AutoExpand  is extended to also apply to (stream) properties, enabling "JSON properties" to be implicitly expanded by the service if it is contained in a JSON response. Auto-expanded "JSON properties" MAY be part of the default selection, i.e. represented inline if no $select query option is specified.
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/64648/odata-json-format-v4.01-wd06-2019-02-01.docx https://github.com/oasis-tcs/odata-vocabularies/pull/46/files  

      Description

      Allow defining "JSON properties" in OData models, i.e. properties whose value is well-formed JSON, see OData Extension for JSON Data.

      Requirements:

      1. JSON property values are represented "inline" in JSON responses, i.e. "JSONproperty": <well-formed JSON data>
      2. Common expressions (e.g. in $filter) can address parts of JSON data
      3. JSON properties can specify a JSON Schema that describes/restricts their data values

      This issue addresses the first requirement. The other requirements are addressed in ODATA-1275

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: