-
-
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
Define 2 parameter objects with same name but different location, only one can be shown in swagger UI.
To Reproduce
Env: Springboot 2.5.14 + springdoc-openapi-ui:1.6.11
Steps:
- Create a simple REST API which just has header and cookie parameters with same name.
@RequestHeader(value = "access_token", required = false)
@Parameter(name = "access_token", in = ParameterIn.HEADER, description = "token in header", schema = @Schema(implementation = String.class))
String tokenInHeader,
@CookieValue(value = "access_token", required = false)
@Parameter(name = "access_token", in = ParameterIn.COOKIE, description = "token in cookie", schema = @Schema(implementation = String.class))
String tokenInCookie
- In /swagger-ui/index.html, only header parameter is defined in API, cookie is missing.
- In /v3/api-docs, there is only 1 parameter as well.
Expected behavior
From openapi-specification:
A unique parameter is defined by a combination of a name and location.
The access_token in header and cookie are in different location, but the cookie is missing.
Note: If changing parameter name to other value (e.g access_token1) for cookie, it shows well.

Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

