Skip to content

Commit

Permalink
Exclude fuzzy cases where path parameters contain newline "%0A"
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Apr 5, 2024
1 parent beac55c commit 556a29a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 556a29a

Please sign in to comment.