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

V3 spec checks #198

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

V3 spec checks #198

wants to merge 9 commits into from

Conversation

stueynz
Copy link

@stueynz stueynz commented Jan 25, 2022

Re-did all my changes from last June/July into the top of main branch.
Hopefully can be picked up this time.

Added checks and validations for v3.0.x OpenAPI schemas to match the pre-existing Swagger (or v2.0) schema checks.
Added more known-errors - now that we're checking v3.0.x schemas, various real-world APIs are naughty.

@philsturgeon
Copy link
Member

Thank you @stueynz! Checks are failing on lint, can you run npm run lint and make sure its not moaning about anything before resubmitting?

@stueynz
Copy link
Author

stueynz commented Jan 25, 2022

Thank you @stueynz! Checks are failing on lint, can you run npm run lint and make sure its not moaning about anything before resubmitting?

Sure thing ... I'm assuming that warnings from things I haven't touched are ok. e.g explicit any in index.d.ts

Stuart McGrigor added 6 commits January 26, 2022 09:23
…alid-v2' to make it clear which version of spec the tests are for
…x) specs; Made validateSchema recursively check the entire object, not just the top level; check all items that could be in #/components/{schemas,parameters, requestBodies, responses}
…circular while checking things; validateSchema() is now recursive for non-circular APIs
@stueynz
Copy link
Author

stueynz commented Jan 26, 2022

Added a few more checks when doing validateSpec() - OpenAPI keeps what used to be in #/definitions under #/components/{schemas, requestBodies, responses, parameters} so they all need to be checked for weirdness.

Also, when API doesn't have circular $refs we can recursively check schemas of all the properties when doing validateSchema()

…de v14 stops spitting out warning in circular dependency
@philsturgeon
Copy link
Member

Finally, I've managed to unblock the release pipeline and we've got a stable test suite again. PHEW.

Sadly we cannot use optional chaining, and I'm not entirely sure why. I think it might be a dependency of simplifyify being out of date or something, but nothing I can do on my end is getting past an error with lib/validation/spec.js having a unexpected . on line 42.

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 this pull request may close these issues.

2 participants