-
-
Notifications
You must be signed in to change notification settings - Fork 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
Ignoring @Parameter(required = false) ? #2827
Comments
Please provide a Minimal, Reproducible Example - with HelloController that reproduces the issue. Follow code returned the value @GetMapping
public String index(@ParameterObject IntegerMaxRequest request) {
return null;
}
public class IntegerMaxRequest {
@Parameter(description = "The number of individual objects that are returned in each page.",
in = QUERY, allowEmptyValue = true,
required = false,
schema = @Schema(defaultValue = "200",
requiredMode = Schema.RequiredMode.NOT_REQUIRED,
nullable = true,
minimum = "1",
maximum = "200"))
@Max(value = 200L)
@Min(value = 1L)
private Integer limit = Integer.MAX_VALUE;
public Integer getLimit() {
return limit;
}
} |
issueReport.zip |
If the @NotNull annotation is applied, it takes precedence over the @parameter annotation. However, I’m sorry, but I don't have time to take this issue. Follow code is minimum.
|
Thanks! I will have a look, but it will be at least a week myself. |
This PR #2817 fixes also this issue! |
Describe the bug
I have this declaration line:
and it results in
but it should result in:
(created via springdoc-openapi-maven-plugin).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would like to have no changes to previous version, i.e. return a required = false and add the default = 200 back in.
Screenshots
This is the diff:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: