-
-
Notifications
You must be signed in to change notification settings - Fork 545
Closed
Description
Describe the bug
Following the steps in the FAQ and here to add a global header. The header isn't added to every endpoint.
To Reproduce
- Spring boot version: 2.2.2.RELEASE
- Springdoc OpenApi UI version: 1.2.32
Enter the following somewhere Spring Boot will pick it up:
@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.components(new Components()
.addSecuritySchemes("spring_oauth", new SecurityScheme()
.type(SecurityScheme.Type.OAUTH2)
.description("Oauth2 flow")
.flows(new OAuthFlows()
.authorizationCode(new OAuthFlow()
.authorizationUrl(authUrl + "/auth")
.refreshUrl(authUrl + "/token")
.tokenUrl(authUrl + "/token")
.scopes(new Scopes())
)))
.addSecuritySchemes("api_key", new SecurityScheme()
.type(SecurityScheme.Type.APIKEY)
.description("Api Key access")
.in(SecurityScheme.In.HEADER)
.name("API-KEY")
)
.addHeaders("Version", new Header()
.description("version header")
.required(true)
.schema(new StringSchema())))
.security(Arrays.asList(
new SecurityRequirement().addList("spring_oauth"),
new SecurityRequirement().addList("api_key")));
}
Expected behavior
Header Version
should appear in the Swagger UI under every endpoint, but it does not.
Additional context
I could be misunderstanding the FAQ, if so I apologize.
Metadata
Metadata
Assignees
Labels
No labels