Bug #11156
closedOrg create API returns different wrapping and attributes
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
}
Updated by Dominic Cleal about 9 years ago
- Related to Bug #10356: POST and PUT should use RABL templates for the response. added
Updated by Dominic Cleal about 9 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" }
Updated by Eric Helms about 9 years ago
- Translation missing: en.field_release set to 31
- Triaged changed from No to Yes
Updated by Stephen Benjamin about 9 years ago
- Priority changed from Normal to High
- Translation missing: en.field_release changed from 31 to 77
Updated by Stephen Benjamin almost 9 years ago
- Translation missing: en.field_release changed from 77 to 78
Updated by Eric Helms over 8 years ago
- Translation missing: en.field_release changed from 78 to 113
Updated by Eric Helms over 8 years ago
- Translation missing: en.field_release changed from 113 to 86