From 7a97cd7d95b3bee826b6d60cef4fdea1f4880fc8 Mon Sep 17 00:00:00 2001 From: Max Metz Date: Tue, 10 Sep 2024 13:50:13 +0200 Subject: [PATCH] format of exceptions now always follows baseline format. 'errors'-key is always a list of dictionaries. --- src/server/BreCal/validators/validation_error.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/BreCal/validators/validation_error.py b/src/server/BreCal/validators/validation_error.py index 36f5cc8..e108222 100644 --- a/src/server/BreCal/validators/validation_error.py +++ b/src/server/BreCal/validators/validation_error.py @@ -35,7 +35,8 @@ def create_validation_error_response(ex:ValidationError, status_code:int=400, cr errors = {"undefined_schema":errors} errors = {k:v if isinstance(v,list) else [v] for k,v in errors.items()} - # hence, errors always has the following type: dict[str, list[str]] + # hence, errors always has the following type: list[dict[str, list[str]]] + errors = [errors] # example: