|
From: Michael P. <mpa...@re...> - 2012-10-21 07:44:44
|
Hi, Is there any way making jackson-provider using @XmlElement names rather than field's? -- Michael Pasternak RedHat, ENG-Virtualization R&D |
|
From: Weinan L. <we...@re...> - 2012-10-21 08:24:10
|
Hi Michael, Could you please provide more details on your requirements? -- Weinan Li JBoss, Red Hat On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: > > Hi, > > Is there any way making jackson-provider using @XmlElement names > rather than field's? > > -- > > Michael Pasternak > RedHat, ENG-Virtualization R&D > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Resteasy-developers mailing list > Res...@li... (mailto:Res...@li...) > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |
|
From: Michael P. <mpa...@re...> - 2012-10-21 08:38:29
|
Hi Weinan,
On 10/21/2012 10:23 AM, Weinan Li wrote:
> Hi Michael,
>
> Could you please provide more details on your requirements?
We model our api in the xsd, then generating java code from it,
the problem is when we create java from the schema, jaxb using java naming
convention when creating fields, but applying @XmlElement annotations to
preserve the original names, later when:
- xml generated, it uses @XmlElement annotation names
- when json generated it uses field names
what is creating naming inconsistency between xml and json representations.
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>${resteasy.version}</version>
<resteasy.version>2.3.2.Final</resteasy.version>
<maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version>
>
> --
> Weinan Li
> JBoss, Red Hat
>
> On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote:
>
>>
>> Hi,
>>
>> Is there any way making jackson-provider using @XmlElement names
>> rather than field's?
>>
>> --
>>
>> Michael Pasternak
>> RedHat, ENG-Virtualization R&D
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li... <mailto:Res...@li...>
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
--
Michael Pasternak
RedHat, ENG-Virtualization R&D
|
|
From: Weinan L. <we...@re...> - 2012-10-21 08:43:11
|
--
Weinan Li
JBoss, Red Hat
On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote:
>
> Hi Weinan,
>
> On 10/21/2012 10:23 AM, Weinan Li wrote:
> > Hi Michael,
> >
> > Could you please provide more details on your requirements?
>
> We model our api in the xsd, then generating java code from it,
> the problem is when we create java from the schema, jaxb using java naming
> convention when creating fields, but applying @XmlElement annotations to
> preserve the original names, later when:
>
> - xml generated, it uses @XmlElement annotation names
> - when json generated it uses field names
>
> what is creating naming inconsistency between xml and json representations.
>
> <dependency>
> <groupId>org.jboss.resteasy</groupId>
> <artifactId>resteasy-jackson-provider</artifactId>
> <version>${resteasy.version}</version>
>
>
Think I understand your meaning this time :-) I'll try it and give you feedback soon.
>
>
> <resteasy.version>2.3.2.Final</resteasy.version>
> <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version>
>
>
> >
> > --
> > Weinan Li
> > JBoss, Red Hat
> >
> > On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote:
> >
> > >
> > > Hi,
> > >
> > > Is there any way making jackson-provider using @XmlElement names
> > > rather than field's?
> > >
> > > --
> > >
> > > Michael Pasternak
> > > RedHat, ENG-Virtualization R&D
> > >
> > > ------------------------------------------------------------------------------
> > > Everyone hates slow websites. So do we.
> > > Make your web apps faster with AppDynamics
> > > Download AppDynamics Lite for free today:
> > > http://p.sf.net/sfu/appdyn_sfd2d_oct
> > > _______________________________________________
> > > Resteasy-developers mailing list
> > > Res...@li... <mailto:Res...@li...>
> > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers
> > >
> >
> >
>
>
>
> --
>
> Michael Pasternak
> RedHat, ENG-Virtualization R&D
>
>
|
|
From: Michael P. <mpa...@re...> - 2012-10-22 10:08:21
|
Hey Weinan,
do you have any news on this?
On 10/21/2012 10:42 AM, Weinan Li wrote:
>
>
> --
> Weinan Li
> JBoss, Red Hat
>
> On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote:
>
>>
>> Hi Weinan,
>>
>> On 10/21/2012 10:23 AM, Weinan Li wrote:
>>> Hi Michael,
>>>
>>> Could you please provide more details on your requirements?
>>
>> We model our api in the xsd, then generating java code from it,
>> the problem is when we create java from the schema, jaxb using java naming
>> convention when creating fields, but applying @XmlElement annotations to
>> preserve the original names, later when:
>>
>> - xml generated, it uses @XmlElement annotation names
>> - when json generated it uses field names
>>
>> what is creating naming inconsistency between xml and json representations.
>>
>> <dependency>
>> <groupId>org.jboss.resteasy</groupId>
>> <artifactId>resteasy-jackson-provider</artifactId>
>> <version>${resteasy.version}</version>
>
> Think I understand your meaning this time :-) I'll try it and give you feedback soon.
>>
>>
>> <resteasy.version>2.3.2.Final</resteasy.version>
>> <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version>
>>
>>
>>>
>>> --
>>> Weinan Li
>>> JBoss, Red Hat
>>>
>>> On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> Is there any way making jackson-provider using @XmlElement names
>>>> rather than field's?
>>>>
>>>> --
>>>>
>>>> Michael Pasternak
>>>> RedHat, ENG-Virtualization R&D
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:
>>>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>>>> _______________________________________________
>>>> Resteasy-developers mailing list
>>>> Res...@li... <mailto:Res...@li...>
>>>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>
>>
>> --
>>
>> Michael Pasternak
>> RedHat, ENG-Virtualization R&D
>
--
Michael Pasternak
RedHat, ENG-Virtualization R&D
|
|
From: Michael P. <mpa...@re...> - 2012-10-22 12:09:31
|
I see that some work already has been done on this, http://wiki.fasterxml.com/JacksonJAXBAnnotations http://jira.codehaus.org/browse/JACKSON-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel On 10/21/2012 10:42 AM, Weinan Li wrote: > > > -- > Weinan Li > JBoss, Red Hat > > On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote: > >> >> Hi Weinan, >> >> On 10/21/2012 10:23 AM, Weinan Li wrote: >>> Hi Michael, >>> >>> Could you please provide more details on your requirements? >> >> We model our api in the xsd, then generating java code from it, >> the problem is when we create java from the schema, jaxb using java naming >> convention when creating fields, but applying @XmlElement annotations to >> preserve the original names, later when: >> >> - xml generated, it uses @XmlElement annotation names >> - when json generated it uses field names >> >> what is creating naming inconsistency between xml and json representations. >> >> <dependency> >> <groupId>org.jboss.resteasy</groupId> >> <artifactId>resteasy-jackson-provider</artifactId> >> <version>${resteasy.version}</version> > > Think I understand your meaning this time :-) I'll try it and give you feedback soon. >> >> >> <resteasy.version>2.3.2.Final</resteasy.version> >> <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version> >> >> >>> >>> -- >>> Weinan Li >>> JBoss, Red Hat >>> >>> On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: >>> >>>> >>>> Hi, >>>> >>>> Is there any way making jackson-provider using @XmlElement names >>>> rather than field's? >>>> >>>> -- >>>> >>>> Michael Pasternak >>>> RedHat, ENG-Virtualization R&D >>>> >>>> ------------------------------------------------------------------------------ >>>> Everyone hates slow websites. So do we. >>>> Make your web apps faster with AppDynamics >>>> Download AppDynamics Lite for free today: >>>> http://p.sf.net/sfu/appdyn_sfd2d_oct >>>> _______________________________________________ >>>> Resteasy-developers mailing list >>>> Res...@li... <mailto:Res...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >> >> >> -- >> >> Michael Pasternak >> RedHat, ENG-Virtualization R&D > -- Michael Pasternak RedHat, ENG-Virtualization R&D |
|
From: Weinan L. <we...@re...> - 2012-10-22 13:10:31
|
Thanks for this important information Michael :-) As Jackson is working on this, seems we could wait upstream to provide the function so RESTEasy could use it later. Seems not much I can do here, if there are any other issues need help please send email to us. -- Weinan Li JBoss, Red Hat On Monday, October 22, 2012 at 8:12 PM, Michael Pasternak wrote: > > > I see that some work already has been done on this, > > http://wiki.fasterxml.com/JacksonJAXBAnnotations > http://jira.codehaus.org/browse/JACKSON-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel > > On 10/21/2012 10:42 AM, Weinan Li wrote: > > > > > > -- > > Weinan Li > > JBoss, Red Hat > > > > On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote: > > > > > > > > Hi Weinan, > > > > > > On 10/21/2012 10:23 AM, Weinan Li wrote: > > > > Hi Michael, > > > > > > > > Could you please provide more details on your requirements? > > > > > > We model our api in the xsd, then generating java code from it, > > > the problem is when we create java from the schema, jaxb using java naming > > > convention when creating fields, but applying @XmlElement annotations to > > > preserve the original names, later when: > > > > > > - xml generated, it uses @XmlElement annotation names > > > - when json generated it uses field names > > > > > > what is creating naming inconsistency between xml and json representations. > > > > > > <dependency> > > > <groupId>org.jboss.resteasy</groupId> > > > <artifactId>resteasy-jackson-provider</artifactId> > > > <version>${resteasy.version}</version> > > > > > > > > > Think I understand your meaning this time :-) I'll try it and give you feedback soon. > > > > > > > > > <resteasy.version>2.3.2.Final</resteasy.version> > > > <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version> > > > > > > > > > > > > > > -- > > > > Weinan Li > > > > JBoss, Red Hat > > > > > > > > On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: > > > > > > > > > > > > > > Hi, > > > > > > > > > > Is there any way making jackson-provider using @XmlElement names > > > > > rather than field's? > > > > > > > > > > -- > > > > > > > > > > Michael Pasternak > > > > > RedHat, ENG-Virtualization R&D > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > Everyone hates slow websites. So do we. > > > > > Make your web apps faster with AppDynamics > > > > > Download AppDynamics Lite for free today: > > > > > http://p.sf.net/sfu/appdyn_sfd2d_oct > > > > > _______________________________________________ > > > > > Resteasy-developers mailing list > > > > > Res...@li... <mailto:Res...@li...> > > > > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Michael Pasternak > > > RedHat, ENG-Virtualization R&D > > > > > > > > > > > -- > > Michael Pasternak > RedHat, ENG-Virtualization R&D > > |
|
From: Weinan L. <we...@re...> - 2012-10-22 13:15:33
|
Haven't looked this before. I'll check it soon. Let me find if we could have some work around in RESTEasy for your issue firstly. -- Weinan Li JBoss, Red Hat On Monday, October 22, 2012 at 9:15 PM, Michael Pasternak wrote: > > do you familiar with this? > > https://bugzilla.redhat.com/show_bug.cgi?id=857137 > > On 10/22/2012 03:10 PM, Weinan Li wrote: > > Thanks for this important information Michael :-) As Jackson is working on this, seems we could wait upstream to provide the function so RESTEasy could use it later. Seems > > not much I can do here, if there are any other issues need help please send email to us. > > -- > > Weinan Li > > JBoss, Red Hat > > > > On Monday, October 22, 2012 at 8:12 PM, Michael Pasternak wrote: > > > > > > > > > > > I see that some work already has been done on this, > > > > > > http://wiki.fasterxml.com/JacksonJAXBAnnotations > > > http://jira.codehaus.org/browse/JACKSON-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel > > > > > > On 10/21/2012 10:42 AM, Weinan Li wrote: > > > > > > > > > > > > -- > > > > Weinan Li > > > > JBoss, Red Hat > > > > > > > > On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote: > > > > > > > > > > > > > > Hi Weinan, > > > > > > > > > > On 10/21/2012 10:23 AM, Weinan Li wrote: > > > > > > Hi Michael, > > > > > > > > > > > > Could you please provide more details on your requirements? > > > > > > > > > > We model our api in the xsd, then generating java code from it, > > > > > the problem is when we create java from the schema, jaxb using java naming > > > > > convention when creating fields, but applying @XmlElement annotations to > > > > > preserve the original names, later when: > > > > > > > > > > - xml generated, it uses @XmlElement annotation names > > > > > - when json generated it uses field names > > > > > > > > > > what is creating naming inconsistency between xml and json representations. > > > > > > > > > > <dependency> > > > > > <groupId>org.jboss.resteasy</groupId> > > > > > <artifactId>resteasy-jackson-provider</artifactId> > > > > > <version>${resteasy.version}</version> > > > > > > > > > > > > > > > > > Think I understand your meaning this time :-) I'll try it and give you feedback soon. > > > > > > > > > > > > > > > <resteasy.version>2.3.2.Final</resteasy.version> > > > > > <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version> > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Weinan Li > > > > > > JBoss, Red Hat > > > > > > > > > > > > On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: > > > > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > Is there any way making jackson-provider using @XmlElement names > > > > > > > rather than field's? > > > > > > > > > > > > > > -- > > > > > > > > > > > > > > Michael Pasternak > > > > > > > RedHat, ENG-Virtualization R&D > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > > > Everyone hates slow websites. So do we. > > > > > > > Make your web apps faster with AppDynamics > > > > > > > Download AppDynamics Lite for free today: > > > > > > > http://p.sf.net/sfu/appdyn_sfd2d_oct > > > > > > > _______________________________________________ > > > > > > > Resteasy-developers mailing list > > > > > > > Res...@li... <mailto:Res...@li...> > > > > > > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > Michael Pasternak > > > > > RedHat, ENG-Virtualization R&D > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Michael Pasternak > > > RedHat, ENG-Virtualization R&D > > > > > > > > > > > -- > > Michael Pasternak > RedHat, ENG-Virtualization R&D > > |
|
From: Bill B. <bb...@re...> - 2012-10-22 13:57:02
|
I haven't used the Jackson + JAXB support yet, so I don't know. On 10/21/2012 3:47 AM, Michael Pasternak wrote: > > Hi, > > Is there any way making jackson-provider using @XmlElement names > rather than field's? > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Weinan L. <we...@re...> - 2012-10-30 15:21:15
|
Hi Michael, Sorry for the long delay on this issue as I'm busy on some other issues these day. I've reproduced your problem with following code: https://gist.github.com/3980877 Currently RESTEasy doesn't have a Jackson+JAXB provider, but I think it won't be difficult to create one. I'll report my progress on this. btw, could you please help to create an JIRA issue for this one: https://issues.jboss.org/browse/RESTEASY Thanks! -- Weinan Li JBoss, Red Hat On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote: > > Hi Weinan, > > On 10/21/2012 10:23 AM, Weinan Li wrote: > > Hi Michael, > > > > Could you please provide more details on your requirements? > > We model our api in the xsd, then generating java code from it, > the problem is when we create java from the schema, jaxb using java naming > convention when creating fields, but applying @XmlElement annotations to > preserve the original names, later when: > > - xml generated, it uses @XmlElement annotation names > - when json generated it uses field names > > what is creating naming inconsistency between xml and json representations. > > <dependency> > <groupId>org.jboss.resteasy</groupId> > <artifactId>resteasy-jackson-provider</artifactId> > <version>${resteasy.version}</version> > > > <resteasy.version>2.3.2.Final</resteasy.version> > <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version> > > > > > > -- > > Weinan Li > > JBoss, Red Hat > > > > On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: > > > > > > > > Hi, > > > > > > Is there any way making jackson-provider using @XmlElement names > > > rather than field's? > > > > > > -- > > > > > > Michael Pasternak > > > RedHat, ENG-Virtualization R&D > > > > > > ------------------------------------------------------------------------------ > > > Everyone hates slow websites. So do we. > > > Make your web apps faster with AppDynamics > > > Download AppDynamics Lite for free today: > > > http://p.sf.net/sfu/appdyn_sfd2d_oct > > > _______________________________________________ > > > Resteasy-developers mailing list > > > Res...@li... <mailto:Res...@li...> > > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > > > > > > > -- > > Michael Pasternak > RedHat, ENG-Virtualization R&D > > |
|
From: Weinan L. <we...@re...> - 2012-10-31 02:19:49
|
Hi Michael, I've created a showcase that could fulfill your request, could you please give a try: git clone git://github.com/liweinan/try-resteasy.git git checkout -b jackson remotes/origin/jackson In TestXmlResource.java I could marshal JAXB annotated class correctly using Jackson's JAXB module: ... ObjectMapper mapper = new ObjectMapper(); mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector()); … I could add this support to RESTEasy's Jackson provider by patching ResteasyJacksonProvider. I'll let you know my progress. -- Weinan Li JBoss, Red Hat On Tuesday, October 30, 2012 at 11:20 PM, Weinan Li wrote: > Hi Michael, > > Sorry for the long delay on this issue as I'm busy on some other issues these day. I've reproduced your problem with following code: > > https://gist.github.com/3980877 > > Currently RESTEasy doesn't have a Jackson+JAXB provider, but I think it won't be difficult to create one. I'll report my progress on this. btw, could you please help to create an JIRA issue for this one: https://issues.jboss.org/browse/RESTEASY > > Thanks! > > -- > Weinan Li > JBoss, Red Hat > > > On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote: > > > > > Hi Weinan, > > > > On 10/21/2012 10:23 AM, Weinan Li wrote: > > > Hi Michael, > > > > > > Could you please provide more details on your requirements? > > > > We model our api in the xsd, then generating java code from it, > > the problem is when we create java from the schema, jaxb using java naming > > convention when creating fields, but applying @XmlElement annotations to > > preserve the original names, later when: > > > > - xml generated, it uses @XmlElement annotation names > > - when json generated it uses field names > > > > what is creating naming inconsistency between xml and json representations. > > > > <dependency> > > <groupId>org.jboss.resteasy</groupId> > > <artifactId>resteasy-jackson-provider</artifactId> > > <version>${resteasy.version}</version> > > > > > > <resteasy.version>2.3.2.Final</resteasy.version> > > <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version> > > > > > > > > > > -- > > > Weinan Li > > > JBoss, Red Hat > > > > > > On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: > > > > > > > > > > > Hi, > > > > > > > > Is there any way making jackson-provider using @XmlElement names > > > > rather than field's? > > > > > > > > -- > > > > > > > > Michael Pasternak > > > > RedHat, ENG-Virtualization R&D > > > > > > > > ------------------------------------------------------------------------------ > > > > Everyone hates slow websites. So do we. > > > > Make your web apps faster with AppDynamics > > > > Download AppDynamics Lite for free today: > > > > http://p.sf.net/sfu/appdyn_sfd2d_oct > > > > _______________________________________________ > > > > Resteasy-developers mailing list > > > > Res...@li... (mailto:Res...@li...) <mailto:Res...@li...> > > > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > > > > > > > > > > > > > > -- > > > > Michael Pasternak > > RedHat, ENG-Virtualization R&D > > > > > > > > |
|
From: Weinan L. <we...@re...> - 2012-10-31 09:42:52
|
I've created RESTEasy-795 And here is the patch: https://github.com/liweinan/Resteasy/compare/resteasy:Branch_2_3...liweinan:RESTEASY-795 I've added test cases in this patch and seems now RESTEasy Jackson provider could handle JAXB annotations correctly. I'll request this patch to be pulled in Branch_2_3 and trunk. -- Weinan Li JBoss, Red Hat On Wednesday, October 31, 2012 at 10:19 AM, Weinan Li wrote: > Hi Michael, > > I've created a showcase that could fulfill your request, could you please give a try: > > > git clone git://github.com/liweinan/try-resteasy.git (http://github.com/liweinan/try-resteasy.git) > > git checkout -b jackson remotes/origin/jackson > > In TestXmlResource.java I could marshal JAXB annotated class correctly using Jackson's JAXB module: > > ... > ObjectMapper mapper = new ObjectMapper(); > mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector()); > … > > I could add this support to RESTEasy's Jackson provider by patching ResteasyJacksonProvider. I'll let you know my progress. > > > -- > Weinan Li > JBoss, Red Hat > > > On Tuesday, October 30, 2012 at 11:20 PM, Weinan Li wrote: > > > Hi Michael, > > > > Sorry for the long delay on this issue as I'm busy on some other issues these day. I've reproduced your problem with following code: > > > > https://gist.github.com/3980877 > > > > Currently RESTEasy doesn't have a Jackson+JAXB provider, but I think it won't be difficult to create one. I'll report my progress on this. btw, could you please help to create an JIRA issue for this one: https://issues.jboss.org/browse/RESTEASY > > > > Thanks! > > > > -- > > Weinan Li > > JBoss, Red Hat > > > > > > On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote: > > > > > > > > Hi Weinan, > > > > > > On 10/21/2012 10:23 AM, Weinan Li wrote: > > > > Hi Michael, > > > > > > > > Could you please provide more details on your requirements? > > > > > > We model our api in the xsd, then generating java code from it, > > > the problem is when we create java from the schema, jaxb using java naming > > > convention when creating fields, but applying @XmlElement annotations to > > > preserve the original names, later when: > > > > > > - xml generated, it uses @XmlElement annotation names > > > - when json generated it uses field names > > > > > > what is creating naming inconsistency between xml and json representations. > > > > > > <dependency> > > > <groupId>org.jboss.resteasy</groupId> > > > <artifactId>resteasy-jackson-provider</artifactId> > > > <version>${resteasy.version}</version> > > > > > > > > > <resteasy.version>2.3.2.Final</resteasy.version> > > > <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version> > > > > > > > > > > > > > > -- > > > > Weinan Li > > > > JBoss, Red Hat > > > > > > > > On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: > > > > > > > > > > > > > > Hi, > > > > > > > > > > Is there any way making jackson-provider using @XmlElement names > > > > > rather than field's? > > > > > > > > > > -- > > > > > > > > > > Michael Pasternak > > > > > RedHat, ENG-Virtualization R&D > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > Everyone hates slow websites. So do we. > > > > > Make your web apps faster with AppDynamics > > > > > Download AppDynamics Lite for free today: > > > > > http://p.sf.net/sfu/appdyn_sfd2d_oct > > > > > _______________________________________________ > > > > > Resteasy-developers mailing list > > > > > Res...@li... (mailto:Res...@li...) <mailto:Res...@li...> > > > > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Michael Pasternak > > > RedHat, ENG-Virtualization R&D > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... (mailto:Res...@li...) > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |
|
From: Michael P. <mpa...@re...> - 2012-10-31 09:50:29
|
thanks a lot Weinan. On 10/31/2012 11:42 AM, Weinan Li wrote: > I've created RESTEasy-795 > > And here is the patch: https://github.com/liweinan/Resteasy/compare/resteasy:Branch_2_3...liweinan:RESTEASY-795 > > I've added test cases in this patch and seems now RESTEasy Jackson provider could handle JAXB annotations correctly. I'll request this patch to be pulled in Branch_2_3 and > trunk. > > -- > Weinan Li > JBoss, Red Hat > > On Wednesday, October 31, 2012 at 10:19 AM, Weinan Li wrote: > >> Hi Michael, >> >> I've created a showcase that could fulfill your request, could you please give a try: >> >> >> git clone git://github.com/liweinan/try-resteasy.git <http://github.com/liweinan/try-resteasy.git> >> >> git checkout -b jackson remotes/origin/jackson >> >> In TestXmlResource.java I could marshal JAXB annotated class correctly using Jackson's JAXB module: >> >> ... >> ObjectMapper mapper = new ObjectMapper(); >> mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector()); >> … >> >> I could add this support to RESTEasy's Jackson provider by patching ResteasyJacksonProvider. I'll let you know my progress. >> >> >> -- >> Weinan Li >> JBoss, Red Hat >> >> On Tuesday, October 30, 2012 at 11:20 PM, Weinan Li wrote: >> >>> Hi Michael, >>> >>> Sorry for the long delay on this issue as I'm busy on some other issues these day. I've reproduced your problem with following code: >>> >>> https://gist.github.com/3980877 >>> >>> Currently RESTEasy doesn't have a Jackson+JAXB provider, but I think it won't be difficult to create one. I'll report my progress on this. btw, could you please help to >>> create an JIRA issue for this one: https://issues.jboss.org/browse/RESTEASY >>> Thanks! >>> >>> -- >>> Weinan Li >>> JBoss, Red Hat >>> >>> On Sunday, October 21, 2012 at 4:41 PM, Michael Pasternak wrote: >>> >>>> >>>> Hi Weinan, >>>> >>>> On 10/21/2012 10:23 AM, Weinan Li wrote: >>>>> Hi Michael, >>>>> >>>>> Could you please provide more details on your requirements? >>>> >>>> We model our api in the xsd, then generating java code from it, >>>> the problem is when we create java from the schema, jaxb using java naming >>>> convention when creating fields, but applying @XmlElement annotations to >>>> preserve the original names, later when: >>>> >>>> - xml generated, it uses @XmlElement annotation names >>>> - when json generated it uses field names >>>> >>>> what is creating naming inconsistency between xml and json representations. >>>> >>>> <dependency> >>>> <groupId>org.jboss.resteasy</groupId> >>>> <artifactId>resteasy-jackson-provider</artifactId> >>>> <version>${resteasy.version}</version> >>>> >>>> >>>> <resteasy.version>2.3.2.Final</resteasy.version> >>>> <maven-jaxb22-plugin.version>0.8.1</maven-jaxb22-plugin.version> >>>> >>>> >>>>> >>>>> -- >>>>> Weinan Li >>>>> JBoss, Red Hat >>>>> >>>>> On Sunday, October 21, 2012 at 3:47 PM, Michael Pasternak wrote: >>>>> >>>>>> >>>>>> Hi, >>>>>> >>>>>> Is there any way making jackson-provider using @XmlElement names >>>>>> rather than field's? >>>>>> >>>>>> -- >>>>>> >>>>>> Michael Pasternak >>>>>> RedHat, ENG-Virtualization R&D >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Everyone hates slow websites. So do we. >>>>>> Make your web apps faster with AppDynamics >>>>>> Download AppDynamics Lite for free today: >>>>>> http://p.sf.net/sfu/appdyn_sfd2d_oct >>>>>> _______________________________________________ >>>>>> Resteasy-developers mailing list >>>>>> Res...@li... <mailto:Res...@li...> <mailto:Res...@li...> >>>>>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >>>> >>>> >>>> -- >>>> >>>> Michael Pasternak >>>> RedHat, ENG-Virtualization R&D >>> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_sfd2d_oct >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... <mailto:Res...@li...> >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Michael Pasternak RedHat, ENG-Virtualization R&D |