You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
Every build now we can see in the logs:
[WARNING] [org.hibernate.validator.internal.metadata.aggregated.CascadingMetaDataBuilder] HV000271: Using `@Valid` on a container (java.util.Map) is deprecated. You should apply the annotation on the type argument(s). Affected element: additionalProperties
[WARNING] [org.hibernate.validator.internal.metadata.aggregated.CascadingMetaDataBuilder] HV000271: Using `@Valid` on a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s). Affected element: _do
[WARNING] [org.hibernate.validator.internal.metadata.aggregated.CascadingMetaDataBuilder] HV000271: Using `@Valid` on a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s). Affected element: _try
I believe this is a side effect of using Hibernate Validator on our types.
What you expected to happen:
For the build to work without annoying warnings.
The issue is that, with the latter version of the hibernate validator, there is a "new" feature and rather than having
@Valid
List<T> list
in order to apply the validation for every element in the list, now you should have
List<@Valid T> list
So, either we move back to the previous hibernate validator (I do not see why not) or we update the generator (which code is not on this repo) in order to generate the code with the annotation in the right spot
It is not possible with jsonschema2pojo library, even with the provided API SchemaRule, AbstractAnnotator or similar APIs provided by jsonschema2pojo. The problem lives on codemodel library that is used by jsonschema2pojo.
If we want to remove the warnings, we can follow the @fjtirado or to use another library. I created an issue there to see if someone can help with a workaround joelittlejohn/jsonschema2pojo#1770
Activity
fjtirado commentedon Feb 2, 2026
The issue is that, with the latter version of the hibernate validator, there is a "new" feature and rather than having
in order to apply the validation for every element in the list, now you should have
So, either we move back to the previous hibernate validator (I do not see why not) or we update the generator (which code is not on this repo) in order to generate the code with the annotation in the right spot
ricardozanini commentedon Feb 2, 2026
Is it too hard to change the generator?
mathecruz commentedon Feb 2, 2026
I am working on it
mathecruz commentedon Feb 2, 2026
Hi guys, after some discovering.
It is not possible with jsonschema2pojo library, even with the provided API
SchemaRule,AbstractAnnotatoror similar APIs provided by jsonschema2pojo. The problem lives on codemodel library that is used by jsonschema2pojo.If we want to remove the warnings, we can follow the @fjtirado or to use another library. I created an issue there to see if someone can help with a workaround joelittlejohn/jsonschema2pojo#1770
ricardozanini commentedon Feb 2, 2026
@mcruzdev nice! Once we have an answer there, we can send a PR to them upstream, perhaps? Codemodel you mean this: https://github.com/javaee/jaxb-codemodel?
ricardozanini commentedon Feb 2, 2026
LOL, 14 years without an update. That's somewhat concerning.
unkish commentedon Feb 3, 2026
https://github.com/javaee/jaxb-codemodel was archived,
jaxb-codemodelis now part of https://github.com/eclipse-ee4j/jaxb-rifjtirado commentedon May 11, 2026
Fixed on Pojo-generator