You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2019/09/02 14:37:00 UTC
[jira] [Commented] (CAMEL-13909) Camel Rest-DSL doesn't generate
type & outType from openapi 2.0 file
[ https://issues.apache.org/jira/browse/CAMEL-13909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16920905#comment-16920905 ]
Claus Ibsen commented on CAMEL-13909:
-------------------------------------
Yeah it would be nice. This requires for input types, to check the parameters for message body, and see if it refers to a model and use that.
And for responses then its the same, likely to find the 200 status 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: Improvement
> Components: rest, tooling
> Reporter: Hari Rao
> Priority: Major
> Fix For: 3.x
>
>
> 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)