File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 55from typing import Type
66from typing import TypeVar
77
8- from jsonschema .protocols import Validator
98from jsonschema_spec import Spec as JsonschemaSpec
109from jsonschema_spec import default_handlers
11- from openapi_spec_validator import openapi_v30_spec_validator
10+ from openapi_spec_validator .validation import openapi_spec_validator_proxy
11+ from openapi_spec_validator .validation .protocols import SupportsValidation
1212
1313TSpec = TypeVar ("TSpec" , bound = "Spec" )
1414
@@ -24,7 +24,7 @@ def create(
2424 url : str = "" ,
2525 ref_resolver_handlers : Dict [str , Any ] = default_handlers ,
2626 separator : str = SPEC_SEPARATOR ,
27- validator : Validator = openapi_v30_spec_validator ,
27+ validator : SupportsValidation = openapi_spec_validator_proxy ,
2828 ) -> TSpec :
2929 if validator is not None :
3030 validator .validate (data , spec_url = url )
Original file line number Diff line number Diff line change 11import pytest
2- from jsonschema . exceptions import ValidationError
2+ from openapi_spec_validator . validation . exceptions import ValidatorDetectError
33
44from openapi_core .spec import Spec
55
66
77class TestEmpty :
88 def test_raises_on_invalid (self ):
9- with pytest .raises (ValidationError ):
9+ with pytest .raises (ValidatorDetectError ):
1010 Spec .create ("" )
You can’t perform that action at this time.
0 commit comments