java-json-tools/json-schema-core

$ref - relative references - './a.json' != 'a.json' ?

crankydillo opened this issue · 2 comments

I'm having the same problem as documented in this swagger issue.

It seems clear that the author wants the $ref URIs to be normalized, so I'm very hesitant to call this a bug.

Mainly, I'm curious if there is justification for this requirement. If normalization is required due to an implementation detail, couldn't the implementation just normalize the URI internally?

I'm not sure why the $ref would be normalized. Maybe it was implemented to protect on $schema and $ref was collateral damage.
http://json-schema.org/latest/json-schema-core.html#rfc.section.7

I think maybe we could just use the resolved uri. The URI resolver will remove ./ for normalization when we want to ref to local directory. That will cause the schema syntax validation fail.