Closed oliversalzburg closed 9 months ago
You have to import support for each dialect you need support for. It looks like you're using draft-07, so you want your first import to be "@hyperjump/json-schema/draft-07
, not @hyperjump/json-schema
. I'll see about making that more clear in the documentation.
When you import support for a dialect, that includes its meta-schema. So, you shouldn't ever see a standard dialect meta-schema being download if you've set things up correctly. The only time you might need to download a meta-schema is if you're using custom dialect.
About json-schema.org
not serving schemas with the proper media type, that's getting fixed very soon. Until recently there were reasons it was hard to do and it hasn't been a priority because implementations are expected to package the meta-schemas, not download them on demand.
Oh I see. I might have just missed the relevant section of the docs also. That makes it much clearer. Thanks a lot 😊
I'm trying to bundle a schema that I'm working on. I started with this code:
This produces:
This is because the
application/schema+json
media type is defined in the index of this package, which I don't import here. I have to enforce running that code by running the index:When I run that, I then get:
What's the idea here? I certainly can't make
json-schema.org
change how they deliver their schemas. If this media type check is incompatible withjson-schema.org
, why does it even exist? I would assume the JSON Schema specs have to be loaded every time.