annotations

sttp.tapir.Schema.annotations
object annotations

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

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

class customise(val f: Schema[_] => Schema[_]) extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class default[T](val default: T, val encoded: Option[Any]) extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class deprecated extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class description(val text: String) extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class encodedExample(val example: Any) extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class encodedName(val name: String) extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class format(val format: String) extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class hidden extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class title(val name: String) extends StaticAnnotation, Serializable

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class validate[T](val v: Validator[T]) extends StaticAnnotation, Serializable

Adds the v validator to the schema using Schema.validate. Note that the type of the validator must match exactly the type of the class/field. This is not checked at compile-time, and might cause run-time exceptions. To validate elements of collections or Options, use validateEach.

Adds the v validator to the schema using Schema.validate. Note that the type of the validator must match exactly the type of the class/field. This is not checked at compile-time, and might cause run-time exceptions. To validate elements of collections or Options, use validateEach.

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all
class validateEach[T](val v: Validator[T]) extends StaticAnnotation, Serializable

Adds the v validators to elements of the schema, when the annotated class or field is a collection or Option. The type of the validator must match exactly the type of the collection's elements. This is not checked at compile-time, and might cause run-time exceptions. E.g. to validate that when an Option[Int] is defined, the value is smaller than 5, you should use:

Adds the v validators to elements of the schema, when the annotated class or field is a collection or Option. The type of the validator must match exactly the type of the collection's elements. This is not checked at compile-time, and might cause run-time exceptions. E.g. to validate that when an Option[Int] is defined, the value is smaller than 5, you should use:

case class Payload(
 @validateEach(Validator.max(4, exclusive = true))
 aField: Option[Int]
)

Attributes

Supertypes
trait Serializable
trait StaticAnnotation
class Annotation
class Object
trait Matchable
class Any
Show all