You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2016/09/01 16:20:04 UTC

Re: CXFRS swagger integration

Hi

On 31/08/16 20:46, cacert wrote:
> Hi Sergey,
>
> After setting this property I can see swagger.json is generated but still
> can not see swagger ui when I follow the link.
>
> when I list my restfull services it prints:
> Endpoint address: http://localhost:8080/api/rest
> Swagger : http://localhost:8080/api/rest/api-docs?url=/api/rest/swagger.json
>
> when i follow the link
> "http://localhost:8080/api/rest/api-docs?url=/api/rest/swagger.json" again
> this request comes to the route which is not I was expecting.

Are you referring to Swagger UI auto-linking in CXF 3.1.7 ? If yes then 
in CXF 3.1.7 it works by allocating another JAX-RS root resource to the 
current endpoint - which unfortunately does not work for a Camel route.

Swagger.json generation is also supported by default by an extra JAX-RS 
root resource which is also not good for Camel route - this is why 
Swagger2Feature.runAsFilter=true helps but as I noted above SwaggerUI 
resource can not be available as a filter in CXF 3.1.7.

I've just fixed it for CXF 3.1.8-SNAPSHOT

Sergey

>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXFRS-swagger-integration-tp5787041p5787072.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: CXFRS swagger integration

Posted by Brad Johnson <br...@mediadriver.com>.
Cool.  Thanks,

Brad

On Sat, Sep 3, 2016 at 11:55 AM, jfx <mo...@fwd.at> wrote:

> Hi there,
>
> I added a few features to the CXF code generator in Swagger-Codegen
> (bean-validation-api support, CXF3 Swagger2Feature for complimentary code
> first support, generate test classes, added pom.xml for server, spring is
> used for configuration of CXF3).
>
> However, my PR is still pending:
> https://github.com/swagger-api/swagger-codegen/pull/3281
>
> If you like to run it, give it a try.
>
> You can find the current feature list here:
> https://github.com/swagger-api/swagger-codegen/wiki/
> Server-stub-generator-HOWTO
>
> Pls let me know how you are doing with it...
>
> Best regards,
> Johannes
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/CXFRS-swagger-integration-tp5787041p5787169.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: CXFRS swagger integration

Posted by jfx <mo...@fwd.at>.
Hi there,

I added a few features to the CXF code generator in Swagger-Codegen
(bean-validation-api support, CXF3 Swagger2Feature for complimentary code
first support, generate test classes, added pom.xml for server, spring is
used for configuration of CXF3).

However, my PR is still pending:
https://github.com/swagger-api/swagger-codegen/pull/3281

If you like to run it, give it a try. 

You can find the current feature list here:
https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO

Pls let me know how you are doing with it...

Best regards,
Johannes



--
View this message in context: http://camel.465427.n5.nabble.com/CXFRS-swagger-integration-tp5787041p5787169.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXFRS swagger integration

Posted by Brad Johnson <br...@mediadriver.com>.
The one on the Swagger site looked like it was putting together passable
code and I didn't get into it in any depth.  But it had a very distinct
structure and lay out that I wouldn't use or like.  It could be modified of
course.

I'll have to run it again and see what it looks like again.

Brad

On Thu, Sep 1, 2016 at 3:55 PM, Sergey Beryozkin <sb...@gmail.com>
wrote:

> I think the one available at the Swagger website is the only one,
> looks like it is pretty active. I'll ask one of CXF users to reply to this
> tread
>
> Sergey
>
> On 01/09/16 19:57, Brad Johnson wrote:
>
>> As a related note, is there and Eclipse plugin or Java library that
>> converts Swagger yml files into CXF interfaces and data models.  I find
>> myself in situations lately where it is more likely that I'm being given a
>> swagger file rather than creating one.  But the Java generator on the
>> website for Swagger didn't seem terribly useful when I cracked it open.
>>
>> Brad
>>
>> On Thu, Sep 1, 2016 at 11:20 AM, Sergey Beryozkin <sb...@gmail.com>
>> wrote:
>>
>> Hi
>>>
>>> On 31/08/16 20:46, cacert wrote:
>>>
>>> Hi Sergey,
>>>>
>>>> After setting this property I can see swagger.json is generated but
>>>> still
>>>> can not see swagger ui when I follow the link.
>>>>
>>>> when I list my restfull services it prints:
>>>> Endpoint address: http://localhost:8080/api/rest
>>>> Swagger : http://localhost:8080/api/rest/api-docs?url=/api/rest/swagge
>>>> r.json
>>>>
>>>> when i follow the link
>>>> "http://localhost:8080/api/rest/api-docs?url=/api/rest/swagger.json"
>>>> again
>>>> this request comes to the route which is not I was expecting.
>>>>
>>>>
>>> Are you referring to Swagger UI auto-linking in CXF 3.1.7 ? If yes then
>>> in
>>> CXF 3.1.7 it works by allocating another JAX-RS root resource to the
>>> current endpoint - which unfortunately does not work for a Camel route.
>>>
>>> Swagger.json generation is also supported by default by an extra JAX-RS
>>> root resource which is also not good for Camel route - this is why
>>> Swagger2Feature.runAsFilter=true helps but as I noted above SwaggerUI
>>> resource can not be available as a filter in CXF 3.1.7.
>>>
>>> I've just fixed it for CXF 3.1.8-SNAPSHOT
>>>
>>> Sergey
>>>
>>>
>>>
>>>
>>>>
>>>> --
>>>> View this message in context: http://camel.465427.n5.nabble.
>>>> com/CXFRS-swagger-integration-tp5787041p5787072.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
>>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>

Re: CXFRS swagger integration

Posted by Sergey Beryozkin <sb...@gmail.com>.
I think the one available at the Swagger website is the only one,
looks like it is pretty active. I'll ask one of CXF users to reply to 
this tread

Sergey
On 01/09/16 19:57, Brad Johnson wrote:
> As a related note, is there and Eclipse plugin or Java library that
> converts Swagger yml files into CXF interfaces and data models.  I find
> myself in situations lately where it is more likely that I'm being given a
> swagger file rather than creating one.  But the Java generator on the
> website for Swagger didn't seem terribly useful when I cracked it open.
>
> Brad
>
> On Thu, Sep 1, 2016 at 11:20 AM, Sergey Beryozkin <sb...@gmail.com>
> wrote:
>
>> Hi
>>
>> On 31/08/16 20:46, cacert wrote:
>>
>>> Hi Sergey,
>>>
>>> After setting this property I can see swagger.json is generated but still
>>> can not see swagger ui when I follow the link.
>>>
>>> when I list my restfull services it prints:
>>> Endpoint address: http://localhost:8080/api/rest
>>> Swagger : http://localhost:8080/api/rest/api-docs?url=/api/rest/swagge
>>> r.json
>>>
>>> when i follow the link
>>> "http://localhost:8080/api/rest/api-docs?url=/api/rest/swagger.json"
>>> again
>>> this request comes to the route which is not I was expecting.
>>>
>>
>> Are you referring to Swagger UI auto-linking in CXF 3.1.7 ? If yes then in
>> CXF 3.1.7 it works by allocating another JAX-RS root resource to the
>> current endpoint - which unfortunately does not work for a Camel route.
>>
>> Swagger.json generation is also supported by default by an extra JAX-RS
>> root resource which is also not good for Camel route - this is why
>> Swagger2Feature.runAsFilter=true helps but as I noted above SwaggerUI
>> resource can not be available as a filter in CXF 3.1.7.
>>
>> I've just fixed it for CXF 3.1.8-SNAPSHOT
>>
>> Sergey
>>
>>
>>
>>>
>>>
>>> --
>>> View this message in context: http://camel.465427.n5.nabble.
>>> com/CXFRS-swagger-integration-tp5787041p5787072.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: CXFRS swagger integration

Posted by Brad Johnson <br...@mediadriver.com>.
As a related note, is there and Eclipse plugin or Java library that
converts Swagger yml files into CXF interfaces and data models.  I find
myself in situations lately where it is more likely that I'm being given a
swagger file rather than creating one.  But the Java generator on the
website for Swagger didn't seem terribly useful when I cracked it open.

Brad

On Thu, Sep 1, 2016 at 11:20 AM, Sergey Beryozkin <sb...@gmail.com>
wrote:

> Hi
>
> On 31/08/16 20:46, cacert wrote:
>
>> Hi Sergey,
>>
>> After setting this property I can see swagger.json is generated but still
>> can not see swagger ui when I follow the link.
>>
>> when I list my restfull services it prints:
>> Endpoint address: http://localhost:8080/api/rest
>> Swagger : http://localhost:8080/api/rest/api-docs?url=/api/rest/swagge
>> r.json
>>
>> when i follow the link
>> "http://localhost:8080/api/rest/api-docs?url=/api/rest/swagger.json"
>> again
>> this request comes to the route which is not I was expecting.
>>
>
> Are you referring to Swagger UI auto-linking in CXF 3.1.7 ? If yes then in
> CXF 3.1.7 it works by allocating another JAX-RS root resource to the
> current endpoint - which unfortunately does not work for a Camel route.
>
> Swagger.json generation is also supported by default by an extra JAX-RS
> root resource which is also not good for Camel route - this is why
> Swagger2Feature.runAsFilter=true helps but as I noted above SwaggerUI
> resource can not be available as a filter in CXF 3.1.7.
>
> I've just fixed it for CXF 3.1.8-SNAPSHOT
>
> Sergey
>
>
>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.
>> com/CXFRS-swagger-integration-tp5787041p5787072.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>