Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-30166

Error responses from roles REST API are not in consistent format

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.37.0
    • Fix Version/s: None
    • Component/s: REST, Security
    • Labels:
    • Notability:
      3

      Description

      Example:

      Request URL: {{nxrm3Url}}/service/rest/v1/security/roles
      Request Body: {
      "id": ,
      "name": "some-role",
      "description": "some-role",
      "privileges": [
      
      ],
      "roles": [
      "some-role "
      ]
      }
      Response Status Code: 400
      Response Body: {
      "id": "*",
      "message": "Could not process the input: Unexpected character (',' (code 44)): expected a value"
      }
      
      

      Note that the above has the message as a field in the response.

      Now see the same API, with a different cause, but also a 400 response:

      Case03
      Request URL: {{nxrm3Url}}/service/rest/v1/security/roles
      Request Body: {
      "id": "some-role",
      "name": "some-role",
      "description": "some-role",
      "privileges": [
      
      ],
      "roles": [
      "some-other-role"
      ]
      }
      Response Status Code: 400
      Response Body: "Role 'some-other-role' contained in role 'some-role' not found."
      

      Expected: The error responses should be in a consistent format so that they can be parsed and displayed properly by clients.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Rich Seddon Rich Seddon
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  tigCommentSecurity.panel-title