0

I'm trying to document inner constraint for Collections (NotBlank and Size) like:

@Valid    
private List<@NotBlank @Size(min = 1, max = 100) String> someAnotherUsefulInformationList;

Can I do it with built-in functionality?

PS: I found a place where constraints resolved here and after modifying this method I got access to needed constraints, but NotBlank fall into Optional field in the snippet

Grigorii Riabov
  • 185
  • 2
  • 8
  • The `Optional = false` in your snippet refers to the field `someAnotherUsefulInformationList` and the field itself is optional, i.e. there is no `@NotNull` annotation on it. I doubt that there is a way to get the inner constraints into the documentation with the built-in functionality. – Florian Benz Apr 15 '21 at 08:29
  • I'm made custom solution, example [here](https://github.com/GrinRus/spring-auto-rest-docs-demo) – Grigorii Riabov Apr 21 '21 at 11:01

1 Answers1

0

Built-in functionality does not provide documenting inner collections constraints. After some research and finding this question i'm made a custom solution in this repository

Grigorii Riabov
  • 185
  • 2
  • 8