-
-
Notifications
You must be signed in to change notification settings - Fork 528
When @Get
, using @Parameter
over the method results in duplicate of the same parameter
#1901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This not a bug. It's expected since #1816: To make it work you need: @GetMapping("/duplicate_param")
@Operation(summary = "Duplicate param")
@Parameter(name = "sample", required = true, in = ParameterIn.QUERY, description = "sample query")
public String duplicateParam(@RequestParam String sample) {
return "duplicateParam";
} I am adding an enhancement to cover some cases out of the box. We will presume, that if a single parameter is present in the method definition and in the |
…he same parameter. Fixes springdoc#1901.
Describe the bug
When
@Get
, using@Parameter
over the method results in duplicate of the sameparameter
.To Reproduce
What version of spring-boot you are using?
id 'org.springframework.boot' version '2.7.5'
What modules and versions of springdoc-openapi are you using?
implementation 'org.springdoc:springdoc-openapi-ui:1.6.12'
What is the actual and the expected result using OpenAPI Description (yml or json)?
actual
expected
Provide with a sample code (HelloController) or Test that reproduces the problem
Controller source code
Source code 1 for expected problems
Source code 2 for expected problems
Expected behavior
When using
@Parameter
over the method,io.swagger.v3.oas.annotations.parameter
is entered in the argumentparametersDocMap
.After that, when comparing the values of condition
if(!map.containsKey(entry.getKey()))
, it is compared with hashCode ofParameterId
, and even though it is the sameParameterId
, it is classified as differentParameterId
.Hash code for "ParameterId.java"
Screenshots
The text was updated successfully, but these errors were encountered: