Attributes
- Companion
- object
- Source
- JsonCodecDeriver.scala
- Graph
-
- Supertypes
- Known subtypes
-
object JsonCodecDeriver
Members list
Type members
Types
Attributes
- Source
- JsonCodecDeriver.scala
Attributes
- Source
- JsonCodecDeriver.scala
Attributes
- Source
- JsonCodecDeriver.scala
Attributes
- Source
- JsonCodecDeriver.scala
Attributes
- Source
- JsonCodecDeriver.scala
Attributes
- Source
- JsonCodecDeriver.scala
Attributes
- Source
- JsonCodecDeriver.scala
Inherited types
Attributes
- Inherited from:
- Deriver
- Source
- Deriver.scala
Value members
Concrete methods
Attributes
- Definition Classes
- Source
- JsonCodecDeriver.scala
Attributes
- Definition Classes
- Source
- JsonCodecDeriver.scala
Attributes
- Definition Classes
- Source
- JsonCodecDeriver.scala
Attributes
- Definition Classes
- Source
- JsonCodecDeriver.scala
Attributes
- Definition Classes
- Source
- JsonCodecDeriver.scala
Attributes
- Definition Classes
- Source
- JsonCodecDeriver.scala
Attributes
- Source
- JsonCodecDeriver.scala
Attributes
- Definition Classes
- Source
- JsonCodecDeriver.scala
Updates the JsonCodecDeriver instance with the specified case name mapper. The case name mapper defines how case names should be transformed during encoding and decoding.
Updates the JsonCodecDeriver instance with the specified case name mapper. The case name mapper defines how case names should be transformed during encoding and decoding.
Value parameters
- caseNameMapper
-
The
NameMapperto apply for transforming case names.
Attributes
- Returns
-
A new instance of
JsonCodecDeriverwith the updated case name mapper. - Source
- JsonCodecDeriver.scala
Updates the JsonCodecDeriver instance with the specified discriminator kind. The discriminator kind defines how the subtype discriminator is represented in the serialized JSON.
Updates the JsonCodecDeriver instance with the specified discriminator kind. The discriminator kind defines how the subtype discriminator is represented in the serialized JSON.
Value parameters
- discriminatorKind
-
The
DiscriminatorKindto apply for specifying how the discriminator is handled in the JSON schema for sealed hierarchies.
Attributes
- Returns
-
A new instance of
JsonCodecDeriverwith the updated discriminator kind. - Source
- JsonCodecDeriver.scala
Updates the JsonCodecDeriver instance to specify whether enumeration values should be serialized and deserialized as strings.
Updates the JsonCodecDeriver instance to specify whether enumeration values should be serialized and deserialized as strings.
Value parameters
- enumValuesAsStrings
-
A boolean flag indicating whether to treat enumeration values as strings. If
true, enumeration values are serialized and deserialized as their string representations; iffalse, they are encoded with defaultDiscriminatorKind.Keyencoding.
Attributes
- Returns
-
A new instance of
JsonCodecDeriverwith the updatedenumValuesAsStringssetting. - Source
- JsonCodecDeriver.scala
Updates the JsonCodecDeriver instance with the specified field name mapper. The field name mapper defines how field names should be transformed during encoding and decoding.
Updates the JsonCodecDeriver instance with the specified field name mapper. The field name mapper defines how field names should be transformed during encoding and decoding.
Value parameters
- fieldNameMapper
-
The
NameMapperto apply for transforming field names.
Attributes
- Returns
-
A new instance of
JsonCodecDeriverwith the updated field name mapper. - Source
- JsonCodecDeriver.scala
Updates the JsonCodecDeriver instance to specify whether additional fields in the JSON input that are not part of the schema should be rejected during decoding.
Updates the JsonCodecDeriver instance to specify whether additional fields in the JSON input that are not part of the schema should be rejected during decoding.
Value parameters
- rejectExtraFields
-
A boolean flag indicating whether to reject extra fields that are not defined in the schema. If
true, decoding will fail when extra fields are encountered; iffalse, extra fields will be ignored.
Attributes
- Returns
-
A new instance of
JsonCodecDeriverwith the updatedrejectExtraFieldssetting. - Source
- JsonCodecDeriver.scala
Sets the flag indicating whether collection fields are required.
Sets the flag indicating whether collection fields are required.
Value parameters
- requireCollectionFields
-
A boolean value specifying if collection fields should be required.
Attributes
- Returns
-
A new instance of JsonCodecDeriver with the updated configuration.
- Source
- JsonCodecDeriver.scala
Sets the flag indicating whether fields with default values are required.
Sets the flag indicating whether fields with default values are required.
Value parameters
- requireDefaultValueFields
-
A boolean flag indicating whether fields with default values should be required.
Attributes
- Returns
-
A new instance of
JsonCodecDeriverwith the updated configuration. - Source
- JsonCodecDeriver.scala
Sets the requirement for optional fields (Option and Maybe).
Sets the requirement for optional fields (Option and Maybe).
Value parameters
- requireOptionFields
-
A boolean flag indicating whether optional fields (
OptionandMaybe) are required. If true, these fields must be present in the JSON input and will not be treated as optional during codec derivation.
Attributes
- Returns
-
A new instance of JsonCodecDeriver with the updated setting for requiring optional fields.
- Source
- JsonCodecDeriver.scala
Sets the transient behavior for fields with defined default values.
Sets the transient behavior for fields with defined default values.
Value parameters
- transientDefaultValue
-
A boolean indicating whether the transient behavior for fields with defined default values should be applied or not.
Attributes
- Returns
-
A new instance of JsonCodecDeriver with the specified transient default value setting.
- Source
- JsonCodecDeriver.scala
Configures whether the derived codec should handle empty collections as transient.
Configures whether the derived codec should handle empty collections as transient.
Value parameters
- transientEmptyCollection
-
Indicates if empty collections should be treated as transient.
Attributes
- Returns
-
A new instance of JsonCodecDeriver with the updated transientEmptyCollection setting.
- Source
- JsonCodecDeriver.scala
Updates the JsonCodecDeriver instance to specify whether fields of type Option with a value of None or Maybe with an absent value should be excluded during encoding.
Updates the JsonCodecDeriver instance to specify whether fields of type Option with a value of None or Maybe with an absent value should be excluded during encoding.
Value parameters
- transientNone
-
A boolean flag indicating whether to exclude fields of type
Optionwith a value ofNone(orMaybewith an absent value) during encoding. Iftrue, such fields are omitted; iffalse, they are included.
Attributes
- Returns
-
A new instance of
JsonCodecDeriverwith the updatedtransientNonesetting. - Source
- JsonCodecDeriver.scala
Inherited methods
Attributes
- Inherited from:
- Deriver
- Source
- Deriver.scala
Attributes
- Inherited from:
- Deriver
- Source
- Deriver.scala
Attributes
- Inherited from:
- Deriver
- Source
- Deriver.scala
Returns a new deriver that pre-registers a field-level instance override. During derivation, the field named termName inside the parent record/variant identified by typeId will use the supplied instance instead of deriving one.
Returns a new deriver that pre-registers a field-level instance override. During derivation, the field named termName inside the parent record/variant identified by typeId will use the supplied instance instead of deriving one.
This is a medium-precision override between optic-based (exact path) and type-based (all occurrences).
Type parameters
- A
-
the parent record or variant type that owns the field
- B
-
the type of the field being overridden. Note that
Bis not statically checked against the actual field type; a mismatch will surface as a runtime error during codec use, not at derivation time.
Value parameters
- instance
-
the custom type-class instance for the field (evaluated lazily)
- termName
-
the name of the field (or variant case) to override. If no field with this name exists in the target type, the override is silently ignored during derivation (matching
DerivationBuilder.instancebehaviour). - typeId
-
identifier for the parent type
A
Attributes
- Returns
-
a new
Deriverthat wraps this deriver with the additional override - Inherited from:
- Deriver
- Source
- Deriver.scala
Returns a new deriver that pre-registers a type-level instance override. During derivation, every occurrence of type A will use the supplied instance instead of deriving one.
Returns a new deriver that pre-registers a type-level instance override. During derivation, every occurrence of type A will use the supplied instance instead of deriving one.
When the returned deriver is passed to DerivationBuilder, deriver-level instance overrides take precedence over builder-level instance overrides for the same target because DerivationBuilder.derive merges them as builderOverrides ++ deriver.instanceOverrides and later entries win in the resulting .toMap.
Type parameters
- A
-
the type whose derived instance should be replaced
Value parameters
- instance
-
the custom type-class instance (evaluated lazily)
- typeId
-
implicit identifier for
A, used to match occurrences during derivation
Attributes
- Returns
-
a new
Deriverthat wraps this deriver with the additional override - Inherited from:
- Deriver
- Source
- Deriver.scala
Returns a new deriver that pre-registers a term-level modifier override. During derivation, the field named termName inside the parent type identified by typeId will have the modifier applied.
Returns a new deriver that pre-registers a term-level modifier override. During derivation, the field named termName inside the parent type identified by typeId will have the modifier applied.
Type parameters
- A
-
the parent record or variant type that owns the field
Value parameters
- modifier
-
the term-level modifier to apply
- termName
-
the name of the field (or variant case) to modify. If no field with this name exists in the target type, the override is silently ignored.
- typeId
-
identifier for
A
Attributes
- Returns
-
a new
Deriverthat wraps this deriver with the additional override - Inherited from:
- Deriver
- Source
- Deriver.scala
Returns a new deriver that pre-registers a reflect-level modifier override. During derivation, every occurrence of the type identified by typeId will have the modifier prepended to its modifiers.
Returns a new deriver that pre-registers a reflect-level modifier override. During derivation, every occurrence of the type identified by typeId will have the modifier prepended to its modifiers.
Type parameters
- A
-
the type to attach the modifier to
Value parameters
- modifier
-
the reflect-level modifier to prepend
- typeId
-
identifier for
A
Attributes
- Returns
-
a new
Deriverthat wraps this deriver with the additional override - Inherited from:
- Deriver
- Source
- Deriver.scala