Skip to content

Commit cc7f174

Browse files
committed
parameters error context property deprecated
1 parent 83f801b commit cc7f174

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

openapi_core/validation/request/exceptions.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from dataclasses import dataclass
23
from typing import Iterable
34

@@ -9,7 +10,16 @@
910
@dataclass
1011
class ParametersError(Exception):
1112
parameters: Parameters
12-
context: Iterable[Exception]
13+
errors: Iterable[Exception]
14+
15+
@property
16+
def context(self) -> Iterable[Exception]:
17+
warnings.warn(
18+
"context property of ParametersError is deprecated. "
19+
"Use erros instead.",
20+
DeprecationWarning,
21+
)
22+
return self.errors
1323

1424

1525
class OpenAPIRequestBodyError(OpenAPIError):

openapi_core/validation/request/validators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _get_parameters(
119119
location[param_name] = value
120120

121121
if errors:
122-
raise ParametersError(context=errors, parameters=parameters)
122+
raise ParametersError(errors=errors, parameters=parameters)
123123

124124
return parameters
125125

0 commit comments

Comments
 (0)