[ 
https://issues.apache.org/jira/browse/CAMEL-13909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hari Rao updated CAMEL-13909:
-----------------------------
    Description: 
In the camel-swagger-rest-dsl-generator project, it is not generating .type & 
.outType rest dsl though available as part of openapi 2.0 (swagger) spec.

This is because in (as far as I investigated) in 
org.apache.camel.generator.swagger.OperationVisitor class we have the following 
code and beyond we do not have options to emit type & outType. Besides in the 
method, it is also not possible to pass User defined objects which will help to 
create those models.
{code:java}
void visit(final HttpMethod method, final Operation operation) {
 if (filter.accept(operation.getOperationId())) {
 final String methodName = method.name().toLowerCase();
 emitter.emit(methodName, path);

 emit("id", operation.getOperationId());
 emit("description", operation.getDescription());
 emit("consumes", operation.getConsumes());
 emit("produces", operation.getProduces());{code}

  was:
In the camel-swagger-rest-dsl-generator project, it is not generating .type & 
.outType rest dsl though available as part of openapi 2.0 (swagger) spec.

This is because in (as far as I investigated) in 
org.apache.camel.generator.swagger.OperationVisitor class we have the following 
code and beyond we do not have options to emit type & outType. Besides in the 
method, it is also not possible to pass User defined objects which will help to 
create those models.
{code:java}
void visit(final HttpMethod method, final Operation operation, final Swagger 
swagger) {
 if (filter.accept(operation.getOperationId())) {
 final String methodName = method.name().toLowerCase();
 emitter.emit(methodName, path);

 emit("id", operation.getOperationId());
 emit("description", operation.getDescription());
 emit("consumes", operation.getConsumes());
 emit("produces", operation.getProduces());{code}


> Camel Rest-DSL doesn't generate type & outType from openapi 2.0 file
> --------------------------------------------------------------------
>
>                 Key: CAMEL-13909
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13909
>             Project: Camel
>          Issue Type: Bug
>          Components: rest, tooling
>            Reporter: Hari Rao
>            Priority: Major
>
> In the camel-swagger-rest-dsl-generator project, it is not generating .type & 
> .outType rest dsl though available as part of openapi 2.0 (swagger) spec.
> This is because in (as far as I investigated) in 
> org.apache.camel.generator.swagger.OperationVisitor class we have the 
> following code and beyond we do not have options to emit type & outType. 
> Besides in the method, it is also not possible to pass User defined objects 
> which will help to create those models.
> {code:java}
> void visit(final HttpMethod method, final Operation operation) {
>  if (filter.accept(operation.getOperationId())) {
>  final String methodName = method.name().toLowerCase();
>  emitter.emit(methodName, path);
>  emit("id", operation.getOperationId());
>  emit("description", operation.getDescription());
>  emit("consumes", operation.getConsumes());
>  emit("produces", operation.getProduces());{code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to