Skip to content
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

Throw an error if the user tries to parse an OpenAPI 3 document #242

Closed
ffflorian opened this issue Sep 25, 2020 · 2 comments · Fixed by #273
Closed

Throw an error if the user tries to parse an OpenAPI 3 document #242

ffflorian opened this issue Sep 25, 2020 · 2 comments · Fixed by #273

Comments

@ffflorian
Copy link
Member

No description provided.

@bennycode
Copy link
Member

OpenAPI 3 documents have the following property in their JSON schema:

{"openapi":"3.0.0", ...}

Parsing the "openapi" property will help to detect if it is version 3 or below.

@bennycode
Copy link
Member

Swagger documents don't have the "openapi" property. Instead those have markers like "swagger": "2.0". That's why checking for the pure existence of the "openapi" property is good enough.

I made a PR for that: #273

@bennycode bennycode linked a pull request Jan 3, 2021 that will close this issue
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.

2 participants