<@UMU4VHGPJ> you can use a composite to extract th...
# http4k
d
@Mehdi you can use a composite to extract the values like so:
Copy code
fun main() {
    data class Pageable(val sortAscending: Boolean, val page: Int, val maxResults: Int)

    val lens = Query.composite {
        Pageable(
            boolean().defaulted("sortAscending", true)(it),
            int().defaulted("page", 1)(it),
            int().defaulted("maxResults", 20)(it)
        )
    }

    println(lens(Request(GET, "/list?page=1")))
    // Pageable(sortAscending=true, page=1, maxResults=20)
}
👌 1
👍 1
p
that one's worth adding to the documentation site https://github.com/http4k/http4k/pull/453