Skip to content

feat(#1531)!: change default custom validator mode from EXCLUSIVE to COMBINED#1532

Open
bbortt wants to merge 1 commit into
citrusframework:mainfrom
postfinance:fix/#1531-default-validator-mode
Open

feat(#1531)!: change default custom validator mode from EXCLUSIVE to COMBINED#1532
bbortt wants to merge 1 commit into
citrusframework:mainfrom
postfinance:fix/#1531-default-validator-mode

Conversation

@bbortt
Copy link
Copy Markdown
Collaborator

@bbortt bbortt commented May 21, 2026

When a custom validator is provided, it previously ran exclusively, silently bypassing all other validation. This means any other constraints passed to validate() was simply ignored. This BREAKING CHANGE changes the default custom validator mode from EXCLUSIVE to COMBINED, so that custom validators run alongside other validation rather than replacing it.

Users who genuinely need the old exclusive behaviour can still opt in explicitly, but the footgun default is gone.

BREAKING CHANGE: Change default custom validator mode from EXCLUSIVE to COMBINED.

Closes #1531.

@bbortt bbortt requested a review from christophd May 21, 2026 14:35
@bbortt bbortt self-assigned this May 21, 2026
@bbortt bbortt added Type: Enhancement Prio: High State: Review If pull-request has been opened an is ready/in review java Pull requests that update java code labels May 21, 2026
…m EXCLUSIVE to COMBINED

When a custom validator is provided, it previously ran exclusively, silently bypassing all other validation.
This means any other constraints passed to `validate()` was simply ignored.
This BREAKING CHANGE changes the default custom validator mode from `EXCLUSIVE` to `COMBINED`,
so that custom validators run alongside other validation rather than replacing it.

Users who genuinely need the old exclusive behaviour can still opt in explicitly, but the footgun default is gone.

BREAKING CHANGE: Change default custom validator mode from `EXCLUSIVE` to `COMBINED`.
@bbortt bbortt force-pushed the fix/#1531-default-validator-mode branch from 0c6fcf9 to 831f751 Compare May 21, 2026 15:12
@bbortt
Copy link
Copy Markdown
Collaborator Author

bbortt commented May 21, 2026

actually, now I am not so sure if this is a good idea. it also forces you to add e.g. body validation in MessageStoreTest despite the fact, that you maybe don't want to do this:

image

@christophd
Copy link
Copy Markdown
Member

ah ok, this is not what we want.

Is it complaining about a missing validation context validation?

@bbortt
Copy link
Copy Markdown
Collaborator Author

bbortt commented May 21, 2026

yes. I din't have time to look further into it. but there was a hanging body validation context, I think. and some default message validators were also not being validated e.g. on HTTP DELETE requests where there is no response body at all.

maybe if we refactor the default validarion context mechanism, but anyway it isn't as straight forward as I thought.

@bbortt
Copy link
Copy Markdown
Collaborator Author

bbortt commented May 21, 2026

I did some more thinking during dancing classes @christophd 😂 I think the most straight forward approach would be to throw an exception where there is just a warning log in place today.

having default validators and custom validator in place, with EXCLUSIVE mode is simply useless. default validators won't be taken into account.

in order not to break the API we added a warning log, previously. now I think we should throw an exception, to remove the chance of any false-positives.

or am I missing something?

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

Labels

java Pull requests that update java code Prio: High State: Review If pull-request has been opened an is ready/in review Type: Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change default custom validator mode from EXCLUSIVE to COMBINED

2 participants