Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting x-oas-draft-alternate-schema #482

Closed
philsturgeon opened this issue May 3, 2018 · 2 comments
Closed

Supporting x-oas-draft-alternate-schema #482

philsturgeon opened this issue May 3, 2018 · 2 comments

Comments

@philsturgeon
Copy link
Contributor

So, the folks at OpenAPI are attempting to solve the OpenAPI Schema Object <> JSON Schema Object problem with alternate schemas.

This approach can allow vendors to chose which formats from a predefined list they chose to support:

openapi: 3.0.2
info:
  title: A sample using real JSON Schema and xsd
  version: 1.0.0
paths:
  /cat:
    get:
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                type: object
              x-oas-draft-alternateSchemas:
                - type: json-schema
                  externalValue: ./cat-schema-draft-08.json
                - type: json-schema
                  externalValue: ./cat-schema-draft-05.json
                - type: json-content-rules
                  externalValue: ./cat-JCRschema.json
            application/xml:
              x-oas-draft-alternateSchemas:
                - type: xml-schema
                  externalValue: ./cat-schema.xsd
                - type: relax-ng
                  externalValue: ./cat-schema.ng
                - type: schematron
                  externalValue: ./cat-schema.st

Folks would not need to support everything, but allow their tooling to be suplimented and extended. Of course supporting JSON Schema would be a default expectation for many, and XML Schema might be nice to chuck in their too.

Check out the OpenAPI issue for more information, but we should start supporting this like its a feature, and give them any feedback with stuff that goes wrong.

@handrews
Copy link

handrews commented Nov 6, 2018

Note that this is being promoted to a full keyword, alternativeSchema, in OAS 3.1

OAI/OpenAPI-Specification#1736

@lornajane
Copy link
Contributor

It's overdue, but thanks for raising this when you did! I don't think we need to do anything more on it at this stage, but still. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants