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

Renard validator(MyValidationInterceptor) should not apply on rest enpoint that not extends renarde.Controller #254

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

pramoth
Copy link
Contributor

@pramoth pramoth commented Oct 30, 2024

I have 2 controller

  1. json rest
  2. htmx (renard controller)
    when I apply @Valid on 1. I observe that MyValidationInterceptor add ConstrainViolation to validation.error event if my controller does not extends renard Controller. So I can't report error back to user like normal rest . and endpoint method get called even if validate fail (it is OK for htmx,html response)

…s renarde Controller else throw ResteasyReactiveViolationException. So rest reactive endpoint validation will work as normal
@pramoth pramoth requested a review from a team as a code owner October 30, 2024 20:32
Copy link
Contributor

@FroMage FroMage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice catch. This seems like a legit use-case. Do you mind adding a note in the documentation to make it clear that validation in non-controllers will cause the endpoint to never be entered?

Probably a test would be safe too :)

@pramoth
Copy link
Contributor Author

pramoth commented Nov 1, 2024

@FroMage the test was added.

@FroMage
Copy link
Contributor

FroMage commented Nov 4, 2024

Perfect. A note in the docs? :) I can add it for you if you prefer.

@pramoth
Copy link
Contributor Author

pramoth commented Nov 5, 2024

Perfect. A note in the docs? :) I can add it for you if you prefer.

Yes, please! That would be great, thank you. @FroMage

@FroMage FroMage merged commit eecff35 into quarkiverse:main Nov 25, 2024
1 check passed
FroMage added a commit that referenced this pull request Nov 25, 2024
@FroMage
Copy link
Contributor

FroMage commented Nov 26, 2024

Merged, thanks!

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

Successfully merging this pull request may close these issues.

2 participants