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.