Pontus Ullgren created CAMEL-24649:
--------------------------------------
Summary: Customize 404/405 response body when using REST OpenApi
componentc
Key: CAMEL-24649
URL: https://issues.apache.org/jira/browse/CAMEL-24649
Project: Camel
Issue Type: New Feature
Components: rest
Affects Versions: 4.22.0
Reporter: Pontus Ullgren
When using the REST OpenApi to publish rest services from a OAS (as
a consumer) there is currently no way to set the body returned when a client
calls a operation (unmatched path or method) that is not in the OAS file.
It is hardcoded to be a 404 or 405 with an empty body.
https://github.com/apache/camel/blob/main/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiProcessor.java#L128-L142
It would be useful to allow the developer to add a custom handler for this.
Much like how `RestClientRequestValidator` works.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)