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

Jakarta Validation @Valid annotation is not treated as a type-annotation #2334

Closed
jskov opened this issue Nov 10, 2024 · 6 comments · Fixed by #2335
Closed

Jakarta Validation @Valid annotation is not treated as a type-annotation #2334

jskov opened this issue Nov 10, 2024 · 6 comments · Fixed by #2335

Comments

@jskov
Copy link
Contributor

jskov commented Nov 10, 2024

Using Gradle spotless 7.0.0.BETA4 I see wrong handling of formatAnnotations for code like this:

    @Valid
    public TemplateDTO getMetadata() {
         return metadata;
     }

Since Jakarta Validation @Valid is annotated with TYPE_USE, it should be changed to:

    @Valid public TemplateDTO getMetadata() {
         return metadata;
     }

I will open a PR shortly fixing this.

@jskov
Copy link
Contributor Author

jskov commented Nov 10, 2024

Hm, this is probably more generic and should cover all (relevant) Validation annotations such as Pattern, Size,...

What is the thinking on this? Would that be OK?

@nedtwigg
Copy link
Member

Sure, adding whatever annotations you need is fine with me. Any objections from you @mernst?

@mernst
Copy link
Contributor

mernst commented Nov 13, 2024

I agree to add annotations supported by well-known tools. Thanks!

@jskov
Copy link
Contributor Author

jskov commented Nov 14, 2024

Thanks, will do. Probably this weekend.

@jskov
Copy link
Contributor Author

jskov commented Nov 14, 2024

Got a few moments to complete it now.
I have made #2335 ready for review.

Cheers!

@nedtwigg
Copy link
Member

nedtwigg commented Jan 7, 2025

Released in 7.0.0

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

Successfully merging a pull request may close this issue.

3 participants