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

Produce lightweight JSON CSDL and separately define Swagger/OAI generation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_WD01
    • Fix Version/s: V4.01_WD01
    • Component/s: CSDL JSON
    • Labels:
      None
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      Create two separate documents. A JSON CSDL document that is a concise representation of CSDL in JSON that is 1:1 with the XML representation, and a separate Committee Note specifying how to generate a clean Swagger/OAI description of an OData service. Because we have the native JSON representation of CSDL the Swagger/OAI description does not have to fully represent the CSDL data model but describes the service in a way that can be consumed by API management, documentation, and client tools built around Swagger/OAI and is suitable for validation of OData JSON payloads.

      Show
      Create two separate documents. A JSON CSDL document that is a concise representation of CSDL in JSON that is 1:1 with the XML representation, and a separate Committee Note specifying how to generate a clean Swagger/OAI description of an OData service. Because we have the native JSON representation of CSDL the Swagger/OAI description does not have to fully represent the CSDL data model but describes the service in a way that can be consumed by API management, documentation, and client tools built around Swagger/OAI and is suitable for validation of OData JSON payloads.
    • Resolution:
      Show
      Clean OData-to-OpenAPI Mapping: https://www.oasis-open.org/committees/download.php/59301/odata-openapi-v1.0-wd01-2016-11-07.docx OData CSDL JSON: https://www.oasis-open.org/committees/download.php/59388/odata-csdl-json-v4.01-wd01-2016-11-16.docx

      Description

      For the past year we have investigated defining a JSON representation of metadata based on JSON Schema and, more recently, Swagger. Because this was to serve as a JSON alternate to XML for describing the service it had to have full fidelity with the XML representation.

      JSON Schema was defined as a validation language and lacks many of the core concepts necessary for defining a service model, such as inheritance, relationships, identity, etc. While JSON Schema itself is extensible, the desire to align with Swagger further restricted how we could define OData extensions.

      The current draft for a Swagger/JSON Schema aligned metadata representation is a compromise both from a Swagger/JSON Schema perspective as well as from an OData perspective. Limitations in JSON Schema and Swagger make trying to describe OData concepts through extensions cumbersome and verbose for OData consumers. The added extensions also make it verbose for JSON Schema/Swagger tools and community.

      OAI is itself investigating relaxing its reliance on JSON Schema, allowing other suitable formats to be plugged in based on supported payload formats.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikep Michael Pizzo
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: