You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using JettisonMappedXmlDriver driver for serializing with jettsion 1.5.4 version, it serialize array object as json object when array object contains only one element in it, if it contains more than 1 element it is serialized as array object
For example: here donneesFlexibles is a list and when it contains only one element it is serialized in response as object(like json object) instead of array object
'donneesFlexibles' contains single element and it is serialized as like json object by wrapping it with { } around single element (note: when it has more than 1 element, it is serialized as array)
When the same object serialized by JsonHierarchicalStreamDriver: -- here it has [ ] around single element which represent donneesFlexibles as array even if it contains only one element
While parsing this type of response, consumer may get typeError when expecting array but got object
May we know is there any reason for designing jettsion serialization this way ? It would be more meaningful if we represent the object structure as its data type irrespective of the number of elements in it.
The text was updated successfully, but these errors were encountered:
When using JettisonMappedXmlDriver driver for serializing with jettsion 1.5.4 version, it serialize array object as json object when array object contains only one element in it, if it contains more than 1 element it is serialized as array object
For example: here donneesFlexibles is a list and when it contains only one element it is serialized in response as object(like json object) instead of array object
'donneesFlexibles' contains single element and it is serialized as like json object by wrapping it with { } around single element (note: when it has more than 1 element, it is serialized as array)
When the same object serialized by JsonHierarchicalStreamDriver: -- here it has [ ] around single element which represent donneesFlexibles as array even if it contains only one element
While parsing this type of response, consumer may get typeError when expecting array but got object
May we know is there any reason for designing jettsion serialization this way ? It would be more meaningful if we represent the object structure as its data type irrespective of the number of elements in it.
The text was updated successfully, but these errors were encountered: