Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rest): update response API Listing users #1996

Merged

Conversation

tuannn2
Copy link
Contributor

@tuannn2 tuannn2 commented Jun 9, 2023

Issue: #1994

How To Test?

  • Run command line:
$ curl 'https://sw360.org/api/users' -i -X GET \
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsic3czNjAtUkVTVC1BUEkiXSwidXNlcl9uYW1lIjoiYWRtaW5Ac3czNjAub3JnIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTY4NjMwNzk2NSwiYXV0aG9yaXRpZXMiOlsiUkVBRCIsIldSSVRFIl0sImp0aSI6Inp6ang3YXhKSWZWT3FMSFBRTTdldWhicjQwWSIsImNsaWVudF9pZCI6InRydXN0ZWQtc3czNjAtY2xpZW50In0.GN0qYkxZ4_DccOHcjBCmFFuNdRhGZbL1HLl9XRCIX-VvhfuP9E8xpoj8FyPtKN6PQZoFRWDyGlB7YUDf0h3CpOTIhf2dL5sH2p6lnYviM-1rhqCb4iePqrLokwCvtKGYTlzSlfqeFt5YvKgRnwO8LI4mS73d1mCJ8anOZHoJHAMGp5URtRcxG5ZZEk7xJGI2EzM0li5pXjkbmI6qibdieXdakv9TLLtH0R_NQMNZYZxEaZiNXDDCvPEVk_YoYVB31LQJRRyO3xzl_T9r9iKOQObMACiXBz4ETME-sXK9wzpDlTl4ufy2pKX18ok6t_yO8nJ8vPpFnItF6W_nuRoaOA' \
    -H 'Accept: application/hal+json'
  • Expected Output:
{
  "_embedded" : {
    "sw360:users" : [ {
      "email" : "admin@sw360.org",
      "department" : "SW360 Administration",
      "deactivated" : false,
      "fullName" : "John Doe",
      "givenName" : "John",
      "lastName" : "Doe",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/4784587578e87989"
        }
      }
    }, {
      "email" : "jane@sw360.org",
      "department" : "SW360 BA",
      "deactivated" : false,
      "fullName" : "Jane Doe",
      "givenName" : "Jane",
      "lastName" : "Doe",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/users/byid/frwey45786rwe"
        }
      }
    } ]
  },
  "_links" : {
    "curies" : [ {
      "href" : "https://sw360.org/docs/{rel}.html",
      "name" : "sw360",
      "templated" : true
    } ]
  }
}

Signed-off-by: tuannn2 <tuan2.nguyennhu@toshiba.co.jp>
@tienlee tienlee added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for REST New-UI Level for the API and UI level changes for the new-ui labels Jun 9, 2023
@nikkuma7
Copy link

Test successful.
image

@rudra-superrr rudra-superrr self-assigned this Jun 14, 2023
@@ -603,6 +603,18 @@ public User convertToEmbeddedUser(User user) {
return embeddedUser;
}

public User convertToEmbeddedGetUsers(User user) {
Copy link
Contributor

@rudra-superrr rudra-superrr Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why create new method when you can add the new fields in the above method(convertToEmbeddedUser)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I add new fields in method(convertToEmbeddedUser) it causes redundancy for about 11APIs using that function. It's not really necessary.

@rudra-superrr
Copy link
Contributor

Code looks good.

@rudra-superrr rudra-superrr added ready ready to merge and removed needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Jun 15, 2023
@ag4ums ag4ums merged commit ec28fa1 into eclipse-sw360:main Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New-UI Level for the API and UI level changes for the new-ui ready ready to merge REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants