jsonkotlinjooqkotlinx.serialization

How to convert between kotlinx.serialization.json.JsonElement and jooq.JSON?


I want to use the standard kotlinx JsonElement in my data models but translate between jooq.JSON as necessary. Can I do this without going through string serialization?


Solution

  • Just attach a converter or binding to your JSON data types when using the code generator:

    <forcedType>
        <userType>kotlinx.JsonElement</userType>
        <converter>com.example.MyConverter</converter>
        <includeTypes>(?i:json)</includeTypes>
    </forcedType>