From 95204cba61a0912cabc51660820201363367f9d8 Mon Sep 17 00:00:00 2001 From: Artur Maciag Date: Fri, 3 Aug 2018 16:32:24 +0100 Subject: [PATCH] Parameter value deserialization error handling --- openapi_core/schema/parameters/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openapi_core/schema/parameters/models.py b/openapi_core/schema/parameters/models.py index 62a3a39..1037822 100644 --- a/openapi_core/schema/parameters/models.py +++ b/openapi_core/schema/parameters/models.py @@ -108,7 +108,10 @@ class Parameter(object): if not self.schema: return value - deserialized = self.deserialize(value) + try: + deserialized = self.deserialize(value) + except ValueError as exc: + raise InvalidParameterValue(str(exc)) try: return self.schema.unmarshal(deserialized)