diff --git a/tests/test_query_cookie_header_param_models_with_siblings.py b/tests/test_query_cookie_header_param_models_with_siblings.py index 673d34151a..163d57168a 100644 --- a/tests/test_query_cookie_header_param_models_with_siblings.py +++ b/tests/test_query_cookie_header_param_models_with_siblings.py @@ -147,6 +147,18 @@ def test_query_openapi_metadata(): assert documented_query["deprecated"] is True +def test_query_openapi_metadata_runtime(): + response = client.get( + "/query/openapi-metadata", + params={"limit": 10, "q": "hello", "documented_query": "value"}, + ) + assert response.status_code == 200 + assert response.json() == { + "m": {"limit": 10, "q": "hello"}, + "documented_query": "value", + } + + def test_header_model_only_still_flattens(): response = client.get( "/header/only", @@ -215,6 +227,25 @@ def test_header_openapi_metadata_and_hidden_params(): assert "hidden-header" not in parameter_names +def test_header_openapi_metadata_runtime(): + response = client.get( + "/header/openapi-metadata", + headers=[ + ("x-token", "abc"), + ("x-trace", "one"), + ("x-trace", "two"), + ("hidden-header", "secret"), + ("documented-header", "shown"), + ], + ) + assert response.status_code == 200 + assert response.json() == { + "h": {"x_token": "abc", "x_trace": ["one", "two"]}, + "hidden_header": "secret", + "documented_header": "shown", + } + + def test_cookie_model_only_still_flattens(): with client as c: c.cookies.clear()