const mixinafJson::JsonConverter

afJson::JsonConverter

@Js

Implement to convert custom Fantom types to / from a JSON representation.

fromJsonVal

Source

abstract Obj? fromJsonVal(Obj? jsonVal, JsonConverterCtx ctx)

Converts a JSON value to Fantom.

jsonVal is nullable so converters can create empty / default objects.

toJsonVal

Source

abstract Obj? toJsonVal(Obj? fantomObj, JsonConverterCtx ctx)

Converts a Fantom object to its JSON representation.

Must return a valid JSON value (or a List or Map thereof).

fantomObj is nullable so converters can create empty / default objects.