Description
RestDefinition relies on Class.getCanonicalName instead of Class.getName for in/out types.
This work as long as the type is not an inner class getCanonicalName does not return a name that can be used to load a class.
As example
package my.example; public class MyRoutes extends org.apache.camel.builder.RouteBuilder { @Override public void configure() throws Exception { rest() .post("/order") .type(MyOrder.class) .consumes("application/json") .produces("application/json") .bindingMode(RestBindingMode.json) .route() .log("${body}"); } public static class MyOrder { public String id; } }
Then camel would set my.example.MyRoutes.MyOrder as in type but that's wrong and the subsequent attemp to load the class by name, will fail as it should be my.example.MyRoutes$MyOrder (which is what Class.getName would return).
Attachments
Attachments
Issue Links
- is related to
-
CAMEL-15745 Rest DSL input/output type class
- Resolved
- links to