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
Given the controller:
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import lombok.Value; import org.springframework.web.bind.annotation.*; import java.util.Optional; @RestController public class FooController { @PostMapping("fooRecord") public void fooRecord(@RequestBody FooRecord foo) { } @PostMapping("fooClass") public void fooClass(@RequestBody FooClass foo) { } record FooRecord(@NotNull Optional<@Size(max = 1000) String> value) { } @Value static class FooClass { @NotNull @Size(max = 1000) String value; public Optional<String> getValue() { return Optional.of(value); } } }
currently with latest springdoc generated openapi looks like:
"FooRecord":{ "required":[ "value" ], "type":"object", "properties":{ "value":{ "type":"string" } } }, "FooClass":{ "required":[ "value" ], "type":"object", "properties":{ "value":{ "maxLength":1000, "minLength":0, "type":"string" } } },
under components schemas. The problematic part is the FooRecord component.
The result I'd expect in ideal case would be
"FooRecord":{ "type":"object", "properties":{ "value":{ "maxLength":1000, "minLength":0, "type":"string" } } },
The text was updated successfully, but these errors were encountered:
@lpandzic,
This logic is handled in the swagger-core library. Please submit this Enhancement in the correct Github repo:
Sorry, something went wrong.
No branches or pull requests
Given the controller:
currently with latest springdoc generated openapi looks like:
under components schemas.
The problematic part is the FooRecord component.
The result I'd expect in ideal case would be
The text was updated successfully, but these errors were encountered: