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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pramoth
Copy link

@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
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
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
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

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