You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the choice/when statements to do input validation and sometimes there are no statements inside.
After switching Quarkus version 3.18.4 to 3.19.1 (which includes Camel Quarkus 3.19.0), these empty checks are ignored, which causes a breaking change.
I found a workaround for this by adding something like a .log() statement - then it will be validated again.
However, I thing this is a bug that needs to be fixed.
Here is some example route to show the issue:
//FIXME
from("direct:test")
//TODO Set this to "2" for the workaround
.setHeader("test", constant("1"))
.choice()
.when(header("test").isEqualTo("1"))
//Empty - fails on Quarkus version 3.19.1
.when(header("test").isEqualTo("2"))
//FIXME Workaround for Quarkus version 3.19.1 - empty when body causes issue!
.log(LoggingLevel.INFO, "Processing test=${header.test}")
.otherwise()
.throwException(new RuntimeException("Vaildation error!"))
.end()
;
May be the latest changes regarding .when() statements causing this as an side effect?
The text was updated successfully, but these errors were encountered:
Why not? Do I have to add senseless statements only to fulfil your requirement, @davsclaus ?
It was possible to do in 3.18.4, so 3.19.1 is introducing a breaking change here.
Here my use case: I am checking a positive list of values with these statements and the .otherwhise() statement will catch all other values and breaks further processing (failing fast). I started this originally because the REST DSL had some limitations in input validation (might become better now), but now it's used for more complex checks too.. The validated values are further processed later in other routes (where the .when() statements contain actions).
In my eyes, this is an valid use case and empty when() should be allowed in newer versions.
Bug description
I am using the choice/when statements to do input validation and sometimes there are no statements inside.
After switching Quarkus version 3.18.4 to 3.19.1 (which includes Camel Quarkus 3.19.0), these empty checks are ignored, which causes a breaking change.
I found a workaround for this by adding something like a .log() statement - then it will be validated again.
However, I thing this is a bug that needs to be fixed.
Here is some example route to show the issue:
May be the latest changes regarding .when() statements causing this as an side effect?
The text was updated successfully, but these errors were encountered: