the function of mapping from string of case class field name to JSON key (an identity function by default)
the function of mapping from string of case class/object full name to string value of discriminator field (a function that truncate to simple class name by default)
an optional name of discriminator field, where None can be used for alternative representation of ADTs without the discriminator field (Some("type") value by default)
a flag that turn on stringification of number or boolean values of collections, options and value classes (turned off by default)
a flag that turn on skipping of unexpected fields or in other case a parse exception will be thrown (turned on by default)
an exclusive limit for accepted numeric values in bit sets (1024 by default)
an exclusive limit for accepted scale of 'BigDecimal' values (300 by default)
the function of mapping from string of case class/object full name to string value of discriminator field (a function that truncate to simple class name by default)
an exclusive limit for accepted scale of 'BigDecimal' values (300 by default)
an exclusive limit for accepted numeric values in bit sets (1024 by default)
an optional name of discriminator field, where None can be used for alternative representation of ADTs without the discriminator field (Some("type") value by default)
the function of mapping from string of case class field name to JSON key (an identity function by default)
a flag that turn on stringification of number or boolean values of collections, options and value classes (turned off by default)
a flag that turn on skipping of unexpected fields or in other case a parse exception will be thrown (turned on by default)
Configuration parameter for
JsonCodecMaker.make()
call.BEWARE:
fieldNameMapper
andadtLeafClassNameMapper
functions should not depend on code from the same compilation module where themake
macro is called. Use a separated submodule of the project to compile all such dependencies before their usage for generation of codecs.Examples of functions that have no dependencies in the same compilation module are:
JsonCodecMaker.enforceCamelCase
,JsonCodecMaker.enforce_snake_case
,JsonCodecMaker.enforce-kebab-case
, andJsonCodecMaker.simpleClassName
. Or their composition like:s => JsonCodecMaker.enforce_snake_case(JsonCodecMaker.simpleClassName(s))
the function of mapping from string of case class field name to JSON key (an identity function by default)
the function of mapping from string of case class/object full name to string value of discriminator field (a function that truncate to simple class name by default)
an optional name of discriminator field, where None can be used for alternative representation of ADTs without the discriminator field (Some("type") value by default)
a flag that turn on stringification of number or boolean values of collections, options and value classes (turned off by default)
a flag that turn on skipping of unexpected fields or in other case a parse exception will be thrown (turned on by default)
an exclusive limit for accepted numeric values in bit sets (1024 by default)
an exclusive limit for accepted scale of 'BigDecimal' values (300 by default)