Request A: http://localhost:8080/api/organizations/1/scenarios?perProducts=1
,
Request B: http://localhost:8080/api/organizations/1/scenarios?perProducts=1,2
My Location class:
@Location("/scenarios")
data class Scenarios(
val organization: Organization,
val startValue: Int = 0,
val perPage: Int = 10,
val perProducts: List<Int> = listOf(),
val byName: String = ""
)
If I add one product id to path (request a) all is ok, but if I add two (request b) or more ids I get "bad request" in response. What do I wrong?
Try this one:
Locations under the hood uses Data Convertion feature, and this is a way it handles multiple values.