Skip to content
Advertisement

Why is Jackson using the wrong element name when serializing?

I have a Object that I would like Jackson to serialize like this…

JavaScript

To try this I create the following class…

JavaScript

But when I serialize I get…

JavaScript

As you can see the problem here is the child tags should be account but in fact are accounts. I tried hacking around with the localname but can’t find the right mixture of VooDoo. What am I doing wrong?

Advertisement

Answer

I would change annotations on account list in AccountsResponse:

JavaScript
Advertisement