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

Inconsistent use of @Valid tag with javaType property #837

Open
rapptor789 opened this issue Mar 6, 2018 · 1 comment
Open

Inconsistent use of @Valid tag with javaType property #837

rapptor789 opened this issue Mar 6, 2018 · 1 comment

Comments

@rapptor789
Copy link

Hi,

we use the javaType property in our schemas, because we don't want to validate referenced schema files.

When we use it with single properties, the generation of Java pojos works fine.

When we define the following code in schema:
"repTemplate": { "id": "repTemplate", "javaType": "de.domain.dto.model.ReportTemplateDto" }

The plugin generates this:
/** (Required) */ @JsonProperty("repTemplate") @NotNull private ReportTemplateDto repTemplate;

But if we have an array of this objects:
"repTemplates": { "type": "array", "items": { "javaType": "de.domain.dto.model.ReportTemplateDto" } }
The plugin generates this code:
@JsonProperty("repTemplates") @Valid private List<ReportTemplateDto> repTemplates = new ArrayList<ReportTemplateDto>();

We expect that a list of this Items should not be validated, like a single object.

@unkish
Copy link
Collaborator

unkish commented Aug 17, 2023

Looks like this was a deliberate change back in #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants