- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 553
 
Closed
Labels
bugSomething isn't workingSomething isn't working
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'sOpenApiCustomizerlogic is related. If it's a bug, I want to send a PR after fixing it. 
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working


