Re: PropertyOrderStrategy does not when POJO uses @JsonbProperty

Dmitry Kornilov
 

Hi,

PropertyOrderStrategy.ANY doesn’t guarantee that properties will be serialised using natural order as they appear in your Java class. It guarantees that no sorting will be applied which may give you a little performance boost.

Thanks,
Dmitry

On 26 Jul 2018, at 09:33, Jocafi <joccaraujo@...> wrote:

Hi All,

  this is my first post. I read the json-b documentation at http://json-b.net/users-guide.html and made some unit test to convert the fields of a POJO in the same order they are displayed in the POJO.

I could create the jsonb using different PropertyOrderStrategy , however it does not work when I add the @JsonbProperty to one of the fields of my POJO. It works fine without this annotation.  

Am I doing something wrong or is it a bug ?

Thanks.

Best Regards,
Jocafi

JsonbConfig config = new JsonbConfig()
.withPropertyOrderStrategy(PropertyOrderStrategy.ANY);

Jsonb jsonb = JsonbBuilder.create(config);



Join jsonb-spec@javaee.groups.io to automatically receive all group messages.