File tree 4 files changed +82
-48
lines changed
4 files changed +82
-48
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def handle_discriminator(
53
53
return
54
54
55
55
try :
56
- validator .resolver . resolve (ref )
56
+ validator ._validate_reference (ref = ref , instance = instance )
57
57
except :
58
58
yield ValidationError (
59
59
f"{ instance !r} reference { ref !r} could not be resolved" ,
Original file line number Diff line number Diff line change 3
3
from typing import Type
4
4
5
5
from jsonschema import _legacy_validators
6
- from jsonschema import _utils
7
6
from jsonschema import _validators
8
- from jsonschema .protocols import Validator
9
7
from jsonschema .validators import Draft202012Validator
10
8
from jsonschema .validators import create
11
9
from jsonschema .validators import extend
10
+ from jsonschema_specifications import REGISTRY as SPECIFICATIONS
12
11
13
12
from openapi_schema_validator import _format as oas_format
14
13
from openapi_schema_validator import _types as oas_types
15
14
from openapi_schema_validator import _validators as oas_validators
16
15
from openapi_schema_validator ._types import oas31_type_checker
17
16
18
17
OAS30Validator = create (
19
- meta_schema = _utils .load_schema ("draft4" ),
18
+ meta_schema = SPECIFICATIONS .contents (
19
+ "http://json-schema.org/draft-04/schema#" ,
20
+ ),
20
21
validators = {
21
22
"multipleOf" : _validators .multipleOf ,
22
23
# exclusiveMaximum supported inside maximum_draft3_draft4
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ strict = true
20
20
module = " jsonschema.*"
21
21
ignore_missing_imports = true
22
22
23
+ [[tool .mypy .overrides ]]
24
+ module = " jsonschema_specifications"
25
+ ignore_missing_imports = true
26
+
23
27
[[tool .mypy .overrides ]]
24
28
module = " rfc3339_validator"
25
29
ignore_missing_imports = true
@@ -51,8 +55,9 @@ include = [
51
55
52
56
[tool .poetry .dependencies ]
53
57
python = " ^3.8.0"
54
- jsonschema = " >=4.0.0,<4. 18.0 "
58
+ jsonschema = { version = " ^4. 18.0a1 " , allow-prereleases = true }
55
59
rfc3339-validator = " *" # requred by jsonschema for date-time checker
60
+ jsonschema-specifications = " ^2023.5.2"
56
61
57
62
[tool .poetry .extras ]
58
63
docs = [" sphinx" , " sphinx-immaterial" ]
You can’t perform that action at this time.
0 commit comments