Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single object als array #4

Closed
Pullse opened this issue Feb 19, 2014 · 0 comments
Closed

Single object als array #4

Pullse opened this issue Feb 19, 2014 · 0 comments
Assignees
Milestone

Comments

@Pullse
Copy link

Pullse commented Feb 19, 2014

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.

@robert-bor robert-bor self-assigned this Feb 25, 2014
@robert-bor robert-bor added this to the 1.3.0 milestone Feb 25, 2014
robert-bor added a commit that referenced this issue Feb 25, 2014
…eworks return single instances as value and multiple instances as arrays. Also added a removeMe method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants