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
A JSON string can contain multiple objects, usually this is indicated with [ ]. The JSON string itself will be treated as an array when easygson tries to read it. But sometimes there is also a JSON string with only 1 object in it. The [ ] are not in in the JSON string to indicate that it is an array, because it is only 1 object.
Is there maybe a way to treat a single object as an array? Now I have to treat the JSON string differently, depending on whether it is an array or single object.
In Jackson there is a way to configure the objectMapper with the following value: "ACCEPT_SINGLE_VALUE_AS_ARRAY". Now it treats also a single object as an array.
The text was updated successfully, but these errors were encountered:
A JSON string can contain multiple objects, usually this is indicated with [ ]. The JSON string itself will be treated as an array when easygson tries to read it. But sometimes there is also a JSON string with only 1 object in it. The [ ] are not in in the JSON string to indicate that it is an array, because it is only 1 object.
Is there maybe a way to treat a single object as an array? Now I have to treat the JSON string differently, depending on whether it is an array or single object.
In Jackson there is a way to configure the objectMapper with the following value: "ACCEPT_SINGLE_VALUE_AS_ARRAY". Now it treats also a single object as an array.
The text was updated successfully, but these errors were encountered: