JsonCodecMaker

class Object
trait Matchable
class Any

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

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

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

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

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

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

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.

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.

Mapping function for field or class names that should be in kebab-case format.

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.

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.

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

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.

Returns:

a provided value