Project

Profile

Help

Issue #1125

closed

API call to create a user includes extra `id` field

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

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

Description

When creating a user via the API, this is an example of the json returned:

{
    "_href": "/pulp/api/v2/users/lets-go-to-joule/", 
    "_id": {
        "$oid": "559d8d9fe138237844b5646e"
    }, 
    "_ns": "users", 
    "id": "559d8d9fe138237844b5646e", 
    "login": "lets-go-to-joule", 
    "name": "lets-go-to-joule", 
    "roles": []
}

All other user endpoints serialize differently, excluding the `id` field.

{
    "_href": "/pulp/api/v2/users/lets-go-to-joule/", 
    "_id": {
        "$oid": "559d8d9fe138237844b5646e"
    }, 
    "_ns": "users", 
    "login": "lets-go-to-joule", 
    "name": "lets-go-to-joule", 
    "roles": []
}

As part of the mongoengine conversion, I have specifically added code to insert this extra field to preserve backwards compatibility. To fix (only for an X release), simply grep for a link to this issue and remove the referenced code.

Also available in: Atom PDF