Skip to content

Feature: Add alternativeSchema support #192

@philsturgeon

Description

@philsturgeon

Add support for the OpenAPI v3.1 keyword alternativeSchema, to properly support JSON Schema (and eventually other schemas) without worrying about OpenAPI <> JSON Schema divergence.

Context

OpenAPI and JSON Schema have suffered a bit of a divergence in their keywords for years. At WeWork we came up with a workaround, creating json-schema-to-openapi-schema and jamming it into Speccy to convert from one flavour to another when using the --json-schema switch.

Supporting the alternativeSchema keyword for OpenAPI v3.1 will help folks get away from this workaround situation, and stop them needing to speccy resolve things before passing the specs to other OpenAPI tools which do not have the same workaround enabled.

Possible Implementation

It's possible that this work will need to be done in oas-kit and not directly done in speccy. This issue is created to track that progress regardless.

Work that should definitely be done in Speccy:

  • If a document contains openapi: 3.1.x and is also using the --json-schema flag, return a warning to the cli pointing them towards alternativeSchema

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions