EnumAwareJson

internal class EnumAwareJson(base: Json)

The registered enums' serializers, as a module and as a Json with it folded in, resolved per conversion and rebuilt only when the registrations change. The driver replaces TypeCatalog.registeredEnums whole on every registration, so its identity is the version and checking it is a reference comparison.

A serializer base already has for an enum wins over the generated one.

Constructors

Link copied to clipboard
constructor(base: Json)

Functions

Link copied to clipboard
fun module(catalog: TypeCatalog): SerializersModule

The module on its own, for a Json the caller is building rather than one being converted with.

Link copied to clipboard
fun resolve(catalog: TypeCatalog): Json

base with the module folded in, or base itself where there is nothing to fold.