eclipse / kapua

Eclipse Public License 2.0
227 stars 160 forks source link

✨ [REST API] Implement sorting functionality in `/{scopeId}/credentials` API #4095

Closed MDeLuise closed 3 months ago

MDeLuise commented 3 months ago

Summary

This pull request introduces sorting capabilities to the '/{scopeId}/credentials' API endpoint by adding two new query parameters: sortDir and sortParam.

Details

This enhancement mirrors the sorting functionality already available in other API endpoints, such as /devices. By using these parameters, users can now sort the credentials information based on any specified field in either ascending or descending order.

Example Usage

To sort the credentials information in ascending order by a specific field, the request would look like: GET /{scopeId}/credentials?sortDir=ASCENDING&sortParam=<field_name> This update enhances the flexibility and usability of the API by providing consistent sorting behavior across different endpoints.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 16.75%. Comparing base (9d86254) to head (5962247). Report is 4 commits behind head on develop.

Files Patch % Lines
...ua/app/api/resources/v1/resources/Credentials.java 0.00% 2 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4095/graphs/tree.svg?width=650&height=150&src=pr&token=1P4N4CApH8&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)](https://app.codecov.io/gh/eclipse/kapua/pull/4095?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4095 +/- ## ============================================= - Coverage 16.75% 16.75% -0.01% Complexity 22 22 ============================================= Files 2016 2016 Lines 52357 52359 +2 Branches 4417 4418 +1 ============================================= Hits 8773 8773 - Misses 43184 43186 +2 Partials 400 400 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/4095?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [...ua/app/api/resources/v1/resources/Credentials.java](https://app.codecov.io/gh/eclipse/kapua/pull/4095?src=pr&el=tree&filepath=rest-api%2Fresources%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fapp%2Fapi%2Fresources%2Fv1%2Fresources%2FCredentials.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-cmVzdC1hcGkvcmVzb3VyY2VzL3NyYy9tYWluL2phdmEvb3JnL2VjbGlwc2Uva2FwdWEvYXBwL2FwaS9yZXNvdXJjZXMvdjEvcmVzb3VyY2VzL0NyZWRlbnRpYWxzLmphdmE=) | `0.00% <0.00%> (ø)` | |