Schema

Companion
class
trait Product
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

case
class SName(fullName: String, typeParameterShortNames: List[String])
Companion
object
object SName
Companion
class

Annotations which are used during automatic schema derivation, or semi-automatic schema derivation using Schema.derived.

Annotations which are used during automatic schema derivation, or semi-automatic schema derivation using Schema.derived.

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from
Mirror

Value members

Concrete methods

def binary[T]: Schema[T]

Creates a schema for type T, where the low-level representation is binary.

Creates a schema for type T, where the low-level representation is binary.

def string[T]: Schema[T]

Creates a schema for type T, where the low-level representation is a String.

Creates a schema for type T, where the low-level representation is a String.

Inherited methods

inline
def derived[T](using genericDerivationConfig: Configuration, m: Of[T]): Schema[T]
inline
def derivedEnumeration[T](encode: Option[T => Any], schemaType: SchemaType[T], default: Option[T]): Schema[T]

Creates a schema 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 objects.

Creates a schema 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 objects.

Value Params
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.

schemaType

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

Inherited from
SchemaCompanionMacros
inline
def oneOfUsingField[E, V](inline extractor: E => V, asString: V => String)(mapping: (V, Schema[_])*)(implicit conf: Configuration): Schema[E]
Inherited from
SchemaCompanionMacros
inline
def schemaForMap[K : Schema, V : Schema](keyToString: K => String): Schema[Map[K, V]]

Create a schema for a map with arbitrary keys. The schema for the keys (Schema[K]) should be a string (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 schema for a map with arbitrary keys. The schema for the keys (Schema[K]) should be a string (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 schema to be available as an implicit for a given type of keys, create an custom implicit, e.g.:

case class MyKey(value: String) extends AnyVal
implicit val schemaForMyMap = Schema.schemaForMap[MyKey, MyValue](_.value)
Inherited from
SchemaCompanionMacros

Concrete fields

Implicits

Implicits

implicit
def schemaForArray[T : Schema]: Schema[Array[T]]
implicit
val schemaForBigDecimal: Schema[BigDecimal]
implicit
val schemaForBigInt: Schema[BigInt]
implicit
val schemaForBoolean: Schema[Boolean]
implicit
implicit
val schemaForByteArray: Schema[Array[Byte]]
implicit
val schemaForByteBuffer: Schema[ByteBuffer]
implicit
implicit
val schemaForDouble: Schema[Double]
implicit
def schemaForEither[A, B](implicit sa: Schema[A], sb: Schema[B]): Schema[Either[A, B]]
implicit
implicit
val schemaForInputStream: Schema[InputStream]
implicit
val schemaForInstant: Schema[Instant]
implicit
implicit
def schemaForIterable[T : Schema, C <: (Iterable)]: Schema[C[T]]
implicit
val schemaForJBigDecimal: Schema[BigDecimal]
implicit
val schemaForJBigInteger: Schema[BigInteger]
implicit
implicit
val schemaForLocalDate: Schema[LocalDate]
implicit
val schemaForLocalDateTime: Schema[LocalDateTime]
implicit
val schemaForLocalTime: Schema[LocalTime]
implicit
implicit
val schemaForOffsetDateTime: Schema[OffsetDateTime]
implicit
val schemaForOffsetTime: Schema[OffsetTime]
implicit
def schemaForOption[T : Schema]: Schema[Option[T]]
implicit
def schemaForPart[T : Schema]: Schema[Part[T]]
implicit
implicit
implicit
val schemaForString: Schema[String]
implicit
implicit
implicit
val schemaForZoneOffset: Schema[ZoneOffset]
implicit
val schemaForZonedDateTime: Schema[ZonedDateTime]

Inherited implicits

implicit
def derivedSchema[T](implicit derived: Derived[Schema[T]]): Schema[T]
Inherited from
LowPrioritySchema
implicit inline
def schemaForMap[V : Schema]: Schema[Map[String, V]]
Inherited from
SchemaCompanionMacros