Enumeration

sttp.tapir.Validator.Enumeration
case class Enumeration[T](possibleValues: List[T], encode: Option[() => T], name: Option[SName]) extends Primitive[T]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Primitive[T]
trait Validator[T]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def doValidate(t: T): ValidationResult

Attributes

Definition Classes
def encode(e: T => Any): Enumeration[T]

Specify how values of this type can be encoded to a raw value (typically a String). This encoding will be used when generating documentation.

Specify how values of this type can be encoded to a raw value (typically a String). This encoding will be used when generating documentation.

Attributes

def encodeWithCodec[CF <: CodecFormat](implicit c: Codec[String, T, CF]): Enumeration[T]

Specify that values of this type should be encoded to a raw value using an in-scope codec of the given format. This encoding will be used when generating documentation.

Specify that values of this type should be encoded to a raw value using an in-scope codec of the given format. This encoding will be used when generating documentation.

Attributes

def encodeWithPlainCodec(implicit c: PlainCodec[T]): Enumeration[T]

Specify that values of this type should be encoded to a raw value using an in-scope plain codec. This encoding will be used when generating documentation.

Specify that values of this type should be encoded to a raw value using an in-scope plain codec. This encoding will be used when generating documentation.

Attributes

Inherited methods

def and(other: Validator[T]): Validator[T]

Attributes

Inherited from:
Validator
override def apply(t: T): List[ValidationError[T]]

Attributes

Definition Classes
Inherited from:
Primitive
def contramap[TT](g: TT => T): Validator[TT]

Attributes

Inherited from:
Validator
def or(other: Validator[T]): Validator[T]

Attributes

Inherited from:
Validator
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def show: Option[String]

Attributes

Inherited from:
Validator