• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not happy with JAX-RS JSON and XML output for List

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I have created a class that has a list of Address. I have defined the class as follows:



With this I get valid JSON, however I am not happy with the XML output. The JSON is as follows:





For me the above JSON is correct as it reads "an array of addresses". How the XML feels wrong. It would need either to be or I opted to go with he latter and updated my code as follows:



This gives me the following:





The XML feels ok now as addresses is a a list of address. However the JSON is now "address" is a list of "address".

Does anyone know how to solve this one out? I use CXF not sure if that changes anything.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic