- Companion
- class
Type members
Value members
Concrete methods
- Value Params
- defaultPartCodec
Default codec to use for parts which are not defined in
partCodecs
.None
, if extra parts should be discarded.- partCodecs
For each supported part, a (raw body type, codec) pair which encodes the part value into a raw value of the given type. A single part value might be encoded as multiple (or none) raw values.
Inherited methods
Creates a codec for an enumeration, where the validator is derived using sttp.tapir.Validator.derivedEnumeration. This requires
that all subtypes of the sealed hierarchy T
must be object
s.
Creates a codec for an enumeration, where the validator is derived using sttp.tapir.Validator.derivedEnumeration. This requires
that all subtypes of the sealed hierarchy T
must be object
s.
- Type Params
- L
The type of the low-level representation of the enum, typically a String or an Int.
- T
The type of the enum.
- Value Params
- decode
How low-level values are decoded to the enum value.
None
if the low-level value is invalid, that is, when there's no high-level enum value.- encode
How the enum value is encoded as a low-level value.
- Inherited from
- CodecMacros
Create a codec which during decoding, first tries to decode values on the left using c1
. If this fails for any reason, decoding is
done using c2
. Both codecs must have the same low-level values and formats.
Create a codec which during decoding, first tries to decode values on the left using c1
. If this fails for any reason, decoding is
done using c2
. Both codecs must have the same low-level values and formats.
For a right-biased variant see Codec.eitherRight.
The schema is defined to be an either schema as created by Schema.schemaForEither.
- Inherited from
- LowPriorityCodec
Givens
Inherited givens
Implicits
Implicits
A codec which expects only binary and close frames (all other frames cause a decoding error). Close frames correspond to None
, while
text frames are handled using the given byteArrayCodec
and wrapped with Some
.
A codec which expects only binary and close frames (all other frames cause a decoding error). Close frames correspond to None
, while
text frames are handled using the given byteArrayCodec
and wrapped with Some
.
A codec which expects only binary frames (all other frames cause a decoding error) and handles the text using the given
byteArrayCodec
.
A codec which expects only binary frames (all other frames cause a decoding error) and handles the text using the given
byteArrayCodec
.
Create a codec which decodes/encodes a list of low-level values to a list of high-level values, using the given base codec c
.
Create a codec which decodes/encodes a list of low-level values to a list of high-level values, using the given base codec c
.
The schema is copied from the base codec.
Create a codec which requires that a list of low-level values contains a single element. Otherwise a decode failure is returned. The
given base codec c
is used for decoding/encoding.
Create a codec which requires that a list of low-level values contains a single element. Otherwise a decode failure is returned. The
given base codec c
is used for decoding/encoding.
The schema and validator are copied from the base codec.
Create a codec which requires that a list of low-level values is empty or contains a single element. If it contains multiple elements,
a decode failure is returned. The given base codec c
is used for decoding/encoding.
Create a codec which requires that a list of low-level values is empty or contains a single element. If it contains multiple elements,
a decode failure is returned. The given base codec c
is used for decoding/encoding.
The schema and validator are copied from the base codec.
Create a codec which decodes/encodes an optional low-level value to an optional high-level value. The given base codec c
is used for
decoding/encoding.
Create a codec which decodes/encodes an optional low-level value to an optional high-level value. The given base codec c
is used for
decoding/encoding.
The schema and validator are copied from the base codec.
Create a codec which requires that an optional low-level value is defined. If it is None
, a decode failure is returned. The given
base codec c
is used for decoding/encoding.
Create a codec which requires that an optional low-level value is defined. If it is None
, a decode failure is returned. The given
base codec c
is used for decoding/encoding.
The schema and validator are copied from the base codec.
Create a codec which decodes/encodes a list of low-level values to a set of high-level values, using the given base codec c
.
Create a codec which decodes/encodes a list of low-level values to a set of high-level values, using the given base codec c
.
The schema is copied from the base codec.
A codec which expects only text and close frames (all other frames cause a decoding error). Close frames correspond to None
, while
text frames are handled using the given stringCodec
and wrapped with Some
.
A codec which expects only text and close frames (all other frames cause a decoding error). Close frames correspond to None
, while
text frames are handled using the given stringCodec
and wrapped with Some
.
A codec which expects only text frames (all other frames cause a decoding error) and handles the text using the given stringCodec
.
A codec which expects only text frames (all other frames cause a decoding error) and handles the text using the given stringCodec
.
Create a codec which decodes/encodes a list of low-level values to a vector of high-level values, using the given base codec c
.
Create a codec which decodes/encodes a list of low-level values to a vector of high-level values, using the given base codec c
.
The schema and validator are copied from the base codec.
Inherited implicits
Create a codec which during decoding, first tries to decode values on the right using c2
. If this fails for any reason, decoding is
done using c1
. Both codecs must have the same low-level values and formats.
Create a codec which during decoding, first tries to decode values on the right using c2
. If this fails for any reason, decoding is
done using c1
. Both codecs must have the same low-level values and formats.
For a left-biased variant see Codec.eitherLeft. This right-biased version is the default when using implicit codec resolution.
The schema is defined to be an either schema as created by Schema.schemaForEither.
- Inherited from
- LowPriorityCodec