From 384defc7df5ddbf40fff38901b5459124c0bc2ef Mon Sep 17 00:00:00 2001 From: kriptoburak Date: Thu, 2 Jul 2026 22:25:18 +0300 Subject: [PATCH] test: cover lower-case api key security scheme Signed-off-by: kriptoburak --- .../tests/low/v31/test_security_scheme.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/jentic-openapi-datamodels/tests/low/v31/test_security_scheme.py b/packages/jentic-openapi-datamodels/tests/low/v31/test_security_scheme.py index ca09ae3a..2a2ddd43 100644 --- a/packages/jentic-openapi-datamodels/tests/low/v31/test_security_scheme.py +++ b/packages/jentic-openapi-datamodels/tests/low/v31/test_security_scheme.py @@ -43,6 +43,31 @@ def test_build_with_api_key_in_header(parse_yaml): assert result.openid_connect_url is None +def test_build_with_lowercase_api_key_header(parse_yaml): + """Test building SecurityScheme with a lower-case apiKey header name.""" + yaml_content = textwrap.dedent( + """ + type: apiKey + name: x-api-key + in: header + description: Xquik API key authentication + """ + ) + root = parse_yaml(yaml_content) + + result = security_scheme.build(root) + assert isinstance(result, security_scheme.SecurityScheme) + + assert result.type is not None + assert result.name is not None + assert result.in_ is not None + assert result.description is not None + assert result.type.value == "apiKey" + assert result.name.value == "x-api-key" + assert result.in_.value == "header" + assert result.description.value == "Xquik API key authentication" + + def test_build_with_api_key_in_query(parse_yaml): """Test building SecurityScheme with apiKey type in query parameter.""" yaml_content = textwrap.dedent(