From 9df93c77fa391920ace89bf7c409e44cb1482019 Mon Sep 17 00:00:00 2001 From: p1c2u Date: Mon, 16 Jan 2023 10:51:37 +0000 Subject: [PATCH] Revert "Merge pull request #461 from p1c2u/revert/parameters-error-context-property-deprecated-revert" This reverts commit 3cc812f313da8a80a7dffbc9db6333f8c458fa5b, reversing changes made to 4945be0b4af028da451626c93e9979ba29658748. --- openapi_core/validation/request/exceptions.py | 12 +++++++++++- openapi_core/validation/request/validators.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openapi_core/validation/request/exceptions.py b/openapi_core/validation/request/exceptions.py index 7485ae53..2702656a 100644 --- a/openapi_core/validation/request/exceptions.py +++ b/openapi_core/validation/request/exceptions.py @@ -1,3 +1,4 @@ +import warnings from dataclasses import dataclass from typing import Iterable @@ -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): diff --git a/openapi_core/validation/request/validators.py b/openapi_core/validation/request/validators.py index ec703d5a..1f431fa6 100644 --- a/openapi_core/validation/request/validators.py +++ b/openapi_core/validation/request/validators.py @@ -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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy