Project

General

Profile

Actions

Bug #7261

closed

Top level object hash marked as optional, not required in POST/create APIs

Added by Dominic Cleal over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.

Actions #1

Updated by Dominic Cleal over 9 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)
Actions #2

Updated by Joseph Magen over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Joseph Magen
  • Target version set to 1.7.4
Actions #3

Updated by Shlomi Zadok over 9 years ago

  • Assignee changed from Joseph Magen to Shlomi Zadok
Actions #4

Updated by The Foreman Bot over 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1730 added
  • Pull request deleted ()
Actions #5

Updated by Joseph Magen over 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #6

Updated by Dominic Cleal over 9 years ago

  • translation missing: en.field_release set to 22
Actions

Also available in: Atom PDF