I have a user with two identities: GitHub and Google.
When I make a request for a list of users (GET /api/v2/users), response looks like (removed unimportant fields):
[
{
...
"identities": [
{
"provider": "github",
"user_id": "123456"
},
{
"provider": "google-oauth2",
"user_id": "110315005260569123456"
}
],
"user_id": "github|123456"
}
]
Notice that both identities have user_id as a string.
When I make a request for a specific users (GET /api/v2/users/), response looks like (removed unimportant fields):
{
...
"identities": [
{
"provider": "github",
"user_id": 123456
},
{
"provider": "google-oauth2",
"user_id": "110315005260569123456"
}
],
"user_id": "github|123456"
}
Notice that this time github identity’s user_id is a number, while google identity still have a string.
It looks like a bug and introduces a few problems:
- essentially the same data is inconsistent between two endpoints
- data schema is inconsistent between two identities in the same response
Both of these create problems using this data, particularly in a strong typed languages (eg. Go).