-
-
Notifications
You must be signed in to change notification settings - Fork 538
Extract parameters from parameter object #505
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @zarebski-m,
Thank for sharing your work and your contribution.
Can you please respect the contribution guide and especially formatter provided: Please don't add brackets if there is one instruction, especially on existing instructions:
You can make sure, you change only the lines related to your feature on the follwoing files: AdditionalModelsConverter, AbstractRequestBuilder.
Thank you, I've applied https://github.com/spring-projects/spring-boot/blob/master/idea/codeStyleConfig.xml to my IDE and reformatted my code. |
Thank you @zarebski-m for your contribution. |
@bnasslahsen when are you planning to release this feature? |
Should be available, no later than next Monday, 06th April. |
HI!! Thanks for the new annotation @ParameterObject! Nevertheless, we are facing an issue when using it. Every attribute of the POJO is being set as required. Is there any way to avoid that? EDIT: using Thanks! |
This is already fixed. #541. |
WOW, it is working fine with 1.3.2! Thanks! |
Hi, thanks for your work, I ran into a problem: inherited fields are not processed. Here is an example of how to handle this case. |
+1 |
Its already released. You can use v1.3.6. |
Fixes #120, #268, #162, #119
This PR introduces a new Springdoc annotation
org.springdoc.api.annotations.ParameterObject
. Request parameter annotated with it are not added as a request parameter themselves, but rather each field of the parameter is added as a separate request parameter. This is compatible with Spring MVC request parameters mapping to POJO object.See test case 102 in springdoc-openapi-webmvc-core.
Consider the following classes:
In generated docs, the
/pojo-params
endpoint defines two request parameters:name
andvalue
, instead of singlequeryParams
one.This also allows deprecation of the workaround for
Pageable
withPageableAsQueryParam
annotation – we can simply use@ParameterObject Pageable pageable
on method parameter.See test case 7 on springdoc-openapi-data-rest.