We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The previous fix on #274 works nicely while testing with spring-boot 2.1.x but not working in spring-boot 2.2.
Likely due to the changed annotation handling (https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x#upgrading-to-version-52), the method AbstractRequestBuilder.getApiParameters can now only dig out @Parameter annotations in the third call to AnnotatedElementUtils.findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.Parameter.class) even though they are wrapped in @Parameters.
AbstractRequestBuilder.getApiParameters
@Parameter
AnnotatedElementUtils.findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.Parameter.class)
@Parameters
Suggest all 4 Collectors.toMap in the method AbstractRequestBuilder.getApiParameters be changed to collect the results in LinkedHashMap
Collectors.toMap
LinkedHashMap
Sample code:
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) @Retention(RetentionPolicy.RUNTIME) @Parameters({ @Parameter( in = ParameterIn.QUERY, description = "Page you want to retrieve (0..N)", name = "page", content = @Content(schema = @Schema(type = "integer", defaultValue = "0"))), @Parameter( in = ParameterIn.QUERY, description = "Number of records per page.", name = "size", content = @Content(schema = @Schema(type = "integer", defaultValue = "20"))), @Parameter( in = ParameterIn.QUERY, description = "Sorting criteria in the format: property(,asc|desc). " + "Default sort order is ascending. " + "Multiple sort criteria are supported.", name = "sort", content = @Content(array = @ArraySchema(schema = @Schema(type = "string")))), @Parameter(in = ParameterIn.QUERY, name = "pageable", hidden = true), }) public @interface PageableParameter {}
@PageableParameter public void someController(Pageable pageable){ ... }
Generated api-doc On spring-boot 2.2
{"name": "size",...}, {"name": "page",...}, {"name": "sort",...}
Generated api-doc On spring-boot 2.1.x
{"name": "page",...}, {"name": "size",...}, {"name": "sort",...}
The text was updated successfully, but these errors were encountered:
Hi @ny-currenxie,
Finally, able to reproduce the behaviour you describe.
Sorry, something went wrong.
eb1475e
No branches or pull requests
The previous fix on #274 works nicely while testing with spring-boot 2.1.x but not working in spring-boot 2.2.
Likely due to the changed annotation handling (https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x#upgrading-to-version-52), the method
AbstractRequestBuilder.getApiParameters
can now only dig out@Parameter
annotations in the third call toAnnotatedElementUtils.findAllMergedAnnotations(method, io.swagger.v3.oas.annotations.Parameter.class)
even though they are wrapped in@Parameters
.Suggest all 4
Collectors.toMap
in the methodAbstractRequestBuilder.getApiParameters
be changed to collect the results inLinkedHashMap
Sample code:
Generated api-doc On spring-boot 2.2
Generated api-doc On spring-boot 2.1.x
The text was updated successfully, but these errors were encountered: