Skip to content

inconsistency between documentation and spec: is paths required? #25

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
karenetheridge opened this issue Aug 16, 2021 · 5 comments · Fixed by #26
Closed

inconsistency between documentation and spec: is paths required? #25

karenetheridge opened this issue Aug 16, 2021 · 5 comments · Fixed by #26

Comments

@karenetheridge
Copy link
Member

in https://github.com/OAI/Documentation/blob/main/specification-structure.md:

The root object in any OpenAPI document is the OpenAPI Object and only three of its fields are mandatory: openapi, info and paths.

But the schema (https://github.com/raw/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.yaml) says:

anyOf:
  - required:
    - paths
  - required:
    - components
  - required:
    - webhooks

Which one is correct?

@webron
Copy link
Member

webron commented Aug 17, 2021

Neither of those is the specification. Not sure if the Documentation was updated to OAS 3.1 but the section you're referring to is true in OAS 3.0 but changed in OAS 3.1. The snippet from the schema is true to OAS 3.1.

@karenetheridge
Copy link
Member Author

I also noticed that on the next page, https://oai.github.io/Documentation/specification-paths.html, says that "responses" is mandatory in the operations object, neither the spec nor the schema contain this constraint.

Have these doc pages been updated for v3.0.3->v3.1.0?

@webron
Copy link
Member

webron commented Aug 17, 2021

Apparently, they've not been. As always, the source of truth is always the specs. For reference, https://spec.openapis.org/oas/v3.1.0.html and https://spec.openapis.org/oas/v3.0.0.html (or just https://github.com/OAI/OpenAPI-Specification/tree/main/versions).

@MikeRalphson
Copy link
Member

MikeRalphson commented Aug 20, 2021

Thanks for pointing this out @karenetheridge - do you have bandwidth to raise a PR to fix these issues? If not, I can.

@karenetheridge
Copy link
Member Author

I can PR it this weekend.

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

Successfully merging a pull request may close this issue.

3 participants