java-json-tools / json-schema-core

Core support architecture for json-schema-validator and other processors
Other
67 stars 57 forks source link

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

Open crankydillo opened 8 years ago

crankydillo commented 8 years ago

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?

huggsboson commented 7 years ago

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

queenaqian commented 5 years ago

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.