Merge pull request 'Fix: @SecurityScheme in=HEADER — Swagger UI не клал ключ в заголовок' (#5) from fix/security-scheme-in-header into main

Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
2026-10-16 00:26:29 +03:00
2 changed files with 2 additions and 0 deletions
@@ -14,6 +14,7 @@ import org.springframework.context.annotation.Configuration;
@SecurityScheme(
name = OpenApiConfig.SCHEME,
type = SecuritySchemeType.APIKEY,
in = SecuritySchemeIn.HEADER,
paramName = ApiKeyFilter.HEADER,
description = "Ключ доступа (свойство сервера wordpdf.api-key, прод — env WORDPDF_API_KEY)")
class OpenApiConfig {
@@ -94,6 +94,7 @@ class ApiKeyFilterTest {
mockMvc.perform(get("/v3/api-docs"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.components.securitySchemes.ApiKey.type").value("apiKey"))
.andExpect(jsonPath("$.components.securitySchemes.ApiKey.in").value("header"))
.andExpect(jsonPath("$.components.securitySchemes.ApiKey.name").value("X-API-Key"));
mockMvc.perform(get("/swagger-ui/index.html"))
.andExpect(status().isOk());