You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by urwithsumit <su...@gmail.com> on 2016/02/03 00:59:19 UTC

Camle-Swagger-Java- documenting optional param for REST Service

Hi,

Currently while documenting the REST Service we are giving param name as
below:

<camel:param name="consumer_name" type="header" description="Consumer name
invoking the Service." dataType="string" />

This marks the param as mandatory and when we are testing it with swagger-ui
we are forced to give value for this param. 

I want to document this param as an optional param. How can this be
achieved?

Note: We are using Camel 2.16.1 and working with Camel-swagger-java
component.

Regards
Sumit



--
View this message in context: http://camel.465427.n5.nabble.com/Camle-Swagger-Java-documenting-optional-param-for-REST-Service-tp5777172.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camle-Swagger-Java- documenting optional param for REST Service

Posted by urwithsumit <su...@gmail.com>.
Thanks Matt. It fixed the issue.



--
View this message in context: http://camel.465427.n5.nabble.com/Camle-Swagger-Java-documenting-optional-param-for-REST-Service-tp5777172p5777194.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camle-Swagger-Java- documenting optional param for REST Service

Posted by Matt Sicker <bo...@gmail.com>.
Use required="false" in your param element.

On 2 February 2016 at 17:59, urwithsumit <su...@gmail.com> wrote:

> Hi,
>
> Currently while documenting the REST Service we are giving param name as
> below:
>
> <camel:param name="consumer_name" type="header" description="Consumer name
> invoking the Service." dataType="string" />
>
> This marks the param as mandatory and when we are testing it with
> swagger-ui
> we are forced to give value for this param.
>
> I want to document this param as an optional param. How can this be
> achieved?
>
> Note: We are using Camel 2.16.1 and working with Camel-swagger-java
> component.
>
> Regards
> Sumit
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camle-Swagger-Java-documenting-optional-param-for-REST-Service-tp5777172.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Matt Sicker <bo...@gmail.com>