Skip to content

Allow JSON schema id and $schema in OpenAPI schema definitions #1523

Closed
@DavidBiesack

Description

@DavidBiesack

JSON Schema files can contain top-level fields id and $schema. When using $ref in an OpenAPI document to reference an external schema, the OpenAPI tooling rejects JSON schema files that contain one or both of these fields because 1) the spec does not allow additional fields and thus 2) the published JSON Schema document for OpenAPI does not allow additional fields.
See https://github.com/whitlockjc/swagger-lint/issues/11 for some specific examples.

I propose changing the spec and the corresponding OpenAPI 3.0 schema to allow id and $ref so that one can publish OpenAPI model definition as JSON schema documents. This will allow more tools to consume them more fully.

Note: I am not requesting OpenAPI change the allowed subset of JSON Schema features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions