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/03/20 06:09:00 UTC

[jira] [Commented] (CAMEL-13340) Invalid swagger json/yaml generated for Rest DSL

    [ https://issues.apache.org/jira/browse/CAMEL-13340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16796831#comment-16796831 ] 

Claus Ibsen commented on CAMEL-13340:
-------------------------------------

You are welcome to work on a proposed fix as a PR

> Invalid swagger json/yaml generated for Rest DSL
> ------------------------------------------------
>
>                 Key: CAMEL-13340
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13340
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-swagger
>    Affects Versions: 2.22.0
>            Reporter: Sergey Savenko
>            Priority: Major
>
> Swagger rests description is generated with invalid responseSchema element. You can see example I found on [stackoverflow|https://stackoverflow.com/questions/52745160/camel-rest-dsl-swagger-output-contains-invalid-responseschema-element].
> From camel 2.2 swagger-core was upgraded from 1.5.17 to 1.5.20.
> In Swagger 1.5.19 new ResponseSchemaMixin was added to default object mapper [https://github.com/swagger-api/swagger-core/commit/8b97df3667559fca1783da845607afc30e550b83#diff-58c27954db290a19d4fadbfe34b0bbf3]
> Camel creates ObjectMapper manually, and does not add this mixin, which results in incorrect json/yaml generated. See [https://github.com/apache/camel/blob/camel-2.22.0/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java#L216] and line 235
> Fix can be either add ResponseSchemaMixin to manually created objectmappers OR call Json.mapper() and Yaml.mapper() to use swagger logic and don't create mapper manually.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)