-
Notifications
You must be signed in to change notification settings - Fork 90
Description
It should be possible to parse an array of objects even if the corresponding value in the dictionary is not an array. A use case is as follows: you parse xml that is designed to be an array but only has a single element. The xml parser has no knowledge of the array intention, and most will just parse this to a dictionary, not an array of one element. This library, however, can actually convert these properly with no additional configuration as it knows the target property is an array type. To clarify further with an example:
This json can be parsed into a user with an array of one tweet:
{
"name": "Diego Chohfi",
"tweets": [
{
"id_str": 190957570511478800,
"text": "Tweet text"
}
]
}
However, this too should be parseable as a user with an array of one tweet (provided you specify an array mapping for property "tweets" of course), but I don't see a way to do it currently:
{
"name": "Diego Chohfi",
"tweets":
{
"id_str": 190957570511478800,
"text": "Tweet text"
}
}