Код прост: < /p>
Код: Выделить всё
@RestController
class ReportController {
@GetMapping("/getReport")
String getReport(@RequestBody Report report) {
< /code>
record Report(
@Schema(description = "Some field", minLength = 1, maxLength = 10) String somefield,
String someFieldOnlyAvailableSinceVersion2) {
}
< /code>
I am hoping to have an annotation, something like @Version("v2"), @Since("v2")
@Schema(description = "Some field", minLength = 1, maxLength = 10) String somefield,
@Schema(description = "Some field only available since version 2", minLength = 1, maxLength = 5)String someFieldOnlyAvailableSinceVersion2) {
}
< /code>
While there is some info displayed in the generated doc, I was hoping for an annotation that can mention the version since.
The question is not about validating the field with spring validation.
What would be the way to tell swagger openapiv3 the field is only available since a particular version?
Подробнее здесь: https://stackoverflow.com/questions/793 ... apiv3-with