You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sw1m1k <as...@inbox.lv> on 2016/10/10 12:42:44 UTC

camel swagger doesn't support array of objects as input type

Hello, I have a problem with swagger rest dsl. I have a rest service with
input and output type- array of objects, for method POST:
            <post type="bla.bla.bla.Product[]"
outType="bla.bla.bla.Product[]" bindingMode="json">
                <description>Create Products</description>
                
                <responseMessage message="Created Product"/>
                <route>
                    <to
uri="bean:productApi?method=createProducts(${body})"/>
                </route>
            </post>
Problem is that camel swagger doesn't create correct "Example Value" for
request. For response everything works fine. Example Value of Request:
{"test":"test"}
Example Value of Response:
[{"test":"test"}]
So [] is missing from request. If i correctly investigated
"RestSwaggerReader" class, this functionality is missing from
camel-swagger-java 2.17.



--
View this message in context: http://camel.465427.n5.nabble.com/camel-swagger-doesn-t-support-array-of-objects-as-input-type-tp5788557.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel swagger doesn't support array of objects as input type

Posted by Sw1m1k <as...@inbox.lv>.
???



--
View this message in context: http://camel.465427.n5.nabble.com/camel-swagger-doesn-t-support-array-of-objects-as-input-type-tp5788557p5788786.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel swagger doesn't support array of objects as input type

Posted by Sw1m1k <as...@inbox.lv>.
Can You five me an example? Should i add it to <post> tag or somewhere else?
And why response example value works fine with []?



--
View this message in context: http://camel.465427.n5.nabble.com/camel-swagger-doesn-t-support-array-of-objects-as-input-type-tp5788557p5788586.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel swagger doesn't support array of objects as input type

Posted by fabryprog <fa...@bizmate.it>.
An array isn't a JSON 

BUT

There is a mode to add this "special case" using dataFormatProperty tag!



--
View this message in context: http://camel.465427.n5.nabble.com/camel-swagger-doesn-t-support-array-of-objects-as-input-type-tp5788557p5788563.html
Sent from the Camel - Users mailing list archive at Nabble.com.