how to implement a repeated request parameter
See original GitHub issueI must be missing something completely. My usecase is a simple GET endpoint taking a list of Long ids and returning associated data. I modelled the input parameter “ids” as
data class ProductImagesRequest(@QueryParam("multiple ids.") val ids:List<Long>)
When calling it with parameters like ?ids=1&ids=2&ids=3
I get this error:
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList<java.lang.Long>` out of VALUE_STRING token
Why would a request parameter be deserialized from xml or json?
I love this library BTW, it’s a very elegant solution!
Issue Analytics
- State:
- Created 4 years ago
- Comments:25
Top Results From Across the Web
spring mvc: parse repeated request param - Stack Overflow
In my case a Javascript element sends the ids of multiple rows in order for the server to do something with all these...
Read more >Parse multiple repeated request parameters. Use ... - GitHub
to return an array in this case with the multiple repeated values. Currently it returns only the last value (i.e. param2).
Read more >parameters • Akka HTTP - Documentation
This page explains how to extract multiple query parameter values from the request, or parameters that might or might not be present.
Read more >Spring @RequestParam Annotation - Baeldung
Simply put, we can use @RequestParam to extract query parameters, form parameters, and even files from the request.
Read more >Query Parameters - FastAPI
You can declare multiple path parameters and query parameters at the same time, FastAPI knows which is which. And you don't have to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Laying traps for unsuspecting developers so you can get PR’s of them. Genius!
I’m not exactly bristling with free time myself, but let me look at it.
Thanks so much for the help. Now it works. The real culprit though was the fact that we are using gson for JSON serialization instead of jackson.