Schema

@implicitNotFound(msg = "Could not find Schema for type ${T}.\nAutomatic derivation requires the following import: `import sttp.tapir.generic.auto._`\nYou can find more details in the docs: https://tapir.softwaremill.com/en/latest/endpoint/schemas.html#schema-derivation\nWhen using datatypes integration remember to import respective schemas/codecs as described in https://tapir.softwaremill.com/en/latest/endpoint/integrations.html")
case class Schema[T](schemaType: SchemaType[T], name: Option[SName], isOptional: Boolean, description: Option[String], default: Option[(T, Option[Any])], format: Option[String], encodedExample: Option[Any], deprecated: Boolean, hidden: Boolean, validator: Validator[T], attributes: AttributeMap) extends SchemaMacros[T]

Describes the type T: its low-level representation, meta-data and validation rules.

Value parameters:
format

The name of the format of the low-level representation of T.

Companion:
object
trait Serializable
trait Product
trait Equals
trait SchemaMacros[T]
class Object
trait Matchable
class Any

Value members

Concrete methods

def applyValidation(t: T): List[ValidationError[_]]
Implicitly added by schemaForArray

Apply defined validation rules to the given value.

Apply defined validation rules to the given value.

def applyValidation(t: T): List[ValidationError[_]]
Implicitly added by schemaForIterable

Apply defined validation rules to the given value.

Apply defined validation rules to the given value.

def applyValidation(t: T): List[ValidationError[_]]
Implicitly added by schemaForMap

Apply defined validation rules to the given value.

Apply defined validation rules to the given value.

def applyValidation(t: T): List[ValidationError[_]]
Implicitly added by schemaForOption

Apply defined validation rules to the given value.

Apply defined validation rules to the given value.

def applyValidation(t: T): List[ValidationError[_]]
Implicitly added by schemaForPart

Apply defined validation rules to the given value.

Apply defined validation rules to the given value.

def applyValidation(t: T): List[ValidationError[_]]

Apply defined validation rules to the given value.

Apply defined validation rules to the given value.

def as[TT]: Schema[TT]
Implicitly added by schemaForArray

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

  • traversing collection elements, product fields, or coproduct subtypes
  • validating an instance of type TT the top-level type is lost.
def as[TT]: Schema[TT]
Implicitly added by schemaForIterable

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

  • traversing collection elements, product fields, or coproduct subtypes
  • validating an instance of type TT the top-level type is lost.
def as[TT]: Schema[TT]
Implicitly added by schemaForMap

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

  • traversing collection elements, product fields, or coproduct subtypes
  • validating an instance of type TT the top-level type is lost.
def as[TT]: Schema[TT]
Implicitly added by schemaForOption

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

  • traversing collection elements, product fields, or coproduct subtypes
  • validating an instance of type TT the top-level type is lost.
def as[TT]: Schema[TT]
Implicitly added by schemaForPart

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

  • traversing collection elements, product fields, or coproduct subtypes
  • validating an instance of type TT the top-level type is lost.
def as[TT]: Schema[TT]

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

Adapt this schema to type TT. Only the meta-data is retained, except for default values and the validator (however, product field/subtypes validators are retained). Run-time functionality:

  • traversing collection elements, product fields, or coproduct subtypes
  • validating an instance of type TT the top-level type is lost.
def asArray: Schema[Array[T]]
Implicitly added by schemaForArray

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asArray: Schema[Array[T]]
Implicitly added by schemaForIterable

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asArray: Schema[Array[T]]
Implicitly added by schemaForMap

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asArray: Schema[Array[T]]
Implicitly added by schemaForOption

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asArray: Schema[Array[T]]
Implicitly added by schemaForPart

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asArray: Schema[Array[T]]

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns an array version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asIterable[C <: (Iterable)]: Schema[C[T]]
Implicitly added by schemaForArray

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asIterable[C <: (Iterable)]: Schema[C[T]]
Implicitly added by schemaForIterable

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asIterable[C <: (Iterable)]: Schema[C[T]]
Implicitly added by schemaForMap

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asIterable[C <: (Iterable)]: Schema[C[T]]
Implicitly added by schemaForOption

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asIterable[C <: (Iterable)]: Schema[C[T]]
Implicitly added by schemaForPart

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asIterable[C <: (Iterable)]: Schema[C[T]]

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

Returns a collection version of this schema, with the schema type wrapped in SArray. Sets isOptional to true as the collection might be empty.

def asOption: Schema[Option[T]]
Implicitly added by schemaForArray

Returns an optional version of this schema, with isOptional set to true.

Returns an optional version of this schema, with isOptional set to true.

def asOption: Schema[Option[T]]
Implicitly added by schemaForIterable

Returns an optional version of this schema, with isOptional set to true.

Returns an optional version of this schema, with isOptional set to true.

def asOption: Schema[Option[T]]
Implicitly added by schemaForMap

Returns an optional version of this schema, with isOptional set to true.

Returns an optional version of this schema, with isOptional set to true.

def asOption: Schema[Option[T]]
Implicitly added by schemaForOption

Returns an optional version of this schema, with isOptional set to true.

Returns an optional version of this schema, with isOptional set to true.

def asOption: Schema[Option[T]]
Implicitly added by schemaForPart

Returns an optional version of this schema, with isOptional set to true.

Returns an optional version of this schema, with isOptional set to true.

def asOption: Schema[Option[T]]

Returns an optional version of this schema, with isOptional set to true.

Returns an optional version of this schema, with isOptional set to true.

def attribute[A](k: AttributeKey[A]): Option[A]
Implicitly added by schemaForArray
def attribute[A](k: AttributeKey[A], v: A): Schema[T]
Implicitly added by schemaForArray
def attribute[A](k: AttributeKey[A]): Option[A]
Implicitly added by schemaForIterable
def attribute[A](k: AttributeKey[A], v: A): Schema[T]
Implicitly added by schemaForIterable
def attribute[A](k: AttributeKey[A]): Option[A]
Implicitly added by schemaForMap
def attribute[A](k: AttributeKey[A], v: A): Schema[T]
Implicitly added by schemaForMap
def attribute[A](k: AttributeKey[A]): Option[A]
Implicitly added by schemaForOption
def attribute[A](k: AttributeKey[A], v: A): Schema[T]
Implicitly added by schemaForOption
def attribute[A](k: AttributeKey[A]): Option[A]
Implicitly added by schemaForPart
def attribute[A](k: AttributeKey[A], v: A): Schema[T]
Implicitly added by schemaForPart
def attribute[A](k: AttributeKey[A]): Option[A]
def attribute[A](k: AttributeKey[A], v: A): Schema[T]
def default(t: T, encoded: Option[Any]): Schema[T]
Implicitly added by schemaForArray

Adds a default value, which is used by Codec s during decoding and for documentation.

Adds a default value, which is used by Codec s during decoding and for documentation.

To represent the value in the documentation, an encoded form needs to be provided. The encoded form is inferred if missing and the given value is of a basic type (number, string, etc.).

def default(t: T, encoded: Option[Any]): Schema[T]
Implicitly added by schemaForIterable

Adds a default value, which is used by Codec s during decoding and for documentation.

Adds a default value, which is used by Codec s during decoding and for documentation.

To represent the value in the documentation, an encoded form needs to be provided. The encoded form is inferred if missing and the given value is of a basic type (number, string, etc.).

def default(t: T, encoded: Option[Any]): Schema[T]
Implicitly added by schemaForMap

Adds a default value, which is used by Codec s during decoding and for documentation.

Adds a default value, which is used by Codec s during decoding and for documentation.

To represent the value in the documentation, an encoded form needs to be provided. The encoded form is inferred if missing and the given value is of a basic type (number, string, etc.).

def default(t: T, encoded: Option[Any]): Schema[T]
Implicitly added by schemaForOption

Adds a default value, which is used by Codec s during decoding and for documentation.

Adds a default value, which is used by Codec s during decoding and for documentation.

To represent the value in the documentation, an encoded form needs to be provided. The encoded form is inferred if missing and the given value is of a basic type (number, string, etc.).

def default(t: T, encoded: Option[Any]): Schema[T]
Implicitly added by schemaForPart

Adds a default value, which is used by Codec s during decoding and for documentation.

Adds a default value, which is used by Codec s during decoding and for documentation.

To represent the value in the documentation, an encoded form needs to be provided. The encoded form is inferred if missing and the given value is of a basic type (number, string, etc.).

def default(t: T, encoded: Option[Any]): Schema[T]

Adds a default value, which is used by Codec s during decoding and for documentation.

Adds a default value, which is used by Codec s during decoding and for documentation.

To represent the value in the documentation, an encoded form needs to be provided. The encoded form is inferred if missing and the given value is of a basic type (number, string, etc.).

def deprecated(d: Boolean): Schema[T]
Implicitly added by schemaForArray
def deprecated(d: Boolean): Schema[T]
Implicitly added by schemaForIterable
def deprecated(d: Boolean): Schema[T]
Implicitly added by schemaForMap
def deprecated(d: Boolean): Schema[T]
Implicitly added by schemaForOption
def deprecated(d: Boolean): Schema[T]
Implicitly added by schemaForPart
def deprecated(d: Boolean): Schema[T]
def description(d: String): Schema[T]
Implicitly added by schemaForArray
def description(d: String): Schema[T]
Implicitly added by schemaForIterable
def description(d: String): Schema[T]
Implicitly added by schemaForMap
def description(d: String): Schema[T]
Implicitly added by schemaForOption
def description(d: String): Schema[T]
Implicitly added by schemaForPart
def description(d: String): Schema[T]
def encodedExample(e: Any): Schema[T]
Implicitly added by schemaForArray
def encodedExample(e: Any): Schema[T]
Implicitly added by schemaForIterable
def encodedExample(e: Any): Schema[T]
Implicitly added by schemaForMap
def encodedExample(e: Any): Schema[T]
Implicitly added by schemaForOption
def encodedExample(e: Any): Schema[T]
Implicitly added by schemaForPart
def encodedExample(e: Any): Schema[T]
def format(f: String): Schema[T]
Implicitly added by schemaForArray
def format(f: String): Schema[T]
Implicitly added by schemaForIterable
def format(f: String): Schema[T]
Implicitly added by schemaForMap
def format(f: String): Schema[T]
Implicitly added by schemaForOption
def format(f: String): Schema[T]
Implicitly added by schemaForPart
def format(f: String): Schema[T]
def hidden(h: Boolean): Schema[T]
Implicitly added by schemaForArray
def hidden(h: Boolean): Schema[T]
Implicitly added by schemaForIterable
def hidden(h: Boolean): Schema[T]
Implicitly added by schemaForMap
def hidden(h: Boolean): Schema[T]
Implicitly added by schemaForOption
def hidden(h: Boolean): Schema[T]
Implicitly added by schemaForPart
def hidden(h: Boolean): Schema[T]
def map[TT](f: T => Option[TT])(g: TT => T): Schema[TT]
Implicitly added by schemaForArray
def map[TT](f: T => Option[TT])(g: TT => T): Schema[TT]
Implicitly added by schemaForIterable
def map[TT](f: T => Option[TT])(g: TT => T): Schema[TT]
Implicitly added by schemaForMap
def map[TT](f: T => Option[TT])(g: TT => T): Schema[TT]
Implicitly added by schemaForOption
def map[TT](f: T => Option[TT])(g: TT => T): Schema[TT]
Implicitly added by schemaForPart
def map[TT](f: T => Option[TT])(g: TT => T): Schema[TT]
def modifyUnsafe[U](fields: String*)(modify: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForArray
def modifyUnsafe[U](fields: String*)(modify: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForIterable
def modifyUnsafe[U](fields: String*)(modify: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForMap
def modifyUnsafe[U](fields: String*)(modify: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForOption
def modifyUnsafe[U](fields: String*)(modify: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForPart
def modifyUnsafe[U](fields: String*)(modify: Schema[U] => Schema[U]): Schema[T]
def name(name: SName): Schema[T]
Implicitly added by schemaForArray
def name(name: Option[SName]): Schema[T]
Implicitly added by schemaForArray
def name(name: SName): Schema[T]
Implicitly added by schemaForIterable
def name(name: Option[SName]): Schema[T]
Implicitly added by schemaForIterable
def name(name: SName): Schema[T]
Implicitly added by schemaForMap
def name(name: Option[SName]): Schema[T]
Implicitly added by schemaForMap
def name(name: SName): Schema[T]
Implicitly added by schemaForOption
def name(name: Option[SName]): Schema[T]
Implicitly added by schemaForOption
def name(name: SName): Schema[T]
Implicitly added by schemaForPart
def name(name: Option[SName]): Schema[T]
Implicitly added by schemaForPart
def name(name: SName): Schema[T]
def name(name: Option[SName]): Schema[T]
def show: String
Implicitly added by schemaForArray
def show: String
Implicitly added by schemaForIterable
def show: String
Implicitly added by schemaForMap
def show: String
Implicitly added by schemaForOption
def show: String
Implicitly added by schemaForPart
def show: String
def showValidators: Option[String]
Implicitly added by schemaForArray
def showValidators: Option[String]
Implicitly added by schemaForIterable
def showValidators: Option[String]
Implicitly added by schemaForMap
def showValidators: Option[String]
Implicitly added by schemaForOption
def showValidators: Option[String]
Implicitly added by schemaForPart
def showValidators: Option[String]
def validate(v: Validator[T]): Schema[T]
Implicitly added by schemaForArray

Add a validator to this schema. If the validator contains a named enum validator:

Add a validator to this schema. If the validator contains a named enum validator:

  • the encode function is inferred if not yet defined, and the validators possible values are of a basic type
  • the name is set as the schema's name.
def validate(v: Validator[T]): Schema[T]
Implicitly added by schemaForIterable

Add a validator to this schema. If the validator contains a named enum validator:

Add a validator to this schema. If the validator contains a named enum validator:

  • the encode function is inferred if not yet defined, and the validators possible values are of a basic type
  • the name is set as the schema's name.
def validate(v: Validator[T]): Schema[T]
Implicitly added by schemaForMap

Add a validator to this schema. If the validator contains a named enum validator:

Add a validator to this schema. If the validator contains a named enum validator:

  • the encode function is inferred if not yet defined, and the validators possible values are of a basic type
  • the name is set as the schema's name.
def validate(v: Validator[T]): Schema[T]
Implicitly added by schemaForOption

Add a validator to this schema. If the validator contains a named enum validator:

Add a validator to this schema. If the validator contains a named enum validator:

  • the encode function is inferred if not yet defined, and the validators possible values are of a basic type
  • the name is set as the schema's name.
def validate(v: Validator[T]): Schema[T]
Implicitly added by schemaForPart

Add a validator to this schema. If the validator contains a named enum validator:

Add a validator to this schema. If the validator contains a named enum validator:

  • the encode function is inferred if not yet defined, and the validators possible values are of a basic type
  • the name is set as the schema's name.
def validate(v: Validator[T]): Schema[T]

Add a validator to this schema. If the validator contains a named enum validator:

Add a validator to this schema. If the validator contains a named enum validator:

  • the encode function is inferred if not yet defined, and the validators possible values are of a basic type
  • the name is set as the schema's name.

Inherited methods

inline def modify[U](inline path: T => U)(inline modification: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForArray

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Inherited from:
SchemaMacros
inline def modify[U](inline path: T => U)(inline modification: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForIterable

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Inherited from:
SchemaMacros
inline def modify[U](inline path: T => U)(inline modification: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForMap

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Inherited from:
SchemaMacros
inline def modify[U](inline path: T => U)(inline modification: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForOption

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Inherited from:
SchemaMacros
inline def modify[U](inline path: T => U)(inline modification: Schema[U] => Schema[U]): Schema[T]
Implicitly added by schemaForPart

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Inherited from:
SchemaMacros
inline def modify[U](inline path: T => U)(inline modification: Schema[U] => Schema[U]): Schema[T]

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Modifies nested schemas for case classes and case class families (sealed traits / enums), accessible with path, using the given modification function. To traverse collections, use .each.

Inherited from:
SchemaMacros
def productElementNames: Iterator[String]
Implicitly added by schemaForArray
Inherited from:
Product
def productElementNames: Iterator[String]
Implicitly added by schemaForIterable
Inherited from:
Product
def productElementNames: Iterator[String]
Implicitly added by schemaForMap
Inherited from:
Product
def productElementNames: Iterator[String]
Implicitly added by schemaForOption
Inherited from:
Product
def productElementNames: Iterator[String]
Implicitly added by schemaForPart
Inherited from:
Product
def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Implicitly added by schemaForArray
Inherited from:
Product
def productIterator: Iterator[Any]
Implicitly added by schemaForIterable
Inherited from:
Product
def productIterator: Iterator[Any]
Implicitly added by schemaForMap
Inherited from:
Product
def productIterator: Iterator[Any]
Implicitly added by schemaForOption
Inherited from:
Product
def productIterator: Iterator[Any]
Implicitly added by schemaForPart
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product