eclipse / kapua

Eclipse Public License 2.0
222 stars 160 forks source link

✨ [REST API] Implement sorting functionality in `/{scopeId}/endpointInfos` API #4090

Closed MDeLuise closed 1 month ago

MDeLuise commented 1 month ago

Summary

This pull request introduces sorting capabilities to the '/{scopeId}/endpointInfos' 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 endpoint information based on any specified field in either ascending or descending order.

Example Usage

To sort the endpoint information in ascending order by a specific field, the request would look like: GET /{scopeId}/endpointInfos?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 1 month ago

Codecov Report

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

Project coverage is 16.75%. Comparing base (62722f7) to head (bdbed8e). Report is 4 commits behind head on develop.

Files Patch % Lines
.../app/api/resources/v1/resources/EndpointInfos.java 0.00% 4 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4090/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/4090?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4090 +/- ## ============================================= - Coverage 16.79% 16.75% -0.04% Complexity 22 22 ============================================= Files 2016 2016 Lines 52317 52357 +40 Branches 4407 4417 +10 ============================================= - Hits 8787 8773 -14 - Misses 43132 43184 +52 - Partials 398 400 +2 ``` | [Files](https://app.codecov.io/gh/eclipse/kapua/pull/4090?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) | Coverage Δ | | |---|---|---| | [.../app/api/resources/v1/resources/EndpointInfos.java](https://app.codecov.io/gh/eclipse/kapua/pull/4090?src=pr&el=tree&filepath=rest-api%2Fresources%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Fkapua%2Fapp%2Fapi%2Fresources%2Fv1%2Fresources%2FEndpointInfos.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse#diff-cmVzdC1hcGkvcmVzb3VyY2VzL3NyYy9tYWluL2phdmEvb3JnL2VjbGlwc2Uva2FwdWEvYXBwL2FwaS9yZXNvdXJjZXMvdjEvcmVzb3VyY2VzL0VuZHBvaW50SW5mb3MuamF2YQ==) | `0.00% <0.00%> (ø)` | | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/eclipse/kapua/pull/4090/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)