conclusion
a very short dialog with systempunotout showed me that I could look at this another way that makes a nested structure make perfect sense.
the q remains for reference.
This should be flattened. there is no chance that there will be an array of badge counts and the structure represents a 1 to 1.
It unnecessarily complicates deserialization and/or necessitates an additional class.
it should be flattened.
"user_mentioned_url": "/users/22656/mentioned",
"user_comments_url": "/users/22656/comments",
"user_reputation_url": "/users/22656/reputation",
"badge_counts": {
"gold": 37,
"silver": 679,
"bronze": 1277
}
},
responses
to koning - not sure how you come to that conclusion...
245 bytes:
"user_mentioned_url": "/users/22656/mentioned",
"user_comments_url": "/users/22656/comments",
"user_reputation_url": "/users/22656/reputation",
"badge_counts": {
"gold": 37,
"silver": 679,
"bronze": 1277
}
},
236 bytes:
"user_mentioned_url": "/users/22656/mentioned",
"user_comments_url": "/users/22656/comments",
"user_reputation_url": "/users/22656/reputation",
"gold_badges": 37,
"silver_badges": 679,
"bronze_badges": 1277,
},
the difference is greater if the results are not pretty printed.
What is the benefit of nesting this information? I am having a hard time seeing it. It is artificial and adds complexity.
badge_counts
and that that'll be the only place badge data is in.