-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add jsonschema 4.17.3 to asdf/_jsonschema
- remove deprecated and unused jsonschema cli - include tests (can be run with '--jsonschema' option) - add ci label to run tests 'jsonschema'
- Loading branch information
Showing
636 changed files
with
98,871 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ eggs | |
.eggs | ||
parts | ||
bin | ||
!asdf/json/bin | ||
var | ||
sdist | ||
develop-eggs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2013 Julian Berman | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The files in this directory were originally cloned from | ||
|
||
jsonschema 4.17.3 | ||
|
||
https://github.com/python-jsonschema/jsonschema/releases/tag/v4.17.3 | ||
|
||
See COPYING for use restrictions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
An implementation of JSON Schema for Python | ||
The main functionality is provided by the validator classes for each of the | ||
supported JSON Schema versions. | ||
Most commonly, `asdf._jsonschema.validators.validate` is the quickest way to simply | ||
validate a given instance under a schema, and will create a validator | ||
for you. | ||
""" | ||
import warnings | ||
|
||
from asdf._jsonschema._format import FormatChecker | ||
from asdf._jsonschema._types import TypeChecker | ||
from asdf._jsonschema.exceptions import ( | ||
ErrorTree, | ||
FormatError, | ||
RefResolutionError, | ||
SchemaError, | ||
ValidationError, | ||
) | ||
from asdf._jsonschema.protocols import Validator | ||
from asdf._jsonschema.validators import ( | ||
Draft3Validator, | ||
Draft4Validator, | ||
Draft6Validator, | ||
Draft7Validator, | ||
Draft201909Validator, | ||
Draft202012Validator, | ||
RefResolver, | ||
validate, | ||
) | ||
|
||
|
||
def __getattr__(name): | ||
format_checkers = { | ||
"draft3_format_checker": Draft3Validator, | ||
"draft4_format_checker": Draft4Validator, | ||
"draft6_format_checker": Draft6Validator, | ||
"draft7_format_checker": Draft7Validator, | ||
"draft201909_format_checker": Draft201909Validator, | ||
"draft202012_format_checker": Draft202012Validator, | ||
} | ||
ValidatorForFormat = format_checkers.get(name) | ||
if ValidatorForFormat is not None: | ||
warnings.warn( | ||
f"Accessing asdf._jsonschema.{name} is deprecated and will be " | ||
"removed in a future release. Instead, use the FORMAT_CHECKER " | ||
"attribute on the corresponding Validator.", | ||
DeprecationWarning, | ||
stacklevel=2, | ||
) | ||
return ValidatorForFormat.FORMAT_CHECKER | ||
|
||
raise AttributeError(f"module {__name__} has no attribute {name}") |
Oops, something went wrong.