Closed ankitcom closed 6 years ago
We are not aware of any issue. In the example project in this repository and other projects everything is working fine. @NotBlank
should never end up in the description, but should just be used to determine whether a field is optional. We support org.hibernate.validator.constraints.NotBlank
and as far as I know there is no javax.validation.constraints.NotBlank
.
For a constraint description to be shown, the description has to be available in the classpath. See the Spring REST Docs documention https://docs.spring.io/spring-restdocs/docs/1.2.3.RELEASE/reference/html5/#documenting-your-api-constraints on how to set it up.
If you are still experiencing issues, providing example code or pointing to the project where it does not work might help.
org.hibernate.validator.constraints.NotBlank is deprecated in latest hibernate validator 6 version. It says to use javax.validation.constraints.NotBlank as it was understood to be redundant. So I guess for these type of annotations support should be added by auto rest doc. It is happening for others so I don't see any issue why it can't happen for javax notblank in a same way as it was done for hibernate validator.
I see the issue now. We do not support Bean Validation 2.0 and Hibernate Validator 6.0 yet. Support for both landed in Spring REST Docs 2.0.0: https://github.com/spring-projects/spring-restdocs/issues/454 We are looking into creating a Spring Auto REST Docs version based on Spring REST Docs 2.0.0. However, we do not have any timeline yet. If we do so we would likely have to support two versions of Spring Auto REST Docs (1.x and 2.x) at the same time and that adds some additional effort.
In the description section of auto generated auto-request-fields.doc there is an issue with few validation annotations. For instance@NoBlank is printed as it is like 'javax.validation.constraints.NotBlank.' & @Email is printed like 'javax.validation.constraints.Email.' Please fix this as it happens with something like @Size that prints something like 'Size must be between 0 and 10 inclusive.'