summaryrefslogtreecommitdiff
path: root/jsonschema
Commit message (Collapse)AuthorAgeFilesLines
...
* | Just pre-calculate the remotes in the suite loader.Julian Berman2022-12-051-9/+7
| | | | | | | | Half of the things in functools don't exist in 3.7/3.8.
* | Introduce _Case in the test suite loader.Julian Berman2022-12-051-37/+68
| | | | | | | | (Should help on the way to preserving subject information in tests).
* | More type sprinkling in the suite loader.Julian Berman2022-12-052-87/+73
| | | | | | | | Some minor renaming to go with it.
* | Use the newer attrs interface in the test suite loader.Julian Berman2022-12-051-17/+20
| |
* | Add a docstring-ish for exceptions.relevance.Julian Berman2022-12-011-0/+9
| | | | | | | | | | check-docstring-first has to go unfortunately due to pre-commit/pre-commit-hooks#159.
* | Handle the TypeVar for format checker callables.Julian Berman2022-11-301-0/+1
|/ | | | Mostly follows sphinx-doc/sphinx#10785
* Fix instantiating validators with cached refs-to-bool schemas.v4.17.3Julian Berman2022-11-292-2/+18
| | | | Closes: #1018
* Try fixing more Sphinx refs which fail only on Ubuntu...v4.17.2Julian Berman2022-11-292-4/+5
|
* Durations without trailing units aren't valid durations.Julian Berman2022-11-281-1/+3
| | | | Refs: json-schema-org/JSON-Schema-Test-Suite#606
* Empty strings are not valid relative JSON pointers.Julian Berman2022-11-281-0/+3
| | | | | | | (This is unlike non-relative pointers, where empty strings are indeed valid.) Refs: json-schema-org/JSON-Schema-Test-Suite#605
* Minor fix for test case class names (for format tests).Julian Berman2022-11-281-0/+2
| | | | | They were showing up incorrectly in runner output because the default __name__ is wrong for these.
* Un-bundle single-vocabulary meta-schemas.Julian Berman2022-11-1716-2/+578
| | | | | | This seems to work (thanks @FFY00), even though previously I thought I was having issues with importlib.resources. Let's see if CI agrees.
* Emit a better error message for unevaluatedProperties with a subschema.Julian Berman2022-11-172-9/+37
| | | | Closes: #996
* Satisfy mypy's new default.Julian Berman2022-11-111-1/+1
|
* Re-add the second test for importing jsonschema.cliJulian Berman2022-11-021-0/+17
| | | | | | (This doesn't functionally change anything, but does resolve some warnings module frustration thanks to @asottile and @gaborbernat.)
* Enable format validation by default in check_schema.v4.17.0Julian Berman2022-11-012-2/+18
| | | | | | | | 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
* Update the Draft 3 and 4 metaschemas.Julian Berman2022-11-013-18/+31
| | | | | | | | | | | | | | | | | | | 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
* Deprecate the CLI (via import or running normally).Julian Berman2022-11-013-2/+31
| | | | | | | | | | 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
* Fix the grammar on ErrorTree's repr when it has 1 error.Julian Berman2022-10-052-2/+18
|
* Ignore PyCQA/flake8-bugbear#287.Julian Berman2022-10-051-1/+1
| | | | For better or worse this is already part of this function's API.
* Deprecate jsonschema.draftN_format_checker attributes.v4.16.0Julian Berman2022-09-093-23/+134
| | | | | | | | | | | | | | | | 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)
* Fix more $ref cases when the lookup URL is different from an $idJulian Berman2022-09-092-10/+27
| | | | | | | | 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.
* Minor verbiage tweak for protocols.v4.15.0Julian Berman2022-08-311-2/+2
|
* Don't show type checker functions in TypeChecker reprs.Julian Berman2022-08-302-1/+9
|
* Add some deprecated directives (for previous deprecations) to the docs.Julian Berman2022-08-302-0/+12
|
* Remove the incorrect Optional from FormatChecker's formats annotation.Julian Berman2022-08-301-1/+1
| | | | | | | | 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.
* Minor non-functional changes to FormatChecker docstrings and __init__.Julian Berman2022-08-301-11/+9
|
* Wouldn't be complete without refs which fail now only in ReadTheDocs. :/Julian Berman2022-08-291-2/+3
|
* Of course the tweaked name doesn't work on macOS.Julian Berman2022-08-291-2/+2
| | | | Hopefully this works on both.
* Fix some ambiguous API refs which only fail on Sphinx+Linux :/Julian Berman2022-08-291-5/+6
|
* Experiment with autoapi for generating explicit API documentation.Julian Berman2022-08-291-2/+1
| | | | Ref: #590
* Fix $id in the presence of $ref on draft 6 and 7.Julian Berman2022-08-283-21/+22
| | | | | | | | | | 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.
* Don't skip tests while debugging.Julian Berman2022-08-281-1/+1
| | | | | This will maybe get annoying if debugging many at once, but works better for specifically mentioning one test.
* Remove the TODO for draft 7 content assertions.Julian Berman2022-08-281-23/+0
| | | | See https://github.com/python-jsonschema/jsonschema/issues/593#issuecomment-1221527128
* Add ID_OF to the protocol, and schemas are arbitrary mappings.Julian Berman2022-08-211-6/+10
| | | | They aren't necessarily dicts.
* Fix unevaluatedItems on draft2019.Julian Berman2022-08-203-57/+80
| | | | | | | | 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.
* We've wontfixed the upstream issue.Julian Berman2022-08-201-2/+2
|
* Deprecate FormatChecker.cls_checks.Julian Berman2022-08-203-3/+36
| | | | | | It exposes fragile global state. Closes: #519.
* More tweaking of type-hinted Sphinx docstrings for TypeCheckers.Julian Berman2022-08-201-32/+19
|
* Type pmap using pyrsistent's typing.Julian Berman2022-08-201-15/+9
| | | | Dealing with mypy is <insert 4 letter word here>.
* Standardize the format of Raises: in napolean docstrings.Julian Berman2022-08-204-10/+14
| | | | | | | | | | | | | | | 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...
* Convert more docs in protocols to napoleon.Julian Berman2022-08-201-26/+56
| | | | | Also rely more on sphinx's type annotation support, which seems to detect the argument types without duplicating.
* Fix mypy types for protocols.ValidatorJulian Berman2022-08-201-4/+4
| | | | | | | | | 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).
* Support validator classes whose metaschema uses a different dialect.v4.13.0Julian Berman2022-08-192-1/+34
| | | | | | | | | | | 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.
* Remove some old unnecessary explicit object superclasses.Julian Berman2022-08-1810-18/+18
|
* Warn at runtime when subclassing validator classes.v4.12.0Julian Berman2022-08-183-4/+45
| | | | | | | | | | | | | 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
* Use an explicit default provided to validator_for in all cases.v4.10.3Julian Berman2022-08-182-12/+22
| | | | | | | | 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.
* Fix one more Validator.evolve issue for downstream Validators.v4.10.2Julian Berman2022-08-172-5/+9
| | | | | | Here for renamed attributes out of attrs-using classes. Refs: 'https://github.com/python-jsonschema/jsonschema/issues/982#issuecomment-1218117191'
* Fix calling Validator.evolve for some downstream users.v4.10.1Julian Berman2022-08-172-1/+33
| | | | | | | | | | | | | | 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
* Better error message for network access in test runs.Julian Berman2022-08-171-2/+2
|