You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since 836db7c, there's no more public API for determining the supported schema URIs.
Providing an unsupported URI silently uses the latest draft, and I'd like to be able to prevent this, or alert the user in my app. That alone I can do (a bit awkwardly) with
sentinel=object()
validator=validator_for(schema, sentinel)
ifvalidatorissentinel:
ifschema_uri:=schema.get('$schema')
raiseValueError(f"Schema had unsupported {schema_uri!r}")
else:
raiseValueError("Schema had no $schema, refusing to default")
What I still cannot do, is be more helpful and list the supported URIs, because meta_schemas is private now.
The text was updated successfully, but these errors were encountered:
Thanks! This is similar to #1052 which also coincidentally was opened recently, even though this deprecation happened a while back as you found.
My answer for now is the same as #1052 (comment) -- if you want the full list just make a dict of all the current JSON Schema metaschema URIs.
But the feedback is welcome, somewhere down the line if enough people need this I'm happy to reconsider in a few versions once the old globals are gone and there's something like a registry of supported dialects where this sort of thing can live.
Since 836db7c, there's no more public API for determining the supported schema URIs.
Providing an unsupported URI silently uses the latest draft, and I'd like to be able to prevent this, or alert the user in my app. That alone I can do (a bit awkwardly) with
What I still cannot do, is be more helpful and list the supported URIs, because
meta_schemas
is private now.The text was updated successfully, but these errors were encountered: