https://kotlinlang.org logo
#http4k
Title
a

Andrew O'Hara

06/01/2022, 9:04 PM
Is this this best way to have a query lens for a CSV mapping to
List<Int>
?
Copy code
val groupIds = Query.string().map(
    nextIn = { text -> text.split(",").map { it.toInt() } },
    nextOut = { it.joinToString(",") }
).defaulted("group_ids", emptyList(), description = "CSV of group ids")
Is there an existing way to do this? Or maybe we could add something like
<http://Query.int|Query.int>().list(",").required("foo")
.