Skip to content
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][JAVA] library microprofile does not add @Valid annotation to nested classes #19082

Open
rogeriobautz opened this issue Jul 4, 2024 · 0 comments

Comments

@rogeriobautz
Copy link

Description

Java generator with library microprofile does not add @Valid annotation to nested classes

openapi-generator version

7.7.0

public class ResponseBankFixedIncomesBalancesData  {
//...

  public static final String JSON_PROPERTY_UPDATED_UNIT_PRICE = "updatedUnitPrice";
  
  private ResponseBankFixedIncomesBalancesDataUpdatedUnitPrice updatedUnitPrice;

  public static final String JSON_PROPERTY_GROSS_AMOUNT = "grossAmount";  

  private ResponseBankFixedIncomesBalancesDataGrossAmount grossAmount;
//...
}
OpenAPI declaration file content or url

Complete file
issues.zip

Generation Details

npx @openapitools/openapi-generator-cli generate -i issues.yml -g java -o ./tmp/test/ --additional-properties=useJakartaEe=true,serializationLibrary=jackson,library=microprofile,useBeanValidation=true

Steps to reproduce

Install operaapi-generator-cli and run the command above

Sugestion to fix
  • the resteasy llibrary adds the @Valid annotation but also adds this to some objects that has no validation like URI(java.net.URI) class
  • Add an additional property to enable this
  • Add an addtional property to specify some classes to not add the @Valid annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant