55from openapi_core .casting .schemas .exceptions import CastError
66from openapi_core .deserializing .exceptions import DeserializeError
77from openapi_core .schema .media_types .exceptions import InvalidContentType
8- from openapi_core .schema .operations .exceptions import InvalidOperation
98from openapi_core .schema .parameters .exceptions import (
109 MissingRequiredParameter , MissingParameter ,
1110)
12- from openapi_core .schema .paths .exceptions import InvalidPath
1311from openapi_core .schema .request_bodies .exceptions import MissingRequestBody
14- from openapi_core .schema .servers .exceptions import InvalidServer
1512from openapi_core .security .exceptions import SecurityError
13+ from openapi_core .templating .paths .exceptions import PathError
1614from openapi_core .unmarshalling .schemas .enums import UnmarshalContext
1715from openapi_core .unmarshalling .schemas .exceptions import (
1816 UnmarshalError , ValidateError ,
@@ -30,7 +28,7 @@ def validate(self, request):
3028 try :
3129 path , operation , _ , _ , _ = self ._find_path (request )
3230 # don't process if operation errors
33- except ( InvalidServer , InvalidPath , InvalidOperation ) as exc :
31+ except PathError as exc :
3432 return RequestValidationResult ([exc , ], None , None , None )
3533
3634 try :
@@ -53,7 +51,7 @@ def validate(self, request):
5351 def _validate_parameters (self , request ):
5452 try :
5553 path , operation , _ , _ , _ = self ._find_path (request )
56- except ( InvalidServer , InvalidPath , InvalidOperation ) as exc :
54+ except PathError as exc :
5755 return RequestValidationResult ([exc , ], None , None )
5856
5957 params , params_errors = self ._get_parameters (
@@ -67,7 +65,7 @@ def _validate_parameters(self, request):
6765 def _validate_body (self , request ):
6866 try :
6967 _ , operation , _ , _ , _ = self ._find_path (request )
70- except ( InvalidServer , InvalidOperation ) as exc :
68+ except PathError as exc :
7169 return RequestValidationResult ([exc , ], None , None )
7270
7371 body , body_errors = self ._get_body (request , operation )
0 commit comments