Project

Profile

Help

Issue #1133

closed

_href missing from response body for PUT /v2/users/<user_id>/ endpoint

Added by amacdona@redhat.com over 9 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

We include an `_href` field in almost every other endpoint in our API, including the other users endpoints.

$ http --json -a admin:admin --verify=no PUT 'https://localhost/pulp/api/v2/users/test/' delta:='{"name": "newname"}'
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 110
Content-Type: application/json; charset=utf-8
Date: Sun, 12 Jul 2015 15:53:17 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1k-fips mod_wsgi/4.3.2 Python/2.7.8
{
    "_id": {
        "$oid": "55a28b48e138230a42d70f2a"
    }, 
    "_ns": "users", 
    "login": "test", 
    "name": "newname", 
    "roles": []
}

Expected:


$ http --json -a admin:admin --verify=no PUT 'https://localhost/pulp/api/v2/users/test/' delta:='{"name": "newname"}'
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 147
Content-Type: application/json; charset=utf-8
Date: Sun, 12 Jul 2015 15:53:34 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1k-fips mod_wsgi/4.3.2 Python/2.7.8

{
    "_href": "/pulp/api/v2/users/test/", 
    "_id": {
        "$oid": "55a28b48e138230a42d70f2a"
    }, 
    "_ns": "users", 
    "login": "test", 
    "name": "newname", 
    "roles": []
}

This will be corrected by creating a users serializer in the users collection Mongoengine conversion story: https://pulp.plan.io/issues/788


Related issues

Related to Pulp - Refactor #788: Convert the 'users' collection to a mongoengine modelCLOSED - CURRENTRELEASEamacdona@redhat.com

Actions

Also available in: Atom PDF