-
-
Notifications
You must be signed in to change notification settings - Fork 526
Fixed AbstractRequestService to modify parameters by the return value #1372
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
be4025d
to
15f8b05
Compare
15f8b05
to
31e1e1d
Compare
Thank you for your contribution. |
I see your point. It would have been cleaner to get We believe, that |
@bnasslahsen Thanks for reviewing my request. I see your point. But how about customizing the parameter as invisible though. public class MyPathParameterCustomizer implements ParameterCustomizer {
@Override
public Parameter customize(Parameter parameterModel, MethodParameter methodParameter) {
if (ShouldToBeIgnoredClass.isAssignableFrom(methodParameter.getParameterType())) {
return null; // returning null means the parameter should be hidden
}
return parameterModel;
}
} And, in the case of app172 I wrote, the customizer changes a parameter from public class MyPathParameterCustomizer implements ParameterCustomizer {
@Override
public void customize(Parameter parameterModel, MethodParameter methodParameter) {
parameterModel.setIn("path");
parameterModel.setRequired(true);
parameterModel.setSchema(new StringSchema());
// `parameterModel.getClass()` is still `QueryParameter`, not `PathParameter`
}
} but the type of the parameter is still |
The type is |
@bnasslahsen How about hiding a parameter by returning null? |
Prefer the swagger annotations: |
Got it. Thank you very much. |
I have made a change to make sure we can customize the |
Yeah but not accepting |
I guess, your test should be passing. |
Currently, to modify the parameter, we have to modify the argument directly, not the return value.
But I think we should modify the parameter by the return value of ParameterCustomizer.