EclipseLink MOXy JSON Serialization
I have got a sample class: class Zoo { public Collection<? extends Animal> animals; } When serialized with MOXy, I am getting: { "bird": [ { "name": "bird-1", "wingSpan": "6 feets", "preferredFood": "food-1" } ], "cat": [ { "name": "cat-1", "favoriteToy": "toy-1" } ], "dog": [ { "name": "dog-1", "breed": "bread-1", "leashColor": "black" } ] } Why is it using array indicators "[]", while bird, cat, and dog are not arrays? Second, is there a way to get rid of "bird", "cat", and "dog"? In other words, I am trying to get to: { { "name": "bird-1", "wingSpan": "6 feets", "preferredFood": "food-1" }