Attributes
Members list
Type members
Inherited types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Derive a Pickler instance for the given type, at compile-time. Depending on the derivation mode (auto / semi-auto), picklers for referenced types (e.g. via a field, enum case or subtype) will either be derived automatically, or will need to be provided manually.
Derive a Pickler instance for the given type, at compile-time. Depending on the derivation mode (auto / semi-auto), picklers for referenced types (e.g. via a field, enum case or subtype) will either be derived automatically, or will need to be provided manually.
This method can either be used explicitly, in the definition of a given
, or indirectly by adding a ... derives Pickler
modifier to a datatype definition.
The in-scope PicklerConfiguration instance is used to customise field names and other behavior.
Attributes
Creates a pickler for an enumeration, where the validator is derived using sttp.tapir.Validator.derivedEnumeration. This requires that this is an enum
, where all cases are parameterless, or that all subtypes of the sealed hierarchy T
are object
s.
Creates a pickler for an enumeration, where the validator is derived using sttp.tapir.Validator.derivedEnumeration. This requires that this is an enum
, where all cases are parameterless, or that all subtypes of the sealed hierarchy T
are object
s.
This method cannot be a given
, as there's no way to constraint the type T
to be an enum / sealed trait or class enumeration, so that this would be invoked only when necessary.
Attributes
Create a coproduct pickler (e.g. for an enum
or sealed trait
), where the value of the discriminator between child types is a read of a field of the base type. The field, if not yet present, is added to each child schema.
Create a coproduct pickler (e.g. for an enum
or sealed trait
), where the value of the discriminator between child types is a read of a field of the base type. The field, if not yet present, is added to each child schema.
The picklers for the child types have to be provided explicitly with their value mappings in mapping
.
Note that if the discriminator value is some transformation of the child's type name (obtained using the implicit PicklerConfiguration), the coproduct schema can be derived automatically or semi-automatically.
Value parameters
- discriminatorPickler
-
The pickler that is used when adding the discriminator as a field to child picklers (if it's not yet added).
Attributes
Create a pickler for a map with arbitrary keys. The pickler for the keys (Pickler[K]
) should be string-like (that is, the schema type should be sttp.tapir.SchemaType.SString), however this cannot be verified at compile-time and is not verified at run-time.
Create a pickler for a map with arbitrary keys. The pickler for the keys (Pickler[K]
) should be string-like (that is, the schema type should be sttp.tapir.SchemaType.SString), however this cannot be verified at compile-time and is not verified at run-time.
The given keyToString
conversion function is used during validation.
If you'd like this pickler to be available as a given type of keys, create an custom implicit, e.g.:
case class MyKey(value: String) extends AnyVal
given picklerForMyMap: Pickler[Map[MyKey, MyValue]] = Pickler.picklerForMap[MyKey, MyValue](_.value)