Hari Rao created CAMEL-13909:
--------------------------------
Summary: 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
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.
```
{color:#cc7832}void {color}{color:#ffc66d}visit{color}({color:#cc7832}final
{color}HttpMethod method{color:#cc7832}, final {color}Operation
operation{color:#cc7832}, final {color}Swagger swagger) {
{color:#cc7832}if
{color}({color:#9876aa}filter{color}.accept(operation.getOperationId())) {
{color:#cc7832}final {color}String methodName =
method.name().toLowerCase(){color:#cc7832};
{color} {color:#9876aa}emitter{color}.emit(methodName{color:#cc7832},
{color}{color:#9876aa}path{color}){color:#cc7832};
{color}{color:#cc7832}
{color} emit({color:#668700}"id"{color}{color:#cc7832},
{color}operation.getOperationId()){color:#cc7832};
{color} emit({color:#668700}"description"{color}{color:#cc7832},
{color}operation.getDescription()){color:#cc7832};
{color} emit({color:#668700}"consumes"{color}{color:#cc7832},
{color}operation.getConsumes()){color:#cc7832};
{color} emit({color:#668700}"produces"{color}{color:#cc7832},
{color}operation.getProduces()){color:#cc7832};{color}
```
--
This message was sent by Atlassian Jira
(v8.3.2#803003)