voceconnect/thermal-api

Standardise User output

Sammaye opened this issue · 1 comments

I have noticed extremely large differences between the result for one user and the result for many.

Both are also missing many fields, i.e. my authors have an about field which should be in the result.

However, getting back to the point, here is the result for one user without query for ID:

{
    "data":{
        "ID":"7",
        "user_login":"lalalala",
        "user_pass":"$P$xxxxxx",
        "user_nicename":"lalalala",
        "user_email":"lalala@x.x.x",
        "user_url":"http:\/\/www.x.x",
        "user_registered":"2006-01-07 09:09:01",
        "user_activation_key":"",
        "user_status":"0",
        "display_name":"Cheese"
    },
    "ID":7,
    "caps":{
        "author":"1"
    },
    "cap_key":"wp_capabilities",
    "roles":[
        "author"
    ],
    "allcaps":{
        "upload_files":true,
        "edit_posts":true,
        "edit_published_posts":true,
        "publish_posts":true,
        "read":true,
        "level_2":true,
        "level_1":true,
        "level_0":true,
        "delete_posts":true,
        "delete_published_posts":true,
        "author":"1"
    },
    "filter":null
},

And here is the result for one user, querying on ID:

{
    "id":9,
    "id_str":"9",
    "nicename":"lalala",
    "display_name":"lalala",
    "user_url":"http:\/\/www.x.x\/x\/x.html",
    "posts_url":"http:\/\/www.x.x\/x\/x\/x\/x\/",
    "avatar":[
        {
            "url":"xxx",
            "width":96,
            "height":96
        }
    ],
    "meta":{
    }
}

As you can see the two are quite different and there are fields that exist in each but not both and there are also a lot of fields missing from both that should come back with the user.

This is fixed by the pull request: #74