| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
This is specified behavior, see json-schema-org/JSON-Schema-Test-Suite#643.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Passes all the remaining referencing tests across all drafts, hooray!
Makes Validators take a referencing.Registry argument which users should
use to customize preloaded schemas, or to configure remote reference
retrieval.
This fully obsoletes jsonschema.RefResolver, which has already been
deprecated in a previous commit. Users should move to instead loading
schemas into referencing.Registry objects.
See the referencing documentation at https://referencing.rtfd.io/ for
details (with more jsonschema-specific information to be added shortly).
Note that the interface for resolving references on a Validator is not
yet public (and hidden behind _resolver and _validate_reference
attributes). One or both of these are likely to become public after some
period of stabilization.
Feedback is of course welcome!
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In these drafts, not only did $ref cause other validator keywords
to be ignored, it prevents $id from setting the resolution scope
too.
In draft 3 and 4 this is now half-fixed in the sense that the
correct URI is now the one that will be retrieved, but the logic
for finding subschemas by ID is still broken on these drafts.
|
|
|
|
|
|
|
|
| |
This was trivial, other than needing to copy paste the
function which anyhow needs removal.
It only didn't work previously because of the items -> prefixItems
rename in draft2020.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In newer JSON Schema specifications we've standardized more
on this language rather than calling things validators (and such
a thing already has plenty of overloaded meaning here).
This commit doesn't do any deprecation, so there's still some
awkwardness in that ValidationError.validator is the keyword which
failed validation, and Validator.VALIDATORS is a mapping of keywords to
callables.
We may choose to do so later, but for now will save some API churn in
case something else changes.
|
|
|
|
|
|
|
|
|
|
| |
It's buggy, and can lead to blowing up the stack with recursion errors.
Done by (redundantly) checking schemas during test runs, even though the
upstream test suite 'guarantees' they're valid. (Given that it uses this
implementation to make that guarantee, bugs like the above went unnoticed.)
Closes: #847
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A Validator should be thought of as encapsulating validation with a
single fixed schema.
Previously, iter_errors and is_valid allowed passing a second argument,
which was a different schema to use for one method call.
This was mostly for convenience, since the second argument is often
used during sub-validation whilst say, recursing.
The correct way to do so now is to say:
validator.evolve(schema=new_schema).iter_errors(...)
validator.evolve(schema=new_schema).is_valid(...)
instead, which is essentially equally convenient.
Closes: #522
|
|
|
|
|
|
| |
This makes the (anyhow-not-yet-working) dynamicRef validators
access private state on ref resolvers, but that will be fixed
when aforementioned not-working is fixed.
|
|
|
|
|
| |
We don't want to grow the public API of RefResolvers, they
have enough issues already.
|
| |
|
|
|
|
|
|
| |
Since then, types aren't objects, they're just strings.
This just wastes time catching exceptions for newer drafts.
|
| |
|
| |
|
|
|
|
| |
recursiveRef is broken in the same way dynamicRef is.
|
|
|
|
| |
Add flake8-commas to ensure this stays the case.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
add contains legacy validator
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Draft 3 allowed simple string dependencies, but no
later draft does.
This also lets us use the same fix for boolean schema
nonsense as we just did for items.
|
|
|