Skip to content

ParametersError context property deprecated #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion openapi_core/validation/request/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from dataclasses import dataclass
from typing import Iterable

Expand All @@ -9,7 +10,16 @@
@dataclass
class ParametersError(Exception):
parameters: Parameters
context: Iterable[Exception]
errors: Iterable[Exception]

@property
def context(self) -> Iterable[Exception]:
warnings.warn(
"context property of ParametersError is deprecated. "
"Use erros instead.",
DeprecationWarning,
)
return self.errors


class OpenAPIRequestBodyError(OpenAPIError):
Expand Down
2 changes: 1 addition & 1 deletion openapi_core/validation/request/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _get_parameters(
location[param_name] = value

if errors:
raise ParametersError(context=errors, parameters=parameters)
raise ParametersError(errors=errors, parameters=parameters)

return parameters

Expand Down