Skip to content

OAS 3 JSON schema is invalid. Encoding object only allows headers to be Header objects and not Reference objects. #2157

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

Closed
alasdairhurst opened this issue Feb 25, 2020 · 2 comments

Comments

@alasdairhurst
Copy link
Contributor

"$ref": "#/definitions/Header"

This causes OAS 3 documents that are valid against the spec to fail. (and breaks tooling that relies on the schema for validation)

Here's an example encoding object which fails validation:

          encoding:
            url:
              headers:
                id:
                  $ref: '#/components/headers/id'

The schema should be

          "additionalProperties": {
                "oneOf": [
                    {  "$ref": "#/definitions/Header" },
                    {  "$ref": "#/definitions/Reference" },
                ]
               
          }

I'll submit a PR with this change for you.

@alasdairhurst
Copy link
Contributor Author

#2158

MikeRalphson added a commit that referenced this issue Jun 24, 2021
#2157: Update schema to validate refs in headers of encoding objects
char0n pushed a commit to swaggerexpert/OpenAPI-Specification that referenced this issue Jul 5, 2021
@MikeRalphson
Copy link
Member

Closing as #2158 was merged. Thanks all.

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

2 participants