-
Notifications
You must be signed in to change notification settings - Fork 44
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(openapi): improvements to circular ref detection, validation errors #1189
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ jobs: | |
`; | ||
|
||
exports[`rdme openapi validate > error handling > should throw an error if an invalid API definition has many errors 1`] = ` | ||
[SyntaxError: OpenAPI schema validation failed. | ||
[ValidationError: OpenAPI schema validation failed. | ||
|
||
REQUIRED must have required property 'url' | ||
|
||
|
@@ -172,10 +172,14 @@ ADDITIONAL PROPERTY must NOT have additional properties | |
29 | "summary": "Finds Pets by status",] | ||
`; | ||
|
||
exports[`rdme openapi validate > error handling > should throw an error if an invalid OpenAPI 3.0 definition is supplied 1`] = `[MissingPointerError: Token "Error" does not exist.]`; | ||
exports[`rdme openapi validate > error handling > should throw an error if an invalid OpenAPI 3.0 definition is supplied 1`] = ` | ||
[ValidationError: API definition schema validation failed. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slightly nicer error message here with this header being shown instead of dumping the user out with "Token "Error" does not exist." |
||
|
||
Missing $ref pointer "#/components/schemas/Error". Token "Error" does not exist.] | ||
`; | ||
|
||
exports[`rdme openapi validate > error handling > should throw an error if an invalid OpenAPI 3.1 definition is supplied 1`] = ` | ||
[SyntaxError: OpenAPI schema validation failed. | ||
[ValidationError: OpenAPI schema validation failed. | ||
|
||
REQUIRED must have required property 'name' | ||
|
||
|
@@ -189,7 +193,7 @@ REQUIRED must have required property 'name' | |
`; | ||
|
||
exports[`rdme openapi validate > error handling > should throw an error if an invalid Swagger definition is supplied 1`] = ` | ||
[SyntaxError: Swagger schema validation failed. | ||
[ValidationError: Swagger schema validation failed. | ||
|
||
ADDITIONAL PROPERTY must NOT have additional properties | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ | |
"@oclif/plugin-help": "^6.2.15", | ||
"@oclif/plugin-not-found": "^3.2.28", | ||
"@oclif/plugin-warn-if-update-available": "^3.1.19", | ||
"@readme/better-ajv-errors": "^2.0.0", | ||
"@readme/better-ajv-errors": "^2.3.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. v2.3.2 was already installed but I just bumped it in the package file. |
||
"ajv": "^8.17.1", | ||
"ajv-formats": "^3.0.1", | ||
"chalk": "^5.3.0", | ||
|
@@ -58,8 +58,8 @@ | |
"ignore": "^7.0.0", | ||
"js-yaml": "^4.1.0", | ||
"mime-types": "^2.1.35", | ||
"oas": "^25.3.0", | ||
"oas-normalize": "^12.1.0", | ||
"oas": "^26.0.1", | ||
"oas-normalize": "^13.0.1", | ||
"ora": "^8.1.1", | ||
"prompts": "^2.4.2", | ||
"semver": "^7.5.3", | ||
|
@@ -77,7 +77,7 @@ | |
"@commitlint/config-conventional": "^19.0.3", | ||
"@oclif/test": "^4.1.0", | ||
"@readme/eslint-config": "^14.3.0", | ||
"@readme/oas-examples": "^5.10.0", | ||
"@readme/oas-examples": "^5.19.1", | ||
"@rollup/plugin-commonjs": "^28.0.0", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"@rollup/plugin-node-resolve": "^16.0.0", | ||
|
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.
These circular refs weren't being picked up before but
@apidevtools/json-schema-ref-parser
is better at detecting them now with anonCircular
hook I submitted to them. APIDevTools/json-schema-ref-parser#366