5
5
from openapi_core .casting .schemas .exceptions import CastError
6
6
from openapi_core .deserializing .exceptions import DeserializeError
7
7
from openapi_core .schema .media_types .exceptions import InvalidContentType
8
- from openapi_core .schema .operations .exceptions import InvalidOperation
9
8
from openapi_core .schema .parameters .exceptions import (
10
9
MissingRequiredParameter , MissingParameter ,
11
10
)
12
- from openapi_core .schema .paths .exceptions import InvalidPath
13
11
from openapi_core .schema .request_bodies .exceptions import MissingRequestBody
14
- from openapi_core .schema .servers .exceptions import InvalidServer
15
12
from openapi_core .security .exceptions import SecurityError
13
+ from openapi_core .templating .paths .exceptions import PathError
16
14
from openapi_core .unmarshalling .schemas .enums import UnmarshalContext
17
15
from openapi_core .unmarshalling .schemas .exceptions import (
18
16
UnmarshalError , ValidateError ,
@@ -30,7 +28,7 @@ def validate(self, request):
30
28
try :
31
29
path , operation , _ , _ , _ = self ._find_path (request )
32
30
# don't process if operation errors
33
- except ( InvalidServer , InvalidPath , InvalidOperation ) as exc :
31
+ except PathError as exc :
34
32
return RequestValidationResult ([exc , ], None , None , None )
35
33
36
34
try :
@@ -53,7 +51,7 @@ def validate(self, request):
53
51
def _validate_parameters (self , request ):
54
52
try :
55
53
path , operation , _ , _ , _ = self ._find_path (request )
56
- except ( InvalidServer , InvalidPath , InvalidOperation ) as exc :
54
+ except PathError as exc :
57
55
return RequestValidationResult ([exc , ], None , None )
58
56
59
57
params , params_errors = self ._get_parameters (
@@ -67,7 +65,7 @@ def _validate_parameters(self, request):
67
65
def _validate_body (self , request ):
68
66
try :
69
67
_ , operation , _ , _ , _ = self ._find_path (request )
70
- except ( InvalidServer , InvalidOperation ) as exc :
68
+ except PathError as exc :
71
69
return RequestValidationResult ([exc , ], None , None )
72
70
73
71
body , body_errors = self ._get_body (request , operation )
0 commit comments