Project

General

Profile

Bug #11156

Org create API returns different wrapping and attributes

Added by Stephen Herr over 5 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

On 07/16/2015 08:47 AM, Joseph Magen wrote:

https://github.com/theforeman/foreman/commit/d575926a689fd6abd6f26ee2823ce95eef07dd38

Fixes #10356 - changed the POST/PUT RABL template to be the same as

the GET template

You're right. This should have been mentioned as breaking version. I

would bring it up on the foreman-devel channel.

Hi guys,

I believe that the change above broke backwards compatibility in the
API. I believe you should revert the change, and please don't break
backwards compatibility unless it's accompanied with an API version
bump. Thanks!

-Stephen

POST https://server1/katello/api/v2/organizations/
with {"name":"api_name"}
returns {
"organization": {
"id": 126,
"name": "api_name",
"title": "api_name",
"label": "api_name",
"description": null,
"created_at": "2015-06-24T18:50:57Z",
"updated_at": "2015-06-24T18:50:57Z"
}
}

POST
https://server2/katello/api/v2/organizations/
with {"name":"api_name"}
returns {
"ancestry": null,
"apply_info_task_id": null,
"created_at": "2015-06-24T18:52:28Z",
"default_info": {
"system": [],
"distributor": []
},
"description": null,
"id": 3,
"ignore_types": [],
"katello_default": true,
"label": "api_name",
"name": "api_name",
"title": "api_name",
"updated_at": "2015-06-24T18:52:28Z",
"service_levels": [],
"service_level": null
}


Related issues

Related to Foreman - Bug #10356: POST and PUT should use RABL templates for the response.Closed2015-05-04

History

#1 Updated by Dominic Cleal over 5 years ago

  • Related to Bug #10356: POST and PUT should use RABL templates for the response. added

#2 Updated by Dominic Cleal over 5 years ago

  • Project changed from Foreman to Katello
  • Subject changed from Broken API to Org create API returns different wrapping and attributes
  • Category set to API
  • Triaged set to No

I'm not sure which is the before/after in the bug report, but I'm guessing this is something to do with the inherited controller. It may be that Katello needs to ship a create.json.rabl like Foreman's to get the additional attributes, don't know about the wrapping.

Foreman does this before and after #10356.

# after
{
  "ancestry": null,
  "created_at": "2015-07-20T13:53:03Z",
  "description": null,
  "id": 24,
  "ignore_types": [],
  "name": "bugtest",
  "title": "bugtest",
  "updated_at": "2015-07-20T13:53:03Z" 
}

# before
{
  "ancestry": null,
  "created_at": "2015-07-20T13:53:44Z",
  "description": null,
  "id": 25,
  "ignore_types": [],
  "name": "bugtest2",
  "title": "bugtest2",
  "updated_at": "2015-07-20T13:53:44Z" 
}

#3 Updated by Eric Helms over 5 years ago

  • Legacy Backlogs Release (now unused) set to 31
  • Triaged changed from No to Yes

#4 Updated by Stephen Benjamin about 5 years ago

  • Priority changed from Normal to High
  • Legacy Backlogs Release (now unused) changed from 31 to 77

#5 Updated by Stephen Benjamin about 5 years ago

  • Legacy Backlogs Release (now unused) changed from 77 to 78

#6 Updated by Eric Helms over 4 years ago

  • Legacy Backlogs Release (now unused) changed from 78 to 113

#7 Updated by Eric Helms over 4 years ago

  • Legacy Backlogs Release (now unused) changed from 113 to 86

#8 Updated by Eric Helms over 4 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF