Bug 1147100

Summary: Updating a content view's label returns a 200 but it should be a 400 or 422
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: APIAssignee: Zach Huntington-Meath <zhunting>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: bbuckingham, cfouant
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 20:13:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Og Maciel 2014-09-26 21:59:59 UTC
Description of problem:

Since a content view's label is immutable, once you create one you should not be able to update its label. This works fine, but using the API to update an existing label should return a 400 HTTP status code (or perhaps 422?), but instead it is returning a 200.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Use the API layer to create a new content view
2. Use the API to update the content view's label
3.

Actual results:

The label is not updated but the HTTP status code is 200.

Expected results:

The HTTP status code should be 400.


Additional info:

Comment 2 Zach Huntington-Meath 2016-05-02 14:26:54 UTC
I have been accessing this bug and I think the fix will have a larger scope that just fixing content view. Right now the API returns 200 when anything has a put request made to it with a parameter that the endpoint does not normally take. Both in Foreman and Katello.

As an example if you try to edit a content view with the body:
{
 "label": "test1",
 "fake_param": "fake data"
}

It will still return a 200 response containing all the data about the content-view that was supposed to be edited. It will edit any valid parameters given in the body:
{
 "label": "test2",
 "name": "Content-view name",
 "fake_param": "fake data"
}

This will return all the information about the content-view with the name changed to "Content-view name".

This works the same way on Foreman endpoints as well. An easy one to test is User.

I will begin a conversation about the best way to go about making this change in the foreman-dev mailing list.

Comment 3 Christine Fouant 2017-02-03 16:57:00 UTC
Created redmine issue http://projects.theforeman.org/issues/18389 from this bug

Comment 4 Bryan Kearney 2017-08-01 20:13:22 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in product in the forseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.