-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug [Bean Validation]: Compilation error with array of strings with validations #925
Comments
For fun I looked at this and as I understand it, the Or am I missing something in the code? I have tried to look if there is some code that alters the code that's generated, but I can't find it when looking in the code and tried solving the issue. Edit 1:
Or am I totally wrong? :) |
@denvitaharen you can open a PR to change the template by adding the FQCN to the annotation. 👍 Adding the import is not an option because we can't possibly know for sure if it will include Alternatively, you can add this import to the list of imports (see our subclasses of JavaGenerator from the openapi-gen lib) if validation is enabled and the POJOs would have these annotations. |
I would like to add the FQCN to the annotation, but do be honest, I don't really understand how to do it. As I understand it, the The dirty fix is to add the import when bean validation is enabled in |
When modeling a schema object with an
array
property with items of typestring
and theminLength
validation set, the generated code is missing an import tojakarta.validation.constraints.Size
or the annotation must use its FQCN when using Bean Validation.Example:
Generated code:
target/generated-sources/open-api-yaml/org/openapi/quarkus/bean_validation_true_yaml/model/ValidatedObject.java
Compilation error:
The text was updated successfully, but these errors were encountered: