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

False negative warning combining spec's pojo and Java Bean Validation in CRD generator #4577

Closed
nicoloboschi opened this issue Nov 15, 2022 · 2 comments · Fixed by #4597
Closed
Labels
component/crd-generator Related to the CRD generator
Milestone

Comments

@nicoloboschi
Copy link
Contributor

Is your enhancement related to a problem? Please describe

In my operator I integrated the POJO class to hibernate in order to validate the spec's attribute at the application level. (other than the CRD level).
So I ended up with a class like this

class MySpec {
   @javax.validation.constraints.NotNull;
   @io.fabric8.generator.annotation.Required;
   String name;
}

During the build I get this error:
[WARN] Annotation: javax.validation.constraints.NotNull on property: name is deprecated. Please use: io.fabric8.generator.annotation.Required instead

Reading the doc I understand why there is the warning. However, in this case, it's intentional and I'd like to turn off the warning.

Describe the solution you'd like

A flag to not print the warning

Describe alternatives you've considered

No response

Additional context

Using 6.2.0

@andreaTP
Copy link
Member

Hi @nicoloboschi ,
what you are asking makes sense to me but I would try to remove the deprecated javax.validation.constraints.NotNull in version 6.3 other than adding a flag to skip the warning.

Other than that, please note that the warning should not influence the behavior at all.

WDYT @manusa ?

An alternative idea would be to try to configure the crd-generator logger on the fly with Java properties.

@andreaTP andreaTP added the component/crd-generator Related to the CRD generator label Nov 15, 2022
@nicoloboschi
Copy link
Contributor Author

If the plan is to drop the support (and therefore the warning) in 6.3, I believe it's better to wait for it then.

I assume adding a specific property can be kind of weird since it's just a build warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/crd-generator Related to the CRD generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants