Closed
Description
Describe the bug
- Refresh the browser each time, the global header is added in duplicate.
To Reproduce
Steps to reproduce the behavior:
- Repo: https://github.com/doljae/decalcomanie/tree/feature/swagger
- used version: 1.16.11
SwaggerConfiguration.kt
@Configuration
class SwaggerConfiguration {
@Bean
fun globalHeaders(): OpenApiCustomiser = OpenApiCustomiser { openApi ->
openApi.paths.flatMap { it.value.readOperations() }
.forEach {
it.addParametersItem(HeaderParameter().name("Header1").required(true))
it.addParametersItem(HeaderParameter().name("Header2").required(true))
}
}
}
Expected behavior
- When I refresh the browser, it works properly without any duplicated headers.
Screenshots
After running Spring Boot application
Refresh browser once
Refresh browser twice
Additional context
- Disabling the cache through the properties below does not cause duplicate headers.
springdoc.cache.disabled= true
-
I wonder if this is intended or if the configuration is wrong.
-
When I debug the code, it seems that
AbstractOpenApiResource
'sOpenApiCustomizer
logic is related. If it's a bug, I want to send a PR after fixing it.