|
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 > > |