Camel Swagger Implementation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel Swagger Implementation

Bikash Kaushik
Hi everybody,

I'm implementing swagger in my camel rest project. It is working fine but I
have to implement more options like :

*1. By default swagger version is 2.0 , change it to 3.0.*
*2. By default generated swagger document is by name "swagger.json", change
it according to project name.*
*3. Define multiple port in swagger rest-configuration.*
*4. Read pom.xml value in my blueprint.xml.*
*5. Where is location of "swagger.json"?*

*Details :*
*Fuse Version : 6.3*
*Camel Version : 2.17.0.redhat-630187*

*Rest Configuration :*
<restConfiguration apiContextListing="true"
            apiContextPath="api-docs" bindingMode="json"
            component="jetty" contextPath="api"
            host="127.0.0.1" port="9544" scheme="http">
            <!-- we want json output in pretty mode -->
            <dataFormatProperty key="prettyPrint" value="true"/>
            <!-- setup swagger api descriptions -->
            <apiProperty key="base.path" value="project"/>
            <apiProperty key="api.version" value="1.0.0"/>
            <apiProperty key="api.title" value="Sample Project"/>
            <apiProperty key="api.description" value="Camel Rest Swagger
that provides an details of sample project"/>
        </restConfiguration>


*@Kindly help.*
*Thanks.*

--


*Regards,*
*Bikash Kaushik,*
*NIT Jamshedpur*
Reply | Threaded
Open this post in threaded view
|

Re: Camel Swagger Implementation

Bennet Schulz
Hi Bikash,

are you using the Camel Swagger component? https://github.com/apache/camel/tree/master/components/camel-swagger <https://github.com/apache/camel/tree/master/components/camel-swagger>
I think the easiest way is to use this one. Just checkout the code and take a look at it.

best regards,
Bennet

> On 26. Jun 2018, at 6:25 PM, Bikash Kaushik <[hidden email]> wrote:
>
> Hi everybody,
>
> I'm implementing swagger in my camel rest project. It is working fine but I
> have to implement more options like :
>
> *1. By default swagger version is 2.0 , change it to 3.0.*
> *2. By default generated swagger document is by name "swagger.json", change
> it according to project name.*
> *3. Define multiple port in swagger rest-configuration.*
> *4. Read pom.xml value in my blueprint.xml.*
> *5. Where is location of "swagger.json"?*
>
> *Details :*
> *Fuse Version : 6.3*
> *Camel Version : 2.17.0.redhat-630187*
>
> *Rest Configuration :*
> <restConfiguration apiContextListing="true"
>            apiContextPath="api-docs" bindingMode="json"
>            component="jetty" contextPath="api"
>            host="127.0.0.1" port="9544" scheme="http">
>            <!-- we want json output in pretty mode -->
>            <dataFormatProperty key="prettyPrint" value="true"/>
>            <!-- setup swagger api descriptions -->
>            <apiProperty key="base.path" value="project"/>
>            <apiProperty key="api.version" value="1.0.0"/>
>            <apiProperty key="api.title" value="Sample Project"/>
>            <apiProperty key="api.description" value="Camel Rest Swagger
> that provides an details of sample project"/>
>        </restConfiguration>
>
>
> *@Kindly help.*
> *Thanks.*
>
> --
>
>
> *Regards,*
> *Bikash Kaushik,*
> *NIT Jamshedpur*

Reply | Threaded
Open this post in threaded view
|

Re: Camel Swagger Implementation

Bikash Kaushik
Yes , I have done this.
But I need to do some configuration in swagger as mentioned in trail mail.
I'm facing issue in those changes.

Thanks.

On Wed, Jun 27, 2018, 4:55 PM Bennet Schulz <[hidden email]> wrote:

> Hi Bikash,
>
> are you using the Camel Swagger component?
> https://github.com/apache/camel/tree/master/components/camel-swagger <
> https://github.com/apache/camel/tree/master/components/camel-swagger>
> I think the easiest way is to use this one. Just checkout the code and
> take a look at it.
>
> best regards,
> Bennet
>
> > On 26. Jun 2018, at 6:25 PM, Bikash Kaushik <[hidden email]>
> wrote:
> >
> > Hi everybody,
> >
> > I'm implementing swagger in my camel rest project. It is working fine
> but I
> > have to implement more options like :
> >
> > *1. By default swagger version is 2.0 , change it to 3.0.*
> > *2. By default generated swagger document is by name "swagger.json",
> change
> > it according to project name.*
> > *3. Define multiple port in swagger rest-configuration.*
> > *4. Read pom.xml value in my blueprint.xml.*
> > *5. Where is location of "swagger.json"?*
> >
> > *Details :*
> > *Fuse Version : 6.3*
> > *Camel Version : 2.17.0.redhat-630187*
> >
> > *Rest Configuration :*
> > <restConfiguration apiContextListing="true"
> >            apiContextPath="api-docs" bindingMode="json"
> >            component="jetty" contextPath="api"
> >            host="127.0.0.1" port="9544" scheme="http">
> >            <!-- we want json output in pretty mode -->
> >            <dataFormatProperty key="prettyPrint" value="true"/>
> >            <!-- setup swagger api descriptions -->
> >            <apiProperty key="base.path" value="project"/>
> >            <apiProperty key="api.version" value="1.0.0"/>
> >            <apiProperty key="api.title" value="Sample Project"/>
> >            <apiProperty key="api.description" value="Camel Rest Swagger
> > that provides an details of sample project"/>
> >        </restConfiguration>
> >
> >
> > *@Kindly help.*
> > *Thanks.*
> >
> > --
> >
> >
> > *Regards,*
> > *Bikash Kaushik,*
> > *NIT Jamshedpur*
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Camel Swagger Implementation

Claus Ibsen-2
Hi

Camel uses swagger to generate the json file, and its tied to be
Swagger 2.0 spec with the version of swagger we use.

To support 3.0 we would need to upgrade the swagger library, and
potential do migration as its potentially not a drop in replacement.

I logged a ticket so support 3.0 spec in a future Camel release
https://issues.apache.org/jira/browse/CAMEL-12619

The swagger.json name is hardcoded and cannot be changed at the moment.
We can consider allowing to customize it so you can specific a
different name, if so then log a JIRA at upstream






On Wed, Jun 27, 2018 at 3:18 PM, Bikash Kaushik
<[hidden email]> wrote:

> Yes , I have done this.
> But I need to do some configuration in swagger as mentioned in trail mail.
> I'm facing issue in those changes.
>
> Thanks.
>
> On Wed, Jun 27, 2018, 4:55 PM Bennet Schulz <[hidden email]> wrote:
>
>> Hi Bikash,
>>
>> are you using the Camel Swagger component?
>> https://github.com/apache/camel/tree/master/components/camel-swagger <
>> https://github.com/apache/camel/tree/master/components/camel-swagger>
>> I think the easiest way is to use this one. Just checkout the code and
>> take a look at it.
>>
>> best regards,
>> Bennet
>>
>> > On 26. Jun 2018, at 6:25 PM, Bikash Kaushik <[hidden email]>
>> wrote:
>> >
>> > Hi everybody,
>> >
>> > I'm implementing swagger in my camel rest project. It is working fine
>> but I
>> > have to implement more options like :
>> >
>> > *1. By default swagger version is 2.0 , change it to 3.0.*
>> > *2. By default generated swagger document is by name "swagger.json",
>> change
>> > it according to project name.*
>> > *3. Define multiple port in swagger rest-configuration.*
>> > *4. Read pom.xml value in my blueprint.xml.*
>> > *5. Where is location of "swagger.json"?*
>> >
>> > *Details :*
>> > *Fuse Version : 6.3*
>> > *Camel Version : 2.17.0.redhat-630187*
>> >
>> > *Rest Configuration :*
>> > <restConfiguration apiContextListing="true"
>> >            apiContextPath="api-docs" bindingMode="json"
>> >            component="jetty" contextPath="api"
>> >            host="127.0.0.1" port="9544" scheme="http">
>> >            <!-- we want json output in pretty mode -->
>> >            <dataFormatProperty key="prettyPrint" value="true"/>
>> >            <!-- setup swagger api descriptions -->
>> >            <apiProperty key="base.path" value="project"/>
>> >            <apiProperty key="api.version" value="1.0.0"/>
>> >            <apiProperty key="api.title" value="Sample Project"/>
>> >            <apiProperty key="api.description" value="Camel Rest Swagger
>> > that provides an details of sample project"/>
>> >        </restConfiguration>
>> >
>> >
>> > *@Kindly help.*
>> > *Thanks.*
>> >
>> > --
>> >
>> >
>> > *Regards,*
>> > *Bikash Kaushik,*
>> > *NIT Jamshedpur*
>>
>>



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2