json-schema: Add context to a fetch error response when referencing an external schema
take this schema as an example, it fails validation when fetching geoJSON
referencing an external schema
https://github.com/iptc/newsinjson/blob/version1.5version2.1/specification/ninjs-schema_2.1.json
It would be helpful to add more context to this error, either the property where it failed or the url which failed. The error is passed from undici.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 19
It does now (as of 2020-12), but that hasn’t always been the case. Previously, an
$id
in a sub-schema just meant a change in base URI in the same schema, not an embedded schema. The concept of$id
representing an embedded schema was introduced in 2019-09, but there was an unfortunate line in the spec that said that the dialect of an embedded schema had to match the dialect of the parent schema. It wasn’t until 2020-12 that embedding and external references became the same thing. Therefore, it’s a bit ambiguous/undefined what happens when you embed a pre-2020-12 schema because the concept was different.You should now (v1.4.3) see the same helpful message for missing dialect support when in an embedded schema than you would for a root schema.
You haven’t loaded support for the dialects needed for this schema.
You need to load support for draft-07 because that’s what the GeoJSON schema uses. There’s supposed to be an error that tells you that, but apparently that isn’t working for embedded schemas.