tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: [ejb][restful] Customize JSON/XML generation
Date Wed, 03 Aug 2016 09:04:02 GMT
Not sure what means "keep my field ordering" since java doesn't keeps it
but you can set a comparator to sort attributes: attributeOrder

In tomee config it means defining in resources.xml:

<resources>
<Service id="johnzon" class-name="
org.apache.johnzon.jaxrs.ConfigurableJohnzonProvider">
attributeOrder = $order
</Service>
<Service id="order" class-name="com.company.MyAttributeComparator" />
</resources>
MyAttributeComparator is a Comparator<String>

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-08-03 9:09 GMT+02:00 gchauvet <gchauvet@zatarox.com>:

> another question about Jonhzon generation :
> How to force Jonhzon to keep my field ordering ?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ejb-restful-Customize-JSON-XML-generation-tp4679564p4679590.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message