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

Define request body format for Actions in Atom and JSON format specifications

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Labels:
      None
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      Rephrase paragraphs 3 and 4 of section 10.4.2.3 Invoking an Action in the Protocol specification to be format-neutral:

      If the invoke request contains any non-binding parameter values, the parameter values MUST be encoded in the format of a complex type instance in the request body.

      Each non-binding parameter value specified MUST be encoded in the format of a property of a complex type instance. The name of the property is the name of the parameter. The value is the parameter value which is an instance of the type specified by the parameter in JSON format. Any parameter values not specified in the JSON object MUST be assumed to be null.

      Add sections Action Parameters to the Atom and JSON format specification. For the new JSON specification the text will be

      4.20 Action Parameters

      Action parameter values MUST be encoded in a single JSON object in the request body.

      Each non-binding parameter value specified MUST be encoded as a separate name/value pair in this JSON object. The name is the name of the parameter. The value is the parameter value in the JSON representation appropriate for its type.

      Any parameter values not specified in the JSON object MUST be assumed to be null.

      Example:
      {
      "param1": 42,
      "param2":

      { "Street": "One Microsoft Way", "Zip": 98052 }

      ,
      "param3": [ 1, 42, 99 ]
      }

      The text for the Atom specification could be

      15 Action Parameters

      Action parameter values in the request body MUST be encoded as an individual complex scalar value (link to section 10) with the name parameters and no metadata:type attribute.

      Each non-binding parameter value specified MUST be encoded as an individual primitive or complex scalar value. The name of the scalar value is the name of the parameter. The value is the parameter value in the XML representation appropriate for its type.

      Any parameter values not specified in the request body MUST be assumed to be null.

      Example:
      <parameters>
      <param1>42</param1>
      <param2 metadata:type="Model.Address">
      <Street>One Microsoft Way</Street>
      <Zip>98052</Zip>
      </param2>
      <param3>
      <element>1</element>
      <element>42</element>
      <element>99</element>
      </param3>
      <parameters>

      Accepted: https://www.oasis-open.org/committees/download.php/48269/odata-meeting-25_on-20130214-minutes.html#odata-212

      Show
      Rephrase paragraphs 3 and 4 of section 10.4.2.3 Invoking an Action in the Protocol specification to be format-neutral: If the invoke request contains any non-binding parameter values, the parameter values MUST be encoded in the format of a complex type instance in the request body. Each non-binding parameter value specified MUST be encoded in the format of a property of a complex type instance. The name of the property is the name of the parameter. The value is the parameter value which is an instance of the type specified by the parameter in JSON format. Any parameter values not specified in the JSON object MUST be assumed to be null. Add sections Action Parameters to the Atom and JSON format specification. For the new JSON specification the text will be 4.20 Action Parameters Action parameter values MUST be encoded in a single JSON object in the request body. Each non-binding parameter value specified MUST be encoded as a separate name/value pair in this JSON object. The name is the name of the parameter. The value is the parameter value in the JSON representation appropriate for its type. Any parameter values not specified in the JSON object MUST be assumed to be null. Example: { "param1": 42, "param2": { "Street": "One Microsoft Way", "Zip": 98052 } , "param3": [ 1, 42, 99 ] } The text for the Atom specification could be 15 Action Parameters Action parameter values in the request body MUST be encoded as an individual complex scalar value (link to section 10) with the name parameters and no metadata:type attribute. Each non-binding parameter value specified MUST be encoded as an individual primitive or complex scalar value. The name of the scalar value is the name of the parameter. The value is the parameter value in the XML representation appropriate for its type. Any parameter values not specified in the request body MUST be assumed to be null. Example: <parameters> <param1>42</param1> <param2 metadata:type="Model.Address"> <Street>One Microsoft Way</Street> <Zip>98052</Zip> </param2> <param3> <element>1</element> <element>42</element> <element>99</element> </param3> <parameters> Accepted: https://www.oasis-open.org/committees/download.php/48269/odata-meeting-25_on-20130214-minutes.html#odata-212
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/48276/odata-core-v4.0-wd01-part1-protocol-2013-02-15-RH.doc https://www.oasis-open.org/committees/download.php/48275/odata-atom-format-v4.0-wd01-2013-02-15-RH.doc https://www.oasis-open.org/committees/download.php/48277/odata-json-format-v4.0-wd01-2013-02-15-RH.doc Accepted: https://www.oasis-open.org/committees/download.php/48346/odata-meeting-26_on-20130221-minutes.html#odata-212

      Description

      Currently the Protocol specification defines a JSON request body format for invoking an action.

      This would require Atom/XML clients to also implement a JSON serializer, which is an unnecessary burden.

      The request body format is essentially the serialization of a complex type with one property per non-binding parameter, so we can use the already defined XML serialization for complex type instances also for XML action request bodies.

      The request body formats are better described in the respective format specifications and only referenced from the Protocol specification.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              martinzurmuehl Martin Zurmuehl
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: