Skip to content

Conversation

@miikka
Copy link
Contributor

@miikka miikka commented Sep 2, 2016

This is done by unsetting the id field in swagger-schema.json.

At first I thought the right way to do this would be to use inline dereferencing. Now I'm thinking that ring-swagger would need inline dereferencing only accidentally - the real problem is that scjsv does not know that the URL of the schema is the same as its id.

There are two solutions: to remove the id (like in this PR) or to teach scjsv about the URL by creating a JsonLoadingFactory with this schema preloaded for the right URL.

The id specifies the URL resolution scope for the $refs in the schema.
When validating an object against the schema, scjsv tries to dereference
that URL, which means requesting it from the Internet.
@ikitommi
Copy link
Member

ikitommi commented Sep 2, 2016

LGTM

@miikka miikka merged commit 698be06 into metosin:master Sep 3, 2016
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