apply @NotNull bean-validation to allOf composition
hauner opened this issue · 3 comments
hauner commented
"When using allOf and bean validation, the properties of the composed type do not get annotated with NotNull even though they are marked as required in the schema." See #71
hauner commented
It is fixed in core 2021.4.2. To use it with spring 2021.4, you can add the core library as an additional dependency.
in gradle:
openapiProcessor {
// ...
spring {
// the spring processor dependency
processor 'io.openapiprocessor:openapi-processor-core:2021.4.2'
processor 'io.openapiprocessor:openapi-processor-spring:2021.4'
}
}
with maven this should work:
<plugins>
<plugin>
<dependencies>
<dependency>
<groupId>io.openapiprocessor</groupId>
<artifactId>openapi-processor-core</artifactId>
<version>2021.4.2</version>
</dependency>
<dependency>
<groupId>io.openapiprocessor</groupId>
<artifactId>openapi-processor-spring</artifactId>
<version>2021.4</version>
</dependency>
</dependencies>
</plugin>
</plugins>
Tucos commented
Awesome, just adopted this version and verified it works as expected. I agree your fix is cleaner than the one I proposed. Thanks for the quick response and fix!
Very nice job on the project by the way, simple to use and a clean implementation that's quite easy to understand.
hauner commented
Nice to hear that it works as expected, and thanks for the praise :-)