Closed Sironheart closed 2 years ago
I'm currently trying to talk to an old PHP API, which accepts filters as following ?filter={"foo":"bar", "fizz":"buzz"}
?filter={"foo":"bar", "fizz":"buzz"}
I have not been able to get a result like this.
My client looks the following:
interface FooClient { @RequestMapping(method = [RequestMethod.GET], value = ["/v3/foo"]) fun foo(@SpringQueryMap(encoded = true) filter: StableQueryParams): StableMoviesResponse? }
The POJO is a Kotlin Dataclass:
data class StableQueryParams( val filter: Map<String, String>, )
Unluckily this leads to the following output: /v3/movies?filter={foo=bar, fizz=buzz}
/v3/movies?filter={foo=bar, fizz=buzz}
Is it possible to get these kinds of JSON output for Maps or Sub classes? How would I be able to to this?
Thanks for your help in advance :)
I found a solution. It is a matter of changing the QueryMap-Object to @RequestParam filter: String and parsing the JSON by hand.
@RequestParam filter: String
I'm currently trying to talk to an old PHP API, which accepts filters as following
?filter={"foo":"bar", "fizz":"buzz"}
I have not been able to get a result like this.
My client looks the following:
The POJO is a Kotlin Dataclass:
Unluckily this leads to the following output:
/v3/movies?filter={foo=bar, fizz=buzz}
Is it possible to get these kinds of JSON output for Maps or Sub classes? How would I be able to to this?
Thanks for your help in advance :)