Skip to content

Components object does not support x- specification extensions #376

@jlacivita

Description

@jlacivita

The spec for Components object says:

This object MAY be extended with Specification Extensions.

However, the schema does not allow for this:

    "components": {
      "title": "components",
      "type": "object",
      "properties": {
        "schemas": {
          "title": "schemaComponents",
          "type": "object",
          "patternProperties": {
            "[0-z]+": {
              "$ref": "#/definitions/JSONSchema"
            }
          }
        },
        "links": {
          "title": "linkComponents",
          "type": "object",
          "patternProperties": {
            "[0-z]+": {
              "$ref": "#/definitions/linkObject"
            }
          }
        },
        "errors": {
          "title": "errorComponents",
          "type": "object",
          "patternProperties": {
            "[0-z]+": {
              "$ref": "#/definitions/errorObject"
            }
          }
        },
        "examples": {
          "title": "exampleComponents",
          "type": "object",
          "patternProperties": {
            "[0-z]+": {
              "$ref": "#/definitions/exampleObject"
            }
          }
        },
        "examplePairings": {
          "title": "examplePairingComponents",
          "type": "object",
          "patternProperties": {
            "[0-z]+": {
              "$ref": "#/definitions/examplePairingObject"
            }
          }
        },
        "contentDescriptors": {
          "title": "contentDescriptorComponents",
          "type": "object",
          "patternProperties": {
            "[0-z]+": {
              "$ref": "#/definitions/contentDescriptorObject"
            }
          }
        },
        "tags": {
          "title": "tagComponents",
          "type": "object",
          "patternProperties": {
            "[0-z]+": {
              "$ref": "#/definitions/tagObject"
            }
          }
        }
      }
    }

Is this a bug, or a copy/paste error in the spec?

Supporting x- extensions in the components object would be quite useful for storing specific types of reusable objects that are domain-specific.

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