Attributes
- Companion:
- class
- Graph
- Supertypes
- trait Producttrait Mirrortrait SchemaCompanionMacrostrait SchemaMagnoliaDerivationtrait LowPrioritySchemaclass Objecttrait Matchableclass Any
- Self type
- Schema.type
Members list
Type members
Classlikes
Corresponds to OpenAPI's explode
parameter which should be used for delimited values.
Corresponds to OpenAPI's explode
parameter which should be used for delimited values.
Attributes
- Companion:
- object
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Attributes
- Companion:
- object
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
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.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- annotations.type
Inherited types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
A schema allowing anything: a number, string, object, etc. A SCoproduct with no specified subtypes.
A schema allowing anything: a number, string, object, etc. A SCoproduct with no specified subtypes.
Attributes
- See also:
A schema allowing any object. A SProduct with no specified fields.
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.
Attributes
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
.
Attributes
Wraps the given schema with a single-field product, where fieldName
maps to schema
.
Wraps the given schema with a single-field product, where fieldName
maps to schema
.
The resulting schema has no name.
Useful when generating one-of schemas for coproducts, where to discriminate between child types a wrapper product is used. To automatically derive such a schema for a sealed hierarchy, see Schema.oneOfWrapped.
Attributes
Wraps the given schema with a single-field product, where a field computed using the implicit Configuration maps to schema
.
Wraps the given schema with a single-field product, where a field computed using the implicit Configuration maps to schema
.
The resulting schema has no name.
Useful when generating one-of schemas for coproducts, where to discriminate between child types a wrapper product is used. To automatically derive such a schema for a sealed hierarchy, see Schema.oneOfWrapped.
Attributes
Inherited methods
Attributes
- Inherited from:
- SchemaMagnoliaDerivation
Creates a schema for an enumeration, where the validator is derived using sttp.tapir.Validator.derivedEnumeration. This requires
that this is an enum
, where all cases are parameterless, or that all subtypes of the sealed hierarchy T
are object
s.
Creates a schema for an enumeration, where the validator is derived using sttp.tapir.Validator.derivedEnumeration. This requires
that this is an enum
, where all cases are parameterless, or that all subtypes of the sealed hierarchy T
are object
s.
This method cannot be implicit, as there's no way to constraint the type T
to be an enum / sealed trait or class enumeration, so
that this would be invoked only when necessary.
Attributes
- Inherited from:
- SchemaCompanionMacros
Creates a schema for an Enumeration, where the validator is created using the enumeration's values. Unlike the default
derivedEnumerationValue method, which provides the schema implicitly, this variant allows customising how the schema is created.
This is useful if the low-level representation of the schema is different than a String
, or if the enumeration's values should be
encoded in a different way than using .toString
.
Creates a schema for an Enumeration, where the validator is created using the enumeration's values. Unlike the default
derivedEnumerationValue method, which provides the schema implicitly, this variant allows customising how the schema is created.
This is useful if the low-level representation of the schema is different than a String
, or if the enumeration's values should be
encoded in a different way than using .toString
.
Because of technical limitations of macros, the customisation arguments can't be given here directly, instead being delegated to CreateDerivedEnumerationSchema.
Attributes
- Inherited from:
- SchemaCompanionMacros
Create a coproduct schema (e.g. for a sealed trait
), where the value of the discriminator between child types is a read of a field
of the base type. The field, if not yet present, is added to each child schema.
Create a coproduct schema (e.g. for a sealed trait
), where the value of the discriminator between child types is a read of a field
of the base type. The field, if not yet present, is added to each child schema.
The schemas of the child types have to be provided explicitly with their value mappings in mapping
.
Note that if the discriminator value is some transformation of the child's type name (obtained using the implicit Configuration), the coproduct schema can be derived automatically or semi-automatically.
Attributes
- discriminatorSchema
The schema that is used when adding the discriminator as a field to child schemas (if it's not yet in the schema).
- Inherited from:
- SchemaCompanionMacros
Create a coproduct schema for an enum
, sealed trait
or sealed abstract class
, where to discriminate between child types a
wrapper product is used. The name of the sole field in this product corresponds to the type's name, transformed using the implicit
Configuration.
Create a coproduct schema for an enum
, sealed trait
or sealed abstract class
, where to discriminate between child types a
wrapper product is used. The name of the sole field in this product corresponds to the type's name, transformed using the implicit
Configuration.
See also Schema.wrapWithSingleFieldProduct, which creates the wrapper product given a schema.
Attributes
- Inherited from:
- SchemaCompanionMacros
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)
Attributes
- Inherited from:
- SchemaCompanionMacros
Concrete fields
Implicits
Implicits
Inherited implicits
Create a schema for an Enumeration, where the validator is created using the enumeration's values. The low-level representation of
the enum is a String
, and the enum values in the documentation will be encoded using .toString
.
Create a schema for an Enumeration, where the validator is created using the enumeration's values. The low-level representation of
the enum is a String
, and the enum values in the documentation will be encoded using .toString
.
Attributes
- Inherited from:
- SchemaCompanionMacros
Attributes
- Inherited from:
- LowPrioritySchema
Attributes
- Inherited from:
- SchemaCompanionMacros