jettison-json / jettison

Apache License 2.0
46 stars 28 forks source link

List problem in MappedXMLStreamWriter #10

Open sberyozkin opened 9 years ago

sberyozkin commented 9 years ago

List results = new ArrayList(); results.add("aaa"); results.add(1L); results.add("bbb"); results.add(2L);

expected result: {"result":{"list":[ {"string":"aaa","long":1,"string":"bbb","long":2}

]}} but actual: {"result":{"list":[ {"string":["aaa","bbb"],"long":[1,2]}

]}}

Jettison seems to auto-merge the elements with same type, which saves space, but is incorrect behaviour. The order of a list is important and needs to be kept.

cdokolas commented 6 days ago

I must say, this is an important issue!

Has anyone located the related code?