Hi,

I’m trying to use the REST DSL and do validation on the incoming object with 
the Bean Validation Component.

I have configured my Spring XML like this:

<onException>
  
<exception>org.apache.camel.component.bean.validator.BeanValidationException</exception>
  <handled>
    <constant>true</constant>
  </handled>
  <setHeader headerName="Exchange.HTTP_RESPONSE_CODE">
    <constant>422</constant>
  </setHeader>
  <setBody>
    <simple>Validation error.\n\Message:\n${exception.message}</simple>
  </setBody>
</onException>

But when I use the Swagger UI to send a message to my endpoint, I get no body 
or HTTP response code. For other exceptions this approach works.

Should this work with this exception?

I’m using version 2.17.3

Kind regards,

Remco Schoen

Reply via email to