You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Viral Gohel (JIRA)" <ji...@apache.org> on 2018/09/13 05:46:00 UTC
[jira] [Commented] (CAMEL-12805) camel-restdsl-swagger-plugin
doesn't convert integer default value to string
[ https://issues.apache.org/jira/browse/CAMEL-12805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613047#comment-16613047 ]
Viral Gohel commented on CAMEL-12805:
-------------------------------------
Thanks for reporting. Can you attach the complete json file which you are using? From the snippets you provided, i am not getting the plugin to generate code,
>> Unable to generate REST DSL Swagger sources from specification: src/spec/example.json, make sure that the specification is available at the given URI,
{code:java}
{
"name": "limit",
"in": "query",
"type": "integer",
"minimum": 1,
"default": 20,
"description": "the limit of the results for the collections query"
}{code}
> camel-restdsl-swagger-plugin doesn't convert integer default value to string
> ----------------------------------------------------------------------------
>
> Key: CAMEL-12805
> URL: https://issues.apache.org/jira/browse/CAMEL-12805
> Project: Camel
> Issue Type: Bug
> Components: tooling
> Affects Versions: 2.21.0
> Reporter: Jochen Cordes
> Priority: Major
>
> When generating a RouteBuilder from a swagger that defines default parameter values of type integer, there is no conversion to a string when setting it:
> Swagger:
> "limit":{
> "name":"limit",
> "in":"query",
> "type":"integer",
> "minimum":1,
> "default":20,
> "description":"the limit of the results for the collections query"
> },
> RouteBuilder:
> .param()
> .name("limit")
> .type(RestParamType.query)
> .dataType("integer")
> .defaultValue(20)
> .required(false)
> .description("the limit of the results for the collections query")
> .endParam()
> defaultValue only accepts parameters of type string and therefore the generated code can't be compiled and needs to be corrected manually.
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)