-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
OpenAPI 3.1 JSON Schema incorrect for Paths Item in Paths #3298
Labels
Comments
Sorry just wanted to say the above bug was filled by me, I was just logged into the wrong account at the time |
Related to #2635 |
This was referenced Oct 4, 2024
Closed
Stranger6667
pushed a commit
to schemathesis/schemathesis
that referenced
this issue
Oct 5, 2024
Schemathesis uses static version of the current published version of the OpenApi 3.1 spec metaschema (https://spec.openapis.org/oas/3.1/schema/2022-10-07) to validate openapi 3.1 spec documents. Unfortunately, the published version has at least one known bug in which the schema for `paths` references the definition of a concrete `path-item` instead of `path-item-or-reference`, which might still be technically incorrect when it comes handling the case of ref and sibling fields, but is correct according to the documented definition of a pathItemObject. This oversight has been noticed multiple times OAI/OpenAPI-Specification#3298 OAI/OpenAPI-Specification#2635 (comment) OAI/OpenAPI-Specification#2635 (comment) OAI/OpenAPI-Specification#3513 OAI/OpenAPI-Specification#2657 (comment) And finally fixed in Feb 2024 OAI/OpenAPI-Specification#3355 with a slightly bigger rework of the pathItem schema. Sadly, due to confusion about how to release fixes in schemas OAI/OpenAPI-Specification#151 (comment) this change has not been published anywhere except schema.yaml in the git repo, not even in schema.json, which appearantly only gets refreshed once per release of the metaschema OAI/OpenAPI-Specification#3355 (comment) This commit updates the stored schema from the most up-to-date 3.1.0 schema.yaml from 0035208 to close the bug and make spec-valid openapi spec files that use $ref under path finally validate correctly in schemathesis. It also adds a corresponding regression test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe this line https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v3.1/schema.json#L294
ie:
should actually be
according to the docs https://spec.openapis.org/oas/v3.1.0#pathItemObject
as when I am trying to use a json schema validator on my OpenAPI document I am getting an error like:
OpenAPI document invalid: not allowed - https://spec.openapis.org/oas/3.1/schema/2022-10-07#/$defs/path-item/unevaluatedProperties
for the below snippet
The text was updated successfully, but these errors were encountered: