OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Java] Container bean validation customisation

Open
#18,757 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hello
I've got some issues with beanValidation in latest versions of generator with containers.
https://github.com/OpenAPITools/openapi-generator/blob/7bc2a660658766175a0fcde8e77c1b475bc970e6/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java#L1075-L1080
Was identified all bean validation for container are hardcoded, which is fully breaking templating for containers and arrays.
Can we reuse for getBeanValidation our beanValidationCore.mustache definition ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java around lines 1075-1080 and inspect the beanValidationCore.mustache definition. Confirm how getBeanValidation currently handles container and array validation, then verify that the resulting customization is applied consistently through the relevant generator templates.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.