How to pass parameters in LHS Brackets format using rest client

44 Views Asked by At

There is some API that involves passing parameters using LHS Brackets. Specifically, we are talking about the CMS Strapi API: https://docs.strapi.io/dev-docs/api/rest/parameters

I'm using spring boot 3.2.2 and want to implement integration using the built-in RestClient and HttpExchange interfaces. Please tell me, is it possible to somehow specify transfer to LHS Brackets for HttpExchange and RequestParam?

Example request:

GET /api/categories?pagination[page]=1&pagination[pageSize]=10

Example of my HttpExchange interface:

@HttpExchange("/categories")
public interface CategoryClient {

    @GetExchange
    StrapiResponse<List<Category>> find(CategoryRequest request);

}

public record CategoryRequest(@RequestParam("pagination") Pagination pagination) {
}

public record Pagination(Integer page, Integer pageSize) {
}
0

There are 0 best solutions below