Happy weekend :http4k: fans! Super quick update fo...
# http4k
d
Happy weekend http4k fans! Super quick update for anyone who has been playing with LLMs recently and wants to reduce their token usage: • http4k v6.24.0.0 adds Toon to our suite of supported data formats, including the ability to auto-convert between Kotlin data classes and Toon format - either via lenses into HTTP or LLM message bodies, or just directly into string format. It supports the standard variety of JVM types out of the box and you can also add custom types using the standard http4k AutoMappingConfiguration mechanism. Injection via the lens system is also supported. To convert any class instance into Toon format, you can just do:
Copy code
data class Child(val value: Int)
data class TopLevel(val messages: List<String>, val time: Instant, val child: Child)

println(Toon.asFormatString(TopLevel(listOf("http4k"), Instant.now(), Child(123))))

// output...
messages[1]: http4k
time: "2025-12-14T11:09:13.572457Z"
child:
  value: 123
The maven coordinates of the new module are :
http4k-format-toon
and the examples can be found here
😯 1
K 1
http4k 1