File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 5
5
from typing import Type
6
6
from typing import TypeVar
7
7
8
- from jsonschema .protocols import Validator
9
8
from jsonschema_spec import Spec as JsonschemaSpec
10
9
from 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
12
12
13
13
TSpec = TypeVar ("TSpec" , bound = "Spec" )
14
14
@@ -24,7 +24,7 @@ def create(
24
24
url : str = "" ,
25
25
ref_resolver_handlers : Dict [str , Any ] = default_handlers ,
26
26
separator : str = SPEC_SEPARATOR ,
27
- validator : Validator = openapi_v30_spec_validator ,
27
+ validator : SupportsValidation = openapi_spec_validator_proxy ,
28
28
) -> TSpec :
29
29
if validator is not None :
30
30
validator .validate (data , spec_url = url )
Original file line number Diff line number Diff line change 1
1
import pytest
2
- from jsonschema . exceptions import ValidationError
2
+ from openapi_spec_validator . validation . exceptions import ValidatorDetectError
3
3
4
4
from openapi_core .spec import Spec
5
5
6
6
7
7
class TestEmpty :
8
8
def test_raises_on_invalid (self ):
9
- with pytest .raises (ValidationError ):
9
+ with pytest .raises (ValidatorDetectError ):
10
10
Spec .create ("" )
You can’t perform that action at this time.
0 commit comments