Hi Cameleers,
I'm thinking of reopening CAMEL-10932[1]: the REST Swagger component,
I would like to see support for something as simple like
`rest-swagger:operation`, where operation would be from a Swagger
specification. Operation ids are guaranteed to be unique by Swagger
specification.

I've got this working better than in the initial PR i submitted for
review -- now it delegates to RestEndpoint much in the same manner
RestProducerFactory implementations delegate to their own endpoints.

The thing that buggs me is passing http component specific or even
rest component specific properties from this new component. Now I have
a Map of properties to pass and I'm using
DefaultEndpoint::setProperties to propagate them to RestEndpoint.

But I guess, this is not helping tooling in any way as it has no way
of knowing what properties are supported. So, is there a better way of
doing this? I don't want to duplicate properties getters/setters and
then have to maintain them in two places.

Oh, and I have an example of usage, but it should be as simple as:

    final RestConfiguration restConfiguration = new RestConfiguration();
    restConfiguration.setHost("http://petstore.swagger.io";);
    context.setRestConfiguration(restConfiguration);

    final RestSwaggerComponent petstore = new
RestSwaggerComponent(camelContext);
    final Map<String, Object> parameters = new HashMap<>();
    parameters.put("path", "/v2");
    parameters.put("componentName", "undertow"); // or any other
RestProducerFactory component
    petstore.setParameters(parameters);
    context.addComponent("petstore", petstore);
    //...
    template.requestBodyAndHeader("petstore:getPetById", null, "petId", 1);

thanks, and sorry for being long winded

zoran

[1] https://issues.apache.org/jira/browse/CAMEL-10932
-- 
Zoran Regvart

Reply via email to