Skip to content

Are inconsistencies in responses necessary? #1

@dancgray

Description

@dancgray

for example operations of post, get and put around the users endpoint return different results even thought they return a basic user model:

post and put: /api/user/ and /api/user/58f62ba204cf7bb30c8fa706 returns:
{
"_id": "58f62ba204cf7bb30c8fa706",
"email": "dan@example.com",
"failedLoginCount": 0,
"roles": [
"58edfb578c2f637307aef358"
],
"auth": "local",
"idNumber": "",
"_tenantId": "58edfb308c2f637307aef357",
"_isDeleted": false
}

get: /api/user/58f62ba204cf7bb30c8fa706 returns:
{
"_id": "58f62ba204cf7bb30c8fa706",
"email": "dan@example.com",
"failedLoginCount": 0,
"roles": [
{
"_id": "58edfb578c2f637307aef358",
"name": "Authenticated User"
}
],
"auth": "local",
"idNumber": "",
"_tenantId": {
"_id": "58edfb308c2f637307aef357",
"name": "master"
},
"_isDeleted": false
}

get /api/user/me returns:
{
"_isDeleted": false,
"_tenantId": "58edfb308c2f637307aef357",
"idNumber": "",
"auth": "local",
"roles": [
"58edfb578c2f637307aef35b"
],
"failedLoginCount": 0,
"password": "{hashed password}",
"lastAccess": "2017-04-18T14:46:04.035Z",
"invalidatePermissionCache": false,
"firstAccess": "1999-04-12T10:12:52.010Z",
"email": "dan@example.com",
"_id": "58edfb7c8c2f637307aef374",
"__v": 1,
"rolesAsName": [
"Super Admin"
]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions