-
Notifications
You must be signed in to change notification settings - Fork 78
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
Optionally support treating $ref like JSON Schema #45
Conversation
@@ -822,11 +830,6 @@ function checkSecurity(security,openapi,options) { | |||
|
|||
function validateSync(openapi, options, callback) { | |||
setupOptions(options,openapi); | |||
if (options.jsonschema) { |
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 was some old JSON Schema option which wasnt documented or used, so I killed it.
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.
It's documented here and used unless you removed it?
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.
Yeah I removed it :) I dont think its a feature we'll need in Speccy.
lint.js
Outdated
} | ||
return output; | ||
} | ||
|
||
function readableJsonSchemaMessages(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.
The huge errors were making me upset, so this change ended up in this PR.
5c552a7
to
6715dad
Compare
d9d26f7
to
115c13a
Compare
115c13a
to
a0fd94b
Compare
I've trimmed this PR down a little for easier reviewing. The errors stuff has been moved out to #47. |
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.
looks good and tests pass 👍
We use JSON Schema for contract testing, and want to reuse those JSON Schema models for OpenAPI documentation. Seeing as OpenAPI has imperfect (subset & superset) support for JSON Schema, we have to convert one to the other at runtime.
For now it is using an optional switch, which is a little annoying to do every time, but when #14 is done that'll just go in the config file.
Example