From 556a29a55af6459f818814f754ae6d241eb47912 Mon Sep 17 00:00:00 2001 From: Juho Inkinen <34240031+juhoinkinen@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:43:18 +0300 Subject: [PATCH] Exclude fuzzy cases where path parameters contain newline "%0A" --- tests/test_openapi.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_openapi.py b/tests/test_openapi.py index 0c98807d4..9b872c79c 100644 --- a/tests/test_openapi.py +++ b/tests/test_openapi.py @@ -7,6 +7,15 @@ schema = schemathesis.from_path("annif/openapi/annif.yaml") +@schemathesis.hook("filter_path_parameters") +def filter_path_parameters(context, path_parameters): + # Exclude path parameters containing newline which crashes application + # https://github.com/spec-first/connexion/issues/1908 + if path_parameters is not None and "project_id" in path_parameters: + return "%0A" not in path_parameters["project_id"] + return True + + @schema.parametrize() @settings(max_examples=10) def test_openapi_fuzzy(case, cxapp):