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

Use Content-Type: application/json in responses to requests with MaxDataServiceVersion: 2.0

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Component/s: JSON Format
    • Labels:
      None
    • Proposal:
      Hide

      Add the paragraphs:

      Respond with a Content-Type of "application/json" to client requests with a MaxDataServiceVersion of 1.0 or 2.0 and an Accept header listing "application/json" without the suffix ";odata=verbose".
      Respond with a Content-Type of "application/json;odata=verbose" in all other cases.

      Show
      Add the paragraphs: Respond with a Content-Type of "application/json" to client requests with a MaxDataServiceVersion of 1.0 or 2.0 and an Accept header listing "application/json" without the suffix ";odata=verbose". Respond with a Content-Type of "application/json;odata=verbose" in all other cases.

      Description

      Section "MIME Type" states that Verbose JSON is represented with a Content-Type of "application/json;odata=verbose" even though in versions 1.0 and 2.0 it used a Content-Type of "application/json".

      Section "Client/Service Format Compatibility and Versions" specifies to respond with Verbose JSON if the client explicitly requests MaxDataServiceVersion: 2.0 and Accept: application/json.

      Responding with Content-Type: application/json;odata=verbose is an avoidable incompatibility that risks breaking pure 2.0 clients.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: