Bug 1147100 - Updating a content view's label returns a 200 but it should be a 400 or 422
Summary: Updating a content view's label returns a 200 but it should be a 400 or 422
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: Zach Huntington-Meath
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-26 21:59 UTC by Og Maciel
Modified: 2017-08-01 20:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 20:13:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 18389 0 Normal New Updating a content view's label returns a 200 but it should be a 400 or 422 2020-05-08 17:15:01 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.