Closed as not planned
Description
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)
if validator is sentinel:
if schema_uri := schema.get('$schema')
raise ValueError(f"Schema had unsupported {schema_uri!r}")
else:
raise ValueError("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.
Metadata
Metadata
Assignees
Labels
No labels