13
13
from openapi_core .schema .request_bodies .exceptions import MissingRequestBody
14
14
from openapi_core .schema .servers .exceptions import InvalidServer
15
15
from openapi_core .security .exceptions import SecurityError
16
+ from openapi_core .templating .paths .exceptions import PathNotFound
16
17
from openapi_core .unmarshalling .schemas .enums import UnmarshalContext
17
18
from openapi_core .unmarshalling .schemas .exceptions import (
18
19
UnmarshalError , ValidateError ,
@@ -30,7 +31,7 @@ def validate(self, request):
30
31
try :
31
32
path , operation , _ , _ , _ = self ._find_path (request )
32
33
# don't process if operation errors
33
- except ( InvalidServer , InvalidPath , InvalidOperation ) as exc :
34
+ except PathNotFound as exc :
34
35
return RequestValidationResult ([exc , ], None , None , None )
35
36
36
37
try :
@@ -53,7 +54,7 @@ def validate(self, request):
53
54
def _validate_parameters (self , request ):
54
55
try :
55
56
path , operation , _ , _ , _ = self ._find_path (request )
56
- except ( InvalidServer , InvalidPath , InvalidOperation ) as exc :
57
+ except PathNotFound as exc :
57
58
return RequestValidationResult ([exc , ], None , None )
58
59
59
60
params , params_errors = self ._get_parameters (
@@ -67,7 +68,7 @@ def _validate_parameters(self, request):
67
68
def _validate_body (self , request ):
68
69
try :
69
70
_ , operation , _ , _ , _ = self ._find_path (request )
70
- except ( InvalidServer , InvalidOperation ) as exc :
71
+ except PathNotFound as exc :
71
72
return RequestValidationResult ([exc , ], None , None )
72
73
73
74
body , body_errors = self ._get_body (request , operation )
0 commit comments