-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: adding support for OpenAPI 3.1 #378
Conversation
@@ -68,36 +68,7 @@ describe('rdme openapi', () => { | |||
}); | |||
}); | |||
|
|||
it('should error if API errors', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a whole bunch of nits like this in this changeset but the gist of what I did in this file are:
- Move errors into an "error handling" describe.
- Fix some confusing
it
language. - Add some tests to make sure that errors that are coming back from
oas-normalize
(and@readme/openapi-parser
) are of the new format. - Use specs that we have in
@readme/oas-examples
. - Add tests for JSON and YAML definitions.
const oas = new OASNormalize(specPath, { enablePaths: true }); | ||
await oas.validate().catch(err => { | ||
const oas = new OASNormalize(specPath, { colorizeErrors: true, enablePaths: true }); | ||
await oas.validate(false, { validate: { colorizeErrors: true } }).catch(err => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This option controls the pretty errors that'll be shown. If colorizeErrors
is false (it's false by default) those errors will still look nice they just won't have colors or bold text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests look good 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested locally and it seems to be failing at readme.io, instead of in the lib, so it seems good to go once we're ready
🧰 Changes
oas
to support OpenAPI 3.1 within itsrdme oas generate
command for generating API definitions.Fixes RM-1813
🧬 QA & Testing
See tests.