Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-4055

Compulsory field firstName can be passed empty or null in the payload while creating user through API

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0, 2.4.0
    • Ranger
    • None

    Description

      Problem Statement:

      While creating a user from UI its firstName is a compulsory field but while creating it through making POST request on /xuser/secure/users its not a compulsory parameter.

       

      Steps to reproduce:

      Make a post request on /xuser/secure/users endpoint with following payload:

      { "name":"temp_user_abc_12345", "firstName":null, "lastName": "user1", "loginId": "user1", "emailAddress" : null, "description" : "user1 desc", "password" : "user1Pass@123", "groupIdList":[1], "groupNameList":["public"], "status":1, "isVisible":1, "userRoleList": [ "ROLE_USER" ], "userSource": 0 }

      Response:

      {     "id": 323,     "createDate": "2023-01-17T06:49:12Z",     "updateDate": "2023-01-17T06:49:12Z",     "owner": "Admin",     "updatedBy": "Admin",     "name": "temp_user_abc_12345",     "lastName": "user1",     "password": "*****",     "description": "user1 desc",     "groupIdList": [         1     ],     "groupNameList": [         "public"     ],     "status": 1,     "isVisible": 1,     "userSource": 0,     "userRoleList": [         "ROLE_USER"     ] }

       
      With firstName as null also the user is creating successfully.

      Attachments

        1. 0001-RANGER-4055-Compulsory-field-firstName-can-be-passed.patch
          8 kB
          Ramachandran Krishnan
        2. image-2023-02-03-14-59-05-130.png
          379 kB
          Ramachandran Krishnan
        3. Screenshot 2023-01-23 at 9.39.16 AM.png
          309 kB
          Ramachandran Krishnan

        Issue Links

          Activity

            People

              ramackri Ramachandran Krishnan
              kundan.jha Kundan Kumar Jha
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: