Skip to content

Support mapping DTOs / Records as query parameters in @GetExchange HTTP Interfaces #36246

@matiasferrerovilas

Description

@matiasferrerovilas

In Spring Boot 4 / HTTP Interface clients (@HttpExchange / @GetExchange), there is no equivalent of Feign’s @SpringQueryMap. This prevents passing a DTO or record directly as query parameters.

for example

@GetExchange("/requests")
List<DTO> getRequests(@RequestParam Long page,
                                       @RequestParam Long size,
                                       @SpringQueryMap Filter filter);

Enhancement:
Introduce a @SpringQueryMap (or similar) annotation for HTTP Interfaces
Automatically serialize DTOs / records into query parameters
Similar behavior to @SpringQueryMap in Feign clients

Benefit:
Type-safe, maintainable client code
No need to manually convert DTO → Map or pass each field as a separate @RequestParam

Note: I couldn’t find an existing way to do this in Spring Boot 4; not sure if a solution already exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions