JsonCodecMaker

com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

inline def make[A]: JsonValueCodec[A]

Derives a codec for JSON values for the specified type A.

Derives a codec for JSON values for the specified type A.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Attributes

Returns

an instance of the derived codec

inline def make[A](inline config: CodecMakerConfig): JsonValueCodec[A]

Derives a codec for JSON values for the specified type A and a provided derivation configuration.

Derives a codec for JSON values for the specified type A and a provided derivation configuration.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Value parameters

config

a derivation configuration

Attributes

Returns

an instance of the derived codec

inline def makeCirceLike[A]: JsonValueCodec[A]

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withTransientDefault(false).withTransientNone(false).withDiscriminatorFieldName(None) configuration parameter.

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withTransientDefault(false).withTransientNone(false).withDiscriminatorFieldName(None) configuration parameter.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Attributes

Returns

an instance of the derived codec

inline def makeCirceLikeSnakeCased[A]: JsonValueCodec[A]

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withTransientDefault(false).withTransientNone(false).withDiscriminatorFieldName(None).withAdtLeafClassNameMapper(x => enforce_snake_case(simpleClassName(x))).withFieldNameMapper(enforce_snake_case).withJavaEnumValueNameMapper(enforce_snake_case) configuration parameter.

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withTransientDefault(false).withTransientNone(false).withDiscriminatorFieldName(None).withAdtLeafClassNameMapper(x => enforce_snake_case(simpleClassName(x))).withFieldNameMapper(enforce_snake_case).withJavaEnumValueNameMapper(enforce_snake_case) configuration parameter.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Attributes

Returns

an instance of the derived codec

inline def makeWithRequiredCollectionFields[A]: JsonValueCodec[A]

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withRequireCollectionFields(true) configuration parameter.

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withRequireCollectionFields(true) configuration parameter.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Attributes

Returns

an instance of the derived codec

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withRequireCollectionFields(true).withDiscriminatorFieldName(Some("name")) configuration parameter.

A replacement for the make call with the CodecMakerConfig.withTransientEmpty(false).withRequireCollectionFields(true).withDiscriminatorFieldName(Some("name")) configuration parameter.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Attributes

Returns

an instance of the derived codec

inline def makeWithRequiredDefaultFields[A]: JsonValueCodec[A]

A replacement for the make call with the CodecMakerConfig.withTransientDefault(false).withRequireDefaultFields(true) configuration parameter.

A replacement for the make call with the CodecMakerConfig.withTransientDefault(false).withRequireDefaultFields(true) configuration parameter.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Attributes

Returns

an instance of the derived codec

inline def makeWithoutDiscriminator[A]: JsonValueCodec[A]

A replacement for the make call with the CodecMakerConfig.withDiscriminatorFieldName(None) configuration parameter.

A replacement for the make call with the CodecMakerConfig.withDiscriminatorFieldName(None) configuration parameter.

Type parameters

A

a type that should be encoded and decoded by the derived codec

Attributes

Returns

an instance of the derived codec

def simpleClassName(fullClassName: String): String

Mapping function for class names that should be trimmed to the simple class name without package prefix.

Mapping function for class names that should be trimmed to the simple class name without package prefix.

Value parameters

fullClassName

the name to transform

Attributes

Returns

a transformed name or the same name if no transformation is required

Concrete fields

val EnforcePascalCase: PartialFunction[String, String]

Mapping function for field or class names that should be in PascalCase format.

Mapping function for field or class names that should be in PascalCase format.

Attributes

Returns

a transformed name or the same name if no transformation is required

val enforce-kebab-case: PartialFunction[String, String]

Mapping function for field or class names that should be in kebab-case format with separated non-alphabetic characters.

Mapping function for field or class names that should be in kebab-case format with separated non-alphabetic characters.

Attributes

Returns

a transformed name or the same name if no transformation is required

val enforce-kebab-case2: PartialFunction[String, String]

Mapping function for field or class names that should be in kebab-case format with joined non-alphabetic characters.

Mapping function for field or class names that should be in kebab-case format with joined non-alphabetic characters.

Attributes

Returns

a transformed name or the same name if no transformation is required

val enforceCamelCase: PartialFunction[String, String]

Mapping function for field or class names that should be in camelCase format.

Mapping function for field or class names that should be in camelCase format.

Attributes

Returns

a transformed name or the same name if no transformation is required

val enforce_snake_case: PartialFunction[String, String]

Mapping function for field or class names that should be in snake_case format with separated non-alphabetic characters.

Mapping function for field or class names that should be in snake_case format with separated non-alphabetic characters.

Attributes

Returns

a transformed name or the same name if no transformation is required

val enforce_snake_case2: PartialFunction[String, String]

Mapping function for field or class names that should be in snake_case format with joined non-alphabetic characters.

Mapping function for field or class names that should be in snake_case format with joined non-alphabetic characters.

Attributes

Returns

a transformed name or the same name if no transformation is required

val partialIdentity: PartialFunction[String, String]

A partial function that is a total in fact and always returns a string passed to it.

A partial function that is a total in fact and always returns a string passed to it.

Attributes

Returns

a provided value