[RTFACT-11878] Some REST resources return a Content-Type that does not match the documentation Created: 08/Jul/16  Updated: 14/Nov/17

Status: Open
Project: Artifactory Binary Repository
Component/s: REST API
Affects Version/s: 4.7.7, 4.9.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Arturo Aparicio Assignee: Gidi Shabat
Resolution: Unresolved Votes: 1
Labels: None

Assigned QA: Yogev Abergel (Inactive)

 Description   

Some REST resources return a Content-Type that does not match the documentation.

For example, according to the documentation, this REST call should return application/vnd.org.jfrog.artifactory.security.PermissionTargets+json but instead the Content-Type is application/vnd.org.jfrog.artifactory.security.Users+json. Performing an OPTIONS call on that resource shows that it may return various Content-Types, including both of the aforementioned types:

                <response>
                    <representation mediaType="application/vnd.org.jfrog.artifactory.security.Users+json"/>
                    <representation mediaType="application/vnd.org.jfrog.artifactory.security.Groups+json"/>
                    <representation mediaType="application/vnd.org.jfrog.artifactory.security.PermissionTargets+json"/>
                    <representation mediaType="application/json"/>
                </response>

In fact, if the user provides the header "Accept: application/vnd.org.jfrog.artifactory.security.PermissionTargets+json", the correct Content-Type will be returned. Still the call should default to the correct Content-Type or the documentation should be updated for accuracy.

Affected resources:

api/security/permissions
api/security/groups

Kriheli:
What needs to be fixed:

1) api/security/permissions - need to produce application/vnd.org.jfrog.artifactory.security.PermissionTargets+json and NOT application/vnd.org.jfrog.artifactory.security.Users+json
2) api/security/groups - need to produce application/vnd.org.jfrog.artifactory.security.Groups+json and NOT application/vnd.org.jfrog.artifactory.security.Users+json
Moving to RnD to fix.
Important: Once fixed, need to update the documentation again to reflect the fix in the API.



 Comments   
Comment by Andrei Komarov [ 26/Jul/16 ]

The REST API for virtual repository update does not work with the specific JSON object required header (instead it works with the application/json):

application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json

https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-UpdateRepositoryConfiguration

Comment by Shlomi Kriheli [ 13/Nov/16 ]

I fixed the documentation per Arturo's and Andrei's comments.
However:
1) api/security/permissions - need to produce application/vnd.org.jfrog.artifactory.security.PermissionTargets+json and NOT application/vnd.org.jfrog.artifactory.security.Users+json

2) api/security/groups - need to produce application/vnd.org.jfrog.artifactory.security.Groups+json and NOT application/vnd.org.jfrog.artifactory.security.Users+json

Moving to RnD to fix.
Important: Once fixed, need to update the documentation again to reflect the fix in the API.

Generated at Tue Feb 18 07:54:47 UTC 2020 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.