json-schema-org / JSON-Schema-Test-Suite

A language agnostic test suite for the JSON Schema specifications
MIT License
625 stars 209 forks source link

Include fragment in schemaLocation #671

Closed marksparkza closed 1 year ago

marksparkza commented 1 year ago

https://github.com/json-schema-org/json-schema-spec/blob/70af7dcf147759f9eaecae5c574f0b36cc86a276/jsonschema-core.xml#L2851

marksparkza commented 1 year ago

I should probably have referenced this clause, which does say MUST.

The fragment isn't necessary to identify/resolve the root, but I don't think there's any reason not to mandate that it must be present in "schemaLocation". It ensures consistency across implementations, and it's also simpler to specify - "there must be a fragment" as opposed to "there must be a fragment unless it's the root in which case there may be a fragment"...

Julian commented 1 year ago

Merging since the spec seems clear this is correct (and wasn't previously correct) but if someone has some reason to disagree, follow up after.