You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by namdets <na...@gmail.com> on 2015/04/09 22:12:31 UTC

WADL Grammar section lost for generic service class.

I am trying to use a generic base class for my service endpoints so I don't
have to retype the basic getAll, get, put, post, delete handlers every time.
When I do this, the runtime generated WADL shows a blank grammars section.

This is using:

com.fasterxml.jackson artifacts @ 2.5.2
org.apache.cxf artifacts @ 3.0.4
deploying in Tomcat 7

Example:

This generates a WADL with an empty grammars section:

@Transactional
@Consumes("application/json")
@Produces("application/json")
public abstract class AbstractRS<T>{
  @GET
  @Produces("application/json")
  public List<T> getAll(){
     ....
  }
}

@Controller
@Path("/foo")
public class FooRS extends AbstractRS<Foo>{
  ...
}

This generates a WADL with a fully spec'd grammars section if I just pull in
a single method that includes the specified parameter type(Foo) in its
prototype:

@Transactional
@Consumes("application/json")
@Produces("application/json")
public abstract class AbstractRS<T>{
  @GET
  @Produces("application/json")
  public List<T> getAll(){
     ....
  }
}

@Controller
@Path("/foo")
public class FooRS extends AbstractRS<Foo>{
  ...
  
  @GET
  @Produces("application/json")
  public List<Foo> getAll(){
    return super.getAll();
  }
}





--
View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WADL Grammar section lost for generic service class.

Posted by aman <am...@forgeahead.io>.
Hi,
<jaxrs:providers>
                 <ref bean="jsonProvider"/>
                 <bean
class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
                
            </bean>


It gave me error
"Bean property 'linkAnyMediaTypeToXmlSchema' is not writable or has an
invalid setter method."



--
View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5779193.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WADL Grammar section lost for generic service class.

Posted by namdets <na...@gmail.com>.
Sergey,

That worked, thank you for all your help!

Jason

On Sun, Apr 26, 2015 at 4:06 PM, Sergey Beryozkin [via CXF] <
ml-node+s547215n5756546h1@n5.nabble.com> wrote:

> Hi
>
> Good it is working for you,
> Can you please re-enable that property, 'linkAnyMediaTypeToJson' ? That
> should do it.
>
> Sergey
> On 26/04/15 08:31, namdets wrote:
>
> > Sergey,
> >
> > Both 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT pass my tests. Thank you very
> much
> > for your work on CXF in general and particularly on this issue.
> >
> > I won't be needing any 2.7 support, onward and upward!
> >
> > One additional thing that I noticed was that the representation elements
> in
> > the generated WADL do not populate the element attribute(attribute
> called
> > 'element', argh!) unless the media type is applicaiton/xml. This is not
> > counter to the WADL spec, so is not a bug. However given that the spec
> does
> > not forbid element attributes on application/json media typed
> > representation elements, I would consider it a desirable feature in
> today's
> > more JSON oriented world. The implication here is that the wadl2java
> tool
> > could generate JSON clients that have correct response types in their
> > method stubs.
> >
> > There is a workaround here as always, but it isn't pretty. If we add
> > application/xml to our consumes/produces, we get something like this:
> >
> > <method name="PUT">
> > <request>
> > <representation mediaType="application/json"/>
> > <representation mediaType="aaplication/xml"
> element="prefix1:something"/>
> > </request>
> > <response>
> > <representation mediaType="application/json"/>
> > <representation mediaType="aaplication/xml"
> element="prefix1:something"/>
> > </response>
> > </method>
> > While this will produce a correctly typed stub, and is more flexible if
> you
> > ever might need XML support, in today's more JSON oriented world it
> feels
> > like noise.
> >
> > Again, thank you very much for your help!
> >
> > Jason
> >
> > On Fri, Apr 24, 2015 at 10:59 AM, Sergey Beryozkin [via CXF] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5756546&i=0>>
> wrote:
> >
> >> Hi
> >>
> >> I've updated a bit the WADLGenerator code and added a test, should all
> >> work as expected now.
> >> Can you please try the snapshots ? Note I've only merged to
> >> 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT.
> >> Do you need it for CXF 2.7.x ?
> >> Thanks, Sergey
> >>
> >> On 22/04/15 11:08, Sergey Beryozkin wrote:
> >>
> >>> OK, may be something to do with figuring out what T is in List<T>, I
> >>> thought it was all working fine after Francesco submitted few issues
> to
> >>> do with the WADL auto-generation awhile back.
> >>> I'll try to have a look before 3.0.5 gets out but I'm not sure yet
> I'll
> >>> have time - I'll investigate either way
> >>>
> >>> Thanks, Sergey
> >>> On 21/04/15 21:58, namdets wrote:
> >>>> Sergey,
> >>>>
> >>>> Thanks for getting back to me!
> >>>>
> >>>> I tried setting the linkAnyMediaTypeToXmlSchema property on my
> >>>> WadlGenerator
> >>>> like so:
> >>>>
> >>>>
> >>>>       <jaxrs:server id="services" address="/">
> >>>>           <jaxrs:serviceBeans>
> >>>>               <ref bean="companyRS"/>
> >>>>           </jaxrs:serviceBeans>
> >>>>           <jaxrs:providers>
> >>>>               <bean
> >> class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
> >>>>                   <property name="linkAnyMediaTypeToXmlSchema"
> >>>> value="true"/>
> >>>>               </bean>
> >>>>               <bean
> >>>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
> >>>>           </jaxrs:providers>
> >>>>       </jaxrs:server>
> >>>>
> >>>> Unfortunately this did not resolve the issue, is this the correct
> way?
> >>>>
> >>>> Some additional information:
> >>>>
> >>>> My DTOs are marked with @XmlRootElement as this has been required in
> >> the
> >>>> past to get any grammars included in the wadl for application/json
> >> media
> >>>> types, but I have tried removing this also.
> >>>>
> >>>> The wadl generation is complete with grammars if I put my resource
> >>>> methods
> >>>> directly in the FooRS instead of(or in addition to) the AbstractRS
> >>>> without
> >>>> making any other changes.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> >>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756379.html
> >>>>
> >>>> Sent from the cxf-user mailing list archive at Nabble.com.
> >>>>
> >>>
> >>
> >>
> >> --
> >> Sergey Beryozkin
> >>
> >> Talend Community Coders
> >> http://coders.talend.com/
> >>
> >> Blog: http://sberyozkin.blogspot.com
> >>
> >>
> >> ------------------------------
> >>   If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756525.html
> >>   To unsubscribe from WADL Grammar section lost for generic service
> class., click
> >> here
> >> <
> >> .
> >> NAML
> >> <
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756544.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
> >
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756546.html
>  To unsubscribe from WADL Grammar section lost for generic service class., click
> here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5755870&code=bmFtZGV0c0BnbWFpbC5jb218NTc1NTg3MHwxNzc3NjA4OTEz>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756607.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WADL Grammar section lost for generic service class.

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

Good it is working for you,
Can you please re-enable that property, 'linkAnyMediaTypeToJson' ? That 
should do it.

Sergey
On 26/04/15 08:31, namdets wrote:
> Sergey,
>
> Both 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT pass my tests. Thank you very much
> for your work on CXF in general and particularly on this issue.
>
> I won't be needing any 2.7 support, onward and upward!
>
> One additional thing that I noticed was that the representation elements in
> the generated WADL do not populate the element attribute(attribute called
> 'element', argh!) unless the media type is applicaiton/xml. This is not
> counter to the WADL spec, so is not a bug. However given that the spec does
> not forbid element attributes on application/json media typed
> representation elements, I would consider it a desirable feature in today's
> more JSON oriented world. The implication here is that the wadl2java tool
> could generate JSON clients that have correct response types in their
> method stubs.
>
> There is a workaround here as always, but it isn't pretty. If we add
> application/xml to our consumes/produces, we get something like this:
>
> <method name="PUT">
> <request>
> <representation mediaType="application/json"/>
> <representation mediaType="aaplication/xml" element="prefix1:something"/>
> </request>
> <response>
> <representation mediaType="application/json"/>
> <representation mediaType="aaplication/xml" element="prefix1:something"/>
> </response>
> </method>
> While this will produce a correctly typed stub, and is more flexible if you
> ever might need XML support, in today's more JSON oriented world it feels
> like noise.
>
> Again, thank you very much for your help!
>
> Jason
>
> On Fri, Apr 24, 2015 at 10:59 AM, Sergey Beryozkin [via CXF] <
> ml-node+s547215n5756525h50@n5.nabble.com> wrote:
>
>> Hi
>>
>> I've updated a bit the WADLGenerator code and added a test, should all
>> work as expected now.
>> Can you please try the snapshots ? Note I've only merged to
>> 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT.
>> Do you need it for CXF 2.7.x ?
>> Thanks, Sergey
>>
>> On 22/04/15 11:08, Sergey Beryozkin wrote:
>>
>>> OK, may be something to do with figuring out what T is in List<T>, I
>>> thought it was all working fine after Francesco submitted few issues to
>>> do with the WADL auto-generation awhile back.
>>> I'll try to have a look before 3.0.5 gets out but I'm not sure yet I'll
>>> have time - I'll investigate either way
>>>
>>> Thanks, Sergey
>>> On 21/04/15 21:58, namdets wrote:
>>>> Sergey,
>>>>
>>>> Thanks for getting back to me!
>>>>
>>>> I tried setting the linkAnyMediaTypeToXmlSchema property on my
>>>> WadlGenerator
>>>> like so:
>>>>
>>>>
>>>>       <jaxrs:server id="services" address="/">
>>>>           <jaxrs:serviceBeans>
>>>>               <ref bean="companyRS"/>
>>>>           </jaxrs:serviceBeans>
>>>>           <jaxrs:providers>
>>>>               <bean
>> class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
>>>>                   <property name="linkAnyMediaTypeToXmlSchema"
>>>> value="true"/>
>>>>               </bean>
>>>>               <bean
>>>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>>>           </jaxrs:providers>
>>>>       </jaxrs:server>
>>>>
>>>> Unfortunately this did not resolve the issue, is this the correct way?
>>>>
>>>> Some additional information:
>>>>
>>>> My DTOs are marked with @XmlRootElement as this has been required in
>> the
>>>> past to get any grammars included in the wadl for application/json
>> media
>>>> types, but I have tried removing this also.
>>>>
>>>> The wadl generation is complete with grammars if I put my resource
>>>> methods
>>>> directly in the FooRS instead of(or in addition to) the AbstractRS
>>>> without
>>>> making any other changes.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>>
>> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756379.html
>>>>
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>
>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>> Blog: http://sberyozkin.blogspot.com
>>
>>
>> ------------------------------
>>   If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756525.html
>>   To unsubscribe from WADL Grammar section lost for generic service class., click
>> here
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5755870&code=bmFtZGV0c0BnbWFpbC5jb218NTc1NTg3MHwxNzc3NjA4OTEz>
>> .
>> NAML
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756544.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: WADL Grammar section lost for generic service class.

Posted by namdets <na...@gmail.com>.
Sergey,

Both 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT pass my tests. Thank you very much
for your work on CXF in general and particularly on this issue.

I won't be needing any 2.7 support, onward and upward!

One additional thing that I noticed was that the representation elements in
the generated WADL do not populate the element attribute(attribute called
'element', argh!) unless the media type is applicaiton/xml. This is not
counter to the WADL spec, so is not a bug. However given that the spec does
not forbid element attributes on application/json media typed
representation elements, I would consider it a desirable feature in today's
more JSON oriented world. The implication here is that the wadl2java tool
could generate JSON clients that have correct response types in their
method stubs.

There is a workaround here as always, but it isn't pretty. If we add
application/xml to our consumes/produces, we get something like this:

<method name="PUT">
<request>
<representation mediaType="application/json"/>
<representation mediaType="aaplication/xml" element="prefix1:something"/>
</request>
<response>
<representation mediaType="application/json"/>
<representation mediaType="aaplication/xml" element="prefix1:something"/>
</response>
</method>
While this will produce a correctly typed stub, and is more flexible if you
ever might need XML support, in today's more JSON oriented world it feels
like noise.

Again, thank you very much for your help!

Jason

On Fri, Apr 24, 2015 at 10:59 AM, Sergey Beryozkin [via CXF] <
ml-node+s547215n5756525h50@n5.nabble.com> wrote:

> Hi
>
> I've updated a bit the WADLGenerator code and added a test, should all
> work as expected now.
> Can you please try the snapshots ? Note I've only merged to
> 3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT.
> Do you need it for CXF 2.7.x ?
> Thanks, Sergey
>
> On 22/04/15 11:08, Sergey Beryozkin wrote:
>
> > OK, may be something to do with figuring out what T is in List<T>, I
> > thought it was all working fine after Francesco submitted few issues to
> > do with the WADL auto-generation awhile back.
> > I'll try to have a look before 3.0.5 gets out but I'm not sure yet I'll
> > have time - I'll investigate either way
> >
> > Thanks, Sergey
> > On 21/04/15 21:58, namdets wrote:
> >> Sergey,
> >>
> >> Thanks for getting back to me!
> >>
> >> I tried setting the linkAnyMediaTypeToXmlSchema property on my
> >> WadlGenerator
> >> like so:
> >>
> >>
> >>      <jaxrs:server id="services" address="/">
> >>          <jaxrs:serviceBeans>
> >>              <ref bean="companyRS"/>
> >>          </jaxrs:serviceBeans>
> >>          <jaxrs:providers>
> >>              <bean
> class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
> >>                  <property name="linkAnyMediaTypeToXmlSchema"
> >> value="true"/>
> >>              </bean>
> >>              <bean
> >> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
> >>          </jaxrs:providers>
> >>      </jaxrs:server>
> >>
> >> Unfortunately this did not resolve the issue, is this the correct way?
> >>
> >> Some additional information:
> >>
> >> My DTOs are marked with @XmlRootElement as this has been required in
> the
> >> past to get any grammars included in the wadl for application/json
> media
> >> types, but I have tried removing this also.
> >>
> >> The wadl generation is complete with grammars if I put my resource
> >> methods
> >> directly in the FooRS instead of(or in addition to) the AbstractRS
> >> without
> >> making any other changes.
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756379.html
> >>
> >> Sent from the cxf-user mailing list archive at Nabble.com.
> >>
> >
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756525.html
>  To unsubscribe from WADL Grammar section lost for generic service class., click
> here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5755870&code=bmFtZGV0c0BnbWFpbC5jb218NTc1NTg3MHwxNzc3NjA4OTEz>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756544.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WADL Grammar section lost for generic service class.

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

I've updated a bit the WADLGenerator code and added a test, should all 
work as expected now.
Can you please try the snapshots ? Note I've only merged to 
3.0.5-SNAPSHOT and 3.1.0-SNAPSHOT.
Do you need it for CXF 2.7.x ?
Thanks, Sergey

On 22/04/15 11:08, Sergey Beryozkin wrote:
> OK, may be something to do with figuring out what T is in List<T>, I
> thought it was all working fine after Francesco submitted few issues to
> do with the WADL auto-generation awhile back.
> I'll try to have a look before 3.0.5 gets out but I'm not sure yet I'll
> have time - I'll investigate either way
>
> Thanks, Sergey
> On 21/04/15 21:58, namdets wrote:
>> Sergey,
>>
>> Thanks for getting back to me!
>>
>> I tried setting the linkAnyMediaTypeToXmlSchema property on my
>> WadlGenerator
>> like so:
>>
>>
>>      <jaxrs:server id="services" address="/">
>>          <jaxrs:serviceBeans>
>>              <ref bean="companyRS"/>
>>          </jaxrs:serviceBeans>
>>          <jaxrs:providers>
>>              <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
>>                  <property name="linkAnyMediaTypeToXmlSchema"
>> value="true"/>
>>              </bean>
>>              <bean
>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>          </jaxrs:providers>
>>      </jaxrs:server>
>>
>> Unfortunately this did not resolve the issue, is this the correct way?
>>
>> Some additional information:
>>
>> My DTOs are marked with @XmlRootElement as this has been required in the
>> past to get any grammars included in the wadl for application/json media
>> types, but I have tried removing this also.
>>
>> The wadl generation is complete with grammars if I put my resource
>> methods
>> directly in the FooRS instead of(or in addition to) the AbstractRS
>> without
>> making any other changes.
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756379.html
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>


-- 
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com

Re: WADL Grammar section lost for generic service class.

Posted by Sergey Beryozkin <sb...@gmail.com>.
OK, may be something to do with figuring out what T is in List<T>, I 
thought it was all working fine after Francesco submitted few issues to 
do with the WADL auto-generation awhile back.
I'll try to have a look before 3.0.5 gets out but I'm not sure yet I'll 
have time - I'll investigate either way

Thanks, Sergey
On 21/04/15 21:58, namdets wrote:
> Sergey,
>
> Thanks for getting back to me!
>
> I tried setting the linkAnyMediaTypeToXmlSchema property on my WadlGenerator
> like so:
>
>
>      <jaxrs:server id="services" address="/">
>          <jaxrs:serviceBeans>
>              <ref bean="companyRS"/>
>          </jaxrs:serviceBeans>
>          <jaxrs:providers>
>              <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
>                  <property name="linkAnyMediaTypeToXmlSchema" value="true"/>
>              </bean>
>              <bean
> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>          </jaxrs:providers>
>      </jaxrs:server>
>
> Unfortunately this did not resolve the issue, is this the correct way?
>
> Some additional information:
>
> My DTOs are marked with @XmlRootElement as this has been required in the
> past to get any grammars included in the wadl for application/json media
> types, but I have tried removing this also.
>
> The wadl generation is complete with grammars if I put my resource methods
> directly in the FooRS instead of(or in addition to) the AbstractRS without
> making any other changes.
>
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756379.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: WADL Grammar section lost for generic service class.

Posted by namdets <na...@gmail.com>.
Sergey,

Thanks for getting back to me!

I tried setting the linkAnyMediaTypeToXmlSchema property on my WadlGenerator
like so:


    <jaxrs:server id="services" address="/">
        <jaxrs:serviceBeans>
            <ref bean="companyRS"/>
        </jaxrs:serviceBeans>
        <jaxrs:providers>
            <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
                <property name="linkAnyMediaTypeToXmlSchema" value="true"/>
            </bean>
            <bean
class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
        </jaxrs:providers>
    </jaxrs:server>

Unfortunately this did not resolve the issue, is this the correct way?

Some additional information: 

My DTOs are marked with @XmlRootElement as this has been required in the
past to get any grammars included in the wadl for application/json media
types, but I have tried removing this also. 

The wadl generation is complete with grammars if I put my resource methods
directly in the FooRS instead of(or in addition to) the AbstractRS without
making any other changes.







--
View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5756379.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: WADL Grammar section lost for generic service class.

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

Sorry for a delay.
It appears the grammar is not generated because you have 
"application/json" - set a WADLGenerator "linkAnyMediaTypeToXmlSchema" 
property.

That should do it...

Cheers, Sergey

On 09/04/15 22:28, namdets wrote:
> Additionally, the workaround of overriding the resource method in the
> subclass only to super.it() results in two copies of the method generated by
> the java2wadl maven plugin as well as in the http://endpoint?_wadl response.
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5755874.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: WADL Grammar section lost for generic service class.

Posted by namdets <na...@gmail.com>.
Additionally, the workaround of overriding the resource method in the
subclass only to super.it() results in two copies of the method generated by
the java2wadl maven plugin as well as in the http://endpoint?_wadl response.





--
View this message in context: http://cxf.547215.n5.nabble.com/WADL-Grammar-section-lost-for-generic-service-class-tp5755870p5755874.html
Sent from the cxf-user mailing list archive at Nabble.com.