in order to uniquely identify a associated_users
on must traverse the object graph into the onsite
object and construct an artificial key.
it makes more sense to either flatten the structure or, more appropriately in my opinion, simply use a site key instead of duplicating data that, if desired, can be pulled from the /sites
route.
this is an example of where a decent site key would come in handy, but if, as insisted, a mixed case string with, currently, spaces and who knows what else in the future, is what we have for a key then please surface that on the result.
the current structure is unnatural and the nested object graph complicates consumption unnecessarily.
{
"associated_users": [
{
"user_id": 242897,
"user_type": "registered",
"display_name": "code poet",
"reputation": 9272,
"on_site": {
"name": "Stack Overflow",
"logo_url": "http://sstatic.net/so/img/logo.png",
"api_endpoint": "http://api.stackoverflow.com",
"site_url": "http://stackoverflow.com",
"description": "Q&A for programmers",
"icon_url": "http://sstatic.net/so/apple-touch-icon.png"
},
"email_hash": "df4a7fbd8a054fd6193ca0ee62952f1f"
},
{
"user_id": 38306,
"user_type": "registered",
"display_name": "code poet",
"reputation": 111,
"on_site": {
"name": "Server Fault",
"logo_url": "http://sstatic.net/sf/img/logo.png",
"api_endpoint": "http://api.serverfault.com",
"site_url": "http://serverfault.com",
"description": "Q&A for system administrators and IT professionals",
"icon_url": "http://sstatic.net/sf/apple-touch-icon.png"
},
"email_hash": "df4a7fbd8a054fd6193ca0ee62952f1f"
},
{
"user_id": 31747,
"user_type": "registered",
"display_name": "code poet",
"reputation": 100,
"on_site": {
"name": "Super User",
"logo_url": "http://sstatic.net/su/img/logo.png",
"api_endpoint": "http://api.superuser.com",
"site_url": "http://superuser.com",
"description": "Q&A for computer enthusiasts and power users",
"icon_url": "http://sstatic.net/su/apple-touch-icon.png"
},
"email_hash": "df4a7fbd8a054fd6193ca0ee62952f1f"
},
{
"user_id": 144906,
"user_type": "registered",
"display_name": "code poet",
"reputation": 1252,
"on_site": {
"name": "Stack Overflow Meta",
"logo_url": "http://sstatic.net/mso/img/logo.png",
"api_endpoint": "http://api.meta.stackoverflow.com",
"site_url": "http://meta.stackoverflow.com",
"description": "Q&A about Stack Overflow, Server Fault, and Super User",
"icon_url": "http://sstatic.net/mso/apple-touch-icon.png"
},
"email_hash": "df4a7fbd8a054fd6193ca0ee62952f1f"
},
{
"user_id": 14,
"user_type": "registered",
"display_name": "code poet",
"reputation": 3123,
"email_hash": "df4a7fbd8a054fd6193ca0ee62952f1f"
}
]
}