openapi-processor / openapi-processor-spring

an OpenAPI 3.0 & 3.1 interface & model java code generator for Spring Boot
https://docs.openapiprocessor.io
Apache License 2.0
40 stars 9 forks source link

missing import for javax.validation.constraints.Pattern #141

Closed kugelstachelfisch closed 2 years ago

kugelstachelfisch commented 2 years ago

Hi there, thanks for the great job! I've found a minor issue:

When array-elements of type string are described by a pattern and the array is mapped to java.util.List, the import for @Pattern-Annotation is missing.

I've tested with openapi-processor-spring V2022.3.

A minimal testcase is attached. Without the line import javax.validation.constraints.Pattern;, the test runs successfully, but the import is required to compile.

list-pattern-missing-import.zip

hauner commented 2 years ago

yep, looks like a bug. Thanks for the test-case :-)

hauner commented 2 years ago

fix is available in openapi-processor-spring 2022.4