You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by camel_case <cs...@remedypartners.com> on 2016/02/19 00:21:46 UTC
cxfrs swagger
I have swagger working with rest dsl, but cxfrs doesn't show.
This appears in the window:
fetching resource list: http://127.0.0.1:9090/api-docs; Please wait.
This appears in the console:
Uncaught TypeError: Cannot read property 'definitions' of null
Tried updating to camel version 2.16.1 and cxf 3.1.4 and had to change some
of the application initialization (meaning the friendly dummy and fake
example code needed tweeking since servletListener is gone, and thus use
DefaultSwaggerServlet)
Is it possible yet to get swagger going with camel cxfrs? Is there an
example anywhere? Are there specific versions of stuff to use, if you know?
--
View this message in context: http://camel.465427.n5.nabble.com/cxfrs-swagger-tp5777892.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: cxfrs swagger
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 19/02/16 16:27, camel_case wrote:
> Just to clarify, I could use swagger with cxf, but not cxfrs and camel? Is
> there no work around using the cxf with swagger examples to let swagger know
> about the route url by assignment as in the example below ( so far as I
> tried this, trouble of this nature:
> Caused by: java.lang.ClassCastException:
> org.apache.cxf.jaxrs.model.wadl.WadlGenerator cannot be cast to
> javax.ws.rs.container.ContainerRequestFilter )
This is a very strange error, looks like you may not have jaxr20 api on
the classpath; and you should also exclude cxf-rt-rs-service-description
to avoid a WADl generator be loaded in the 1st place
Sergey
>
> (using this from your link http://cxf.apache.org/docs/swagger2feature.html)
> import org.apache.cxf.frontend.ServerFactoryBean;
> import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
> ...
>
> Swagger2Feature feature = new Swagger2Feature();
>
> // customize some of the properties
> feature.setBasePath("/api");
>
> // add this feature to the endpoint (e.g., to ServerFactoryBean's
> features)
> ServerFactoryBean sfb = new ServerFactoryBean();
> sfb.getFeatures().add(feature);
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/cxfrs-swagger-tp5777892p5777938.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Re: cxfrs swagger
Posted by camel_case <cs...@remedypartners.com>.
Just to clarify, I could use swagger with cxf, but not cxfrs and camel? Is
there no work around using the cxf with swagger examples to let swagger know
about the route url by assignment as in the example below ( so far as I
tried this, trouble of this nature:
Caused by: java.lang.ClassCastException:
org.apache.cxf.jaxrs.model.wadl.WadlGenerator cannot be cast to
javax.ws.rs.container.ContainerRequestFilter )
(using this from your link http://cxf.apache.org/docs/swagger2feature.html)
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
...
Swagger2Feature feature = new Swagger2Feature();
// customize some of the properties
feature.setBasePath("/api");
// add this feature to the endpoint (e.g., to ServerFactoryBean's
features)
ServerFactoryBean sfb = new ServerFactoryBean();
sfb.getFeatures().add(feature);
--
View this message in context: http://camel.465427.n5.nabble.com/cxfrs-swagger-tp5777892p5777938.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: cxfrs swagger
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Claus - thanks, duplicated your response today,
Cheers. Sergey
On 19/02/16 06:48, Claus Ibsen wrote:
> Apache CXF has its won swagger integration.
> http://cxf.apache.org/docs/swagger2feature.html
> http://cxf.apache.org/docs/featureslist.html
>
> camel-cxf is not yet integrated with rest-dsl or camel-swagger.
>
> On Fri, Feb 19, 2016 at 12:21 AM, camel_case
> <cs...@remedypartners.com> wrote:
>> I have swagger working with rest dsl, but cxfrs doesn't show.
>>
>> This appears in the window:
>> fetching resource list: http://127.0.0.1:9090/api-docs; Please wait.
>>
>> This appears in the console:
>> Uncaught TypeError: Cannot read property 'definitions' of null
>>
>> Tried updating to camel version 2.16.1 and cxf 3.1.4 and had to change some
>> of the application initialization (meaning the friendly dummy and fake
>> example code needed tweeking since servletListener is gone, and thus use
>> DefaultSwaggerServlet)
>>
>> Is it possible yet to get swagger going with camel cxfrs? Is there an
>> example anywhere? Are there specific versions of stuff to use, if you know?
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/cxfrs-swagger-tp5777892.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Re: cxfrs swagger
Posted by Claus Ibsen <cl...@gmail.com>.
Apache CXF has its won swagger integration.
http://cxf.apache.org/docs/swagger2feature.html
http://cxf.apache.org/docs/featureslist.html
camel-cxf is not yet integrated with rest-dsl or camel-swagger.
On Fri, Feb 19, 2016 at 12:21 AM, camel_case
<cs...@remedypartners.com> wrote:
> I have swagger working with rest dsl, but cxfrs doesn't show.
>
> This appears in the window:
> fetching resource list: http://127.0.0.1:9090/api-docs; Please wait.
>
> This appears in the console:
> Uncaught TypeError: Cannot read property 'definitions' of null
>
> Tried updating to camel version 2.16.1 and cxf 3.1.4 and had to change some
> of the application initialization (meaning the friendly dummy and fake
> example code needed tweeking since servletListener is gone, and thus use
> DefaultSwaggerServlet)
>
> Is it possible yet to get swagger going with camel cxfrs? Is there an
> example anywhere? Are there specific versions of stuff to use, if you know?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/cxfrs-swagger-tp5777892.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: cxfrs swagger
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi, register a Swagger2Feature in cxfrs:rsServer/cxfrs:features
http://cxf.apache.org/docs/swagger2feature.html
You might need to configure it to run as a JAX-RS filter, it has a
boolean property called 'runAsFilter', though not 100% sure if it will
be needed, please experiment
Sergey
On 18/02/16 23:21, camel_case wrote:
> I have swagger working with rest dsl, but cxfrs doesn't show.
>
> This appears in the window:
> fetching resource list: http://127.0.0.1:9090/api-docs; Please wait.
>
> This appears in the console:
> Uncaught TypeError: Cannot read property 'definitions' of null
>
> Tried updating to camel version 2.16.1 and cxf 3.1.4 and had to change some
> of the application initialization (meaning the friendly dummy and fake
> example code needed tweeking since servletListener is gone, and thus use
> DefaultSwaggerServlet)
>
> Is it possible yet to get swagger going with camel cxfrs? Is there an
> example anywhere? Are there specific versions of stuff to use, if you know?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/cxfrs-swagger-tp5777892.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/