spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Does @SpringQueryMap Support Multiple Annotations or Nested Objects?

Open chs98412 opened this issue 9 months ago • 0 comments
trafficstars

  1. Can I use multiple @SpringQueryMap annotations in a single method?
@FeignClient(name = "exampleClient", url = "https://api.example.com")
interface ExampleClient {

    @GetMapping("/example")
    fun search(
        @SpringQueryMap params1: QueryParams,
        @SpringQueryMap params2: QueryParams
    ): String
}
  1. Does @SpringQueryMap support nested objects?
data class ParentParam(
    val a: String,
    val child: ChildParam // Nested object
)

data class ChildParam(
    val b: String,
    val c: String
)

@FeignClient(name = "exampleClient", url = "https://api.example.com")
interface ExampleClient {
    @GetMapping("/example")
    fun search(@SpringQueryMap params: ParentParam): String
}

As far as I know, spring-cloud-openfeign does not support either of these. Why doesn’t spring-cloud-openfeign support them?

If supporting these features does not go against your direction and you have no plans to implement them, would it be okay if I attempt to make the modifications and submit a PR?

chs98412 avatar Feb 12 '25 10:02 chs98412