Closed aburmeis closed 1 year ago
That's strange. It should never be null at that location. The bean validation (v2) integration test (it contains all validations) doesn't throw if I change it to jakarta
.
I will test this on some production code. It would be great If you could share a piece of api & mapping that triggers the issue.
To reproduce the problem, one can do the following changes:
In the src\testInt\resources\tests\params-pageable-mapping\inputs\mapping.yaml
-File, add the following:
bean-validation: true
/page-inline
-Path:
@vhschlenker Thanks, can reproduce it now.
fixed in 2023.1.2
I am sorry, but the version 2023.1.1 still does not work for bean validation:
when enabled (regardless of
javax
orjakarta
), I get the following error for the same api definition working with version 2022.3:[ERROR] processing failed! java.lang.NullPointerException at io.openapiprocessor.core.writer.java.BeanValidationFactoryKt.shouldHaveValid (BeanValidationFactory.kt:157) at io.openapiprocessor.core.writer.java.BeanValidationFactoryKt.access$shouldHaveValid (BeanValidationFactory.kt:1) at io.openapiprocessor.core.writer.java.BeanValidationFactory.collectAnnotations (BeanValidationFactory.kt:44) at io.openapiprocessor.core.writer.java.BeanValidationFactory.validate (BeanValidationFactory.kt:36) at io.openapiprocessor.core.writer.java.InterfaceWriter.addImports (InterfaceWriter.kt:85) at io.openapiprocessor.core.writer.java.InterfaceWriter.collectImports (InterfaceWriter.kt:66) at io.openapiprocessor.core.writer.java.InterfaceWriter.write (InterfaceWriter.kt:33) at io.openapiprocessor.core.writer.java.ApiWriter.writeInterface (ApiWriter.kt:89) at io.openapiprocessor.core.writer.java.ApiWriter.writeInterfaces$lambda$0 (ApiWriter.kt:58) at java.util.ArrayList.forEach (ArrayList.java:1511) at io.openapiprocessor.core.model.Api.forEachInterface (Api.kt:38) at io.openapiprocessor.core.writer.java.ApiWriter.writeInterfaces (ApiWriter.kt:56) at io.openapiprocessor.core.writer.java.ApiWriter.write (ApiWriter.kt:43) at io.openapiprocessor.spring.processor.SpringProcessor.run (SpringProcessor.kt:79) at io.openapiprocessor.spring.processor.SpringService.run (SpringService.kt:29)