Pihentagy
12/04/2025, 9:55 PMPihentagy
12/04/2025, 10:08 PMval data = jsonb<Map<String, JsonElement>>("data", Json.Default)Chantal Loncle
12/05/2025, 1:37 PMjson()/jsonb() mapped to any type as long as you pass either a KSerializer or serialize/deserialize function pair, which is what Exposed uses to map the input value to/from the database. There's an example in the docs for Jackson that, while still using a data class, relies on custom serializer/deserializer to define the column mapping.
I'm not sure exactly which JsonElement you're using, so I'll just leaves the bones here:
val data = jsonb<Map<String, JsonElement>>(
"data",
serialize = {
// Map to JSON string
},
deserialize = {
// JSON String to Map
}
)