Bug #7261
closedTop level object hash marked as optional, not required in POST/create APIs
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1133799
Description of problem:
API documentation of POST /api/users says:
user / optional , nil allowed
Version-Release number of selected component (if applicable):
Satellite-6.0.4-RHEL-6-20140823.0-Satellite-x86_64
How reproducible:
always
Steps to Reproduce:
1. Check the API documentation of POST /api/users
https://<sat6-hostname>/apidoc/v2/users/create.html
Actual results:
The 1st parameter user
is
optional , nil allowed
Expected results:
It does not make sense to allow nil for (or not to include) the user parameter at user creation. What user should be created?
Additional info:
curl "$(hostname)/api/users" -u admin:changeme -H "Accept: application/json" -H "Content-Type: application/json" -d '{"user":nil}'
{"status":400,"error":"There was a problem in the JSON you submitted: 784: unexpected token at '{\"user\":nil}'"}
The API documentation does not match with the behavior.
Updated by Dominic Cleal about 10 years ago
- Subject changed from nil allowed as user parameter at user creation to Top level object hash marked as optional, not required in POST/create APIs
- Category set to API
- Assignee deleted (
Bryan Kearney)
Updated by Joseph Magen about 10 years ago
- Status changed from New to Assigned
- Assignee set to Joseph Magen
- Target version set to 1.7.4
Updated by Shlomi Zadok about 10 years ago
- Assignee changed from Joseph Magen to Shlomi Zadok
Updated by The Foreman Bot about 10 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/1730 added
- Pull request deleted (
)
Updated by Joseph Magen about 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset fb5ac6168beaad3e205a113a92361066e14355f3.
Updated by Dominic Cleal about 10 years ago
- Translation missing: en.field_release set to 22