Skip to content

Commit

Permalink
[VNG-Realisatie#222] update content type parameter test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonny Bakker committed Sep 23, 2022
1 parent 89fdc88 commit 073fb9b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tests/test_content_type_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@ def _generate_schema():
def test_json_content_type():
schema = _generate_schema()

get_operation = schema.paths["/json"]["get"]
post_operation = schema.paths["/json"]["post"]
get_operation = schema["paths"]["/json"]["get"]
post_operation = schema["paths"]["/json"]["post"]

assert get_operation["parameters"] == []
assert "parameters" not in get_operation
assert post_operation["parameters"] == [
OpenApiParameter(
name="Content-Type",
location=OpenApiParameter.HEADER,
type=OpenApiTypes.STR,
required=True,
enum=["application/json"],
description=_("Content type of the request body."),
)
{
"description": "Content type of the request body.",
"in": "header",
"name": "Content-Type",
"required": True,
"schema": {"enum": ["application/json"], "type": "string"},
}
]


Expand Down

0 comments on commit 073fb9b

Please sign in to comment.