openapi-processor / openapi-processor-core

moved into openapi-processor-base
Apache License 2.0
7 stars 5 forks source link

apply @NotNull bean-validation to allOf composition #72

Closed hauner closed 3 years ago

hauner commented 3 years ago

"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 3 years ago

@Tucos

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 3 years ago

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 3 years ago

Nice to hear that it works as expected, and thanks for the praise :-)