Broken API

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"
}
}

POSThttps://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
}

··· 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!

This should probably be filed as a bug in Redmine against nightly.

Incompatibilities can be usually fixed without needing to revert entire
commits.

>> 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": []
>> },

Assuming you mean these attributes are missing, I think that would be
filed against Katello to start with. IIRC this is an inherited
controller and may just need some additional rabl changes there -
perhaps creating a "create" rabl to match and extend what we have in
Foreman for organisations now?

http://projects.theforeman.org/projects/katello/issues/new

··· On 20/07/15 14:12, Stephen Herr wrote: > On 07/16/2015 08:47 AM, Joseph Magen wrote:


Dominic Cleal
Red Hat Engineering

Look, first I brought this up on #theforeman-dev and then I was told to
bring it up here and now you're telling me to bring it up in Redmine and
you're expecting me to care about and play the "is it foreman or is it
katello" blame game. I don't care about any of that. I'm pointing out to
you that foreman made a change that breaks backwards-compatibility. If you
guys want to argue internally about who needs to fix it and how then that's
fine, but I don't care.

And no, it's not merely a change in the number of fields returned. In one
instance the response is a { "organization": <org> } hash, where in the
other it's an "unwrapped" organization. That will break anything that uses
this API method.

-Stephen

··· On Monday, July 20, 2015 at 9:19:11 AM UTC-4, Dominic Cleal wrote: > > On 20/07/15 14:12, Stephen Herr wrote: > > 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! > > This should probably be filed as a bug in Redmine against nightly. > > Incompatibilities can be usually fixed without needing to revert entire > commits. > > >> 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": [] > >> }, > > Assuming you mean these attributes are missing, I think that would be > filed against Katello to start with. IIRC this is an inherited > controller and may just need some additional rabl changes there - > perhaps creating a "create" rabl to match and extend what we have in > Foreman for organisations now? > > http://projects.theforeman.org/projects/katello/issues/new > > -- > Dominic Cleal > Red Hat Engineering >