CreateDerivedEnumerationSchema

sttp.tapir.macros.CreateDerivedEnumerationSchema
class CreateDerivedEnumerationSchema[T](validator: Enumeration[T], schemaAnnotations: SchemaAnnotations[T])

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Constructors

def this(validator: Enumeration[T])

Concrete methods

def apply(encode: Option[T => Any], schemaType: SchemaType[T], default: Option[T]): Schema[T]

Attributes

encode

Specify how values of this type can be encoded to a raw value (typically a String; the raw form should correspond with schemaType). This encoding will be used when generating documentation. Defaults to an identity function, which effectively mean that .toString will be used to represent the enumeration in the docs.

schemaType

The low-level representation of the enumeration. Defaults to a string.

Creates the schema assuming the low-level representation is a String. The encoding function passes the object unchanged (which means .toString will be used to represent the enumeration in documentation).

Creates the schema assuming the low-level representation is a String. The encoding function passes the object unchanged (which means .toString will be used to represent the enumeration in documentation).

Attributes