Bug 1480316

Summary: API Doc for content view publishing is wrong
Product: Red Hat Satellite Reporter: Christine Fouant <cfouant>
Component: API - ContentAssignee: Nagoor Shaik <nshaik>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.8CC: bbuckingham, bkearney, cfouant, erinn.looneytriggs, jcallaha, jsherril, kgaikwad, lhellebr, nshaik, swadeley
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
URL: http://projects.theforeman.org/issues/20471
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1329748 Environment:
Last Closed: 2018-10-16 19:19:36 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:

Comment 1 Satellite Program 2017-09-22 20:04:31 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20471 has been resolved.

Comment 3 Lukáš Hellebrandt 2018-06-28 09:57:08 UTC
FailedQA on Sat 6.4 snap 9.

Type is "correctly" changed to numeric. However,

1) id is still marked as required although API doesn't require it

2) The value is ignored and value from URL is used.

Having this parameter doesn't make sense at all.

# curl -s -X POST -k -u admin:changeme -d '{"id":<NONEXISTENT_ID>}' https://intel-bakersville-01.khw.lab.eng.bos.redhat.com/katello/api/content_views/<ID>/publish --header "Content-Type:application/json"

=> Success (while the id specified by the argument doesn't even exist)

Tested with content view publishing, not sure what other entities and actions are affected

Comment 4 Justin Sherrill 2018-07-02 14:32:54 UTC
Lukas, i think this maybe a misunderstanding about how these things work, as this is a combination of how rails works and how our api docs are presented:

Any api that requires an id as part of the URL will always show that api as required.  Examine these apis:

 GET /api/architectures/:id 
 PUT /api/auth_source_ldaps/:id 
 POST /katello/api/capsules/:id/content/sync 

These are just 3 examples of the dozens to hundreds of examples in our api docs.  In all cases the id param is required, but it is only used from the URL.  If you specify it as part of a body, it is ignored. 

Given all of this, i do not see either 1) or 2) as a bug, but instead are working as designed.  If you still consider these a bug, then feel free to file a bz for the entire application, as it is fairly consistent across the application and not specific to the content view publish api docs.  

Does that sound reasonable?

Comment 5 Lukáš Hellebrandt 2018-07-12 12:02:08 UTC
Sounds reasonable. Verifying as the type is changed correctly.

Comment 6 Bryan Kearney 2018-10-16 19:19:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2927