| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
Half of the things in functools don't exist in 3.7/3.8.
|
| |
| |
| |
| | |
(Should help on the way to preserving subject information in tests).
|
| |
| |
| |
| | |
Some minor renaming to go with it.
|
| | |
|
| |
| |
| |
| |
| | |
check-docstring-first has to go unfortunately due to
pre-commit/pre-commit-hooks#159.
|
|/
|
|
| |
Mostly follows sphinx-doc/sphinx#10785
|
|
|
|
| |
Closes: #1018
|
| |
|
|
|
|
| |
Refs: json-schema-org/JSON-Schema-Test-Suite#606
|
|
|
|
|
|
|
| |
(This is unlike non-relative pointers, where empty strings are indeed
valid.)
Refs: json-schema-org/JSON-Schema-Test-Suite#605
|
|
|
|
|
| |
They were showing up incorrectly in runner output because
the default __name__ is wrong for these.
|
|
|
|
|
|
| |
This seems to work (thanks @FFY00), even though
previously I thought I was having issues with
importlib.resources. Let's see if CI agrees.
|
|
|
|
| |
Closes: #996
|
| |
|
|
|
|
|
|
| |
(This doesn't functionally change anything, but does
resolve some warnings module frustration thanks to
@asottile and @gaborbernat.)
|
|
|
|
|
|
|
|
| |
This catches some additional schema problems (ones caught
by format validation in the metaschema, which was previously treated
as annotation-only in check_schema).
Closes: #904
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For draft 4 this pulls in upstream fixes which were not present locally,
notably fixing `id` to not have `format: uri` in it, because location
independent identifiers are indeed not URIs (they're URI references as
later metaschemas use).
For enum, on draft 3 and 4, this also *re-adds* constraints that enum
items MUST be unique and the array non-empty. In later drafts, this
restriction was loosened (see
json-schema-org/json-schema-spec@cf0ec7210011272f4e95f70f8c1374593e13c8c5)
as well as https://github.com/json-schema-org/json-schema-spec/issues/717#issuecomment-1299112660
but in drafts 3 and 4 it is present.
The draft 4 metaschema contains these assertions, the draft 3 one is
still buggy and does not, so they're just applied locally here.
Ref: json-schema-org/json-schema-spec#310
|
|
|
|
|
|
|
|
|
|
| |
It is less featureful (and less maintained) than the new
'official' option, check-jsonschema.
See https://github.com/python-jsonschema/check-jsonschema
for details.
Closes: #600
|
| |
|
|
|
|
| |
For better or worse this is already part of this function's API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Format support / enablement will change with vocabulary support,
but in the interim, now that #905 is merged, these objects are
better accessed by retrieving them directly from the corresponding
validator.
In other words: don't do:
from jsonschema import draft202012_format_checker
just do
from jsonschema import Draft202012Validator
do_whatever_with(Draft202012Validator.FORMAT_CHECKER)
|
|
|
|
|
|
|
|
| |
Passes a few more of the just-added upstream tests (and in particular
is a last URN $id-related fix).
One test still fails which is waiting for more tweaks to how remote ref
lookups are done.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
See https://docs.python.org/3/library/typing.html#typing.Optional.
This is meant to be used only if None is a specifically allowed value, where
here it is not, it's an internal sentinel, not part of its public API, which
only allows iterables.
|
| |
|
| |
|
|
|
|
| |
Hopefully this works on both.
|
| |
|
|
|
|
| |
Ref: #590
|
|
|
|
|
|
|
|
|
|
| |
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 will maybe get annoying if debugging many at once, but
works better for specifically mentioning one test.
|
|
|
|
| |
See https://github.com/python-jsonschema/jsonschema/issues/593#issuecomment-1221527128
|
|
|
|
| |
They aren't necessarily dicts.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
It exposes fragile global state.
Closes: #519.
|
| |
|
|
|
|
| |
Dealing with mypy is <insert 4 letter word here>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sphinx appears to 'helpfully' silently truncate the line if
any text is put on the same line as the exception, i.e.:
Raises:
foo, if bar
just silently produces:
foo -
and throws the line away...
|
|
|
|
|
| |
Also rely more on sphinx's type annotation support, which
seems to detect the argument types without duplicating.
|
|
|
|
|
|
|
|
|
| |
iter_errors returns an iterable, and doesn't guarantee it's an
iterator (this is present in the text documentation).
And instances are any Python object, not just dicts.
(CC @sirosen just FYI and in case I made some silly error).
|
|
|
|
|
|
|
|
|
|
|
| |
In other words, one may author validator classes (via
jsonschema.validators.create or extend) whose meta schema defines schema
behavior using JSON Schema draft2020-12 but whose schemas are in its own
dialect.
Said again differently, the set of valid schemas for a validator class
may be governed by one draft, while the schema behavior itself is
governed by another.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Doing so was not intended to be public API, though it seems
some downstream libraries do so.
A future version will make this an error, as it is brittle and
better served by composing validator objects instead.
Feel free to reach out if there are any cases where changing
existing code seems difficult and I can try to provide guidance.
Refs: #982
|
|
|
|
|
|
|
|
| |
Previously it was only used when $schema was not present, but clearly
it should be used even when it is but the URI is not recognized.
Combined with #981 this *hopefully* now handles the remaining downstream
users with subclasses.
|
|
|
|
|
|
| |
Here for renamed attributes out of attrs-using classes.
Refs: 'https://github.com/python-jsonschema/jsonschema/issues/982#issuecomment-1218117191'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The broken case here was subclassing a validator class, something that
isn't really a supported use of the Validator classes, but of course one
can't blame anyone too much since doing so didn't raise an error or emit
any warning.
In the next release subclassing will warn, and at some point afterwards
will become an explicit error. If you're a downstream user of this
library looking for a way to avoid whichever inheritance is currently
needed in your library feel free to reach out and I'll try to help.
Closes: #982
|
| |
|