case class Schema[T](schemaType: SchemaType[T], name: Option[SName] = None, isOptional: Boolean = false, description: Option[String] = None, default: Option[(T, Option[Any])] = None, format: Option[String] = None, encodedExample: Option[Any] = None, deprecated: Boolean = false, hidden: Boolean = false, validator: Validator[T] = Validator.pass[T], attributes: AttributeMap = AttributeMap.Empty) extends SchemaMacros[T] with Product with Serializable

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

format

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

Annotations
@implicitNotFound( ... )
Linear Supertypes
Serializable, Serializable, Product, Equals, SchemaMacros[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Schema
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. SchemaMacros
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Schema(schemaType: SchemaType[T], name: Option[SName] = None, isOptional: Boolean = false, description: Option[String] = None, default: Option[(T, Option[Any])] = None, format: Option[String] = None, encodedExample: Option[Any] = None, deprecated: Boolean = false, hidden: Boolean = false, validator: Validator[T] = Validator.pass[T], attributes: AttributeMap = AttributeMap.Empty)

    format

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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def applyValidation(t: T): List[ValidationError[_]]

    Apply defined validation rules to the given value.

  5. def as[TT]: Schema[TT]

    Adapt this schema to type 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:

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

    Returns an array version of this schema, with the schema type wrapped in SArray.

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

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def asIterable[C[X] <: Iterable[X]]: Schema[C[T]]

    Returns a collection version of this schema, with the schema type wrapped in SArray.

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

  9. def asOption: Schema[Option[T]]

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

  10. def attribute[A](k: AttributeKey[A], v: A): Schema[T]
  11. def attribute[A](k: AttributeKey[A]): Option[A]
  12. val attributes: AttributeMap
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  14. def default(t: T, encoded: Option[Any] = None): 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.).

  15. val default: Option[(T, Option[Any])]
  16. def deprecated(d: Boolean): Schema[T]
  17. val deprecated: Boolean
  18. def description(d: String): Schema[T]
  19. val description: Option[String]
  20. def encodedExample(e: Any): Schema[T]
  21. val encodedExample: Option[Any]
  22. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def format(f: String): Schema[T]
  24. val format: Option[String]
  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. def hidden(h: Boolean): Schema[T]
  27. val hidden: Boolean
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. val isOptional: Boolean
  30. def map[TT](f: (T) ⇒ Option[TT])(g: (TT) ⇒ T): Schema[TT]
  31. macro def modify[U](path: (T) ⇒ U)(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.

    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.

    Should only be used if the schema hasn't been created by .mapping another one. In such a case, the shape of the schema doesn't correspond to the type T, but to some lower-level representation of the type.

    If the shape of the schema doesn't correspond to the path, the schema remains unchanged.

    Definition Classes
    SchemaMacros
  32. def modifyUnsafe[U](fields: String*)(modify: (Schema[U]) ⇒ Schema[U]): Schema[T]

    See modify: instead of a path expressed using code, accepts a path a sequence of Strings.

  33. def name(name: Option[SName]): Schema[T]
  34. def name(name: SName): Schema[T]
  35. val name: Option[SName]
  36. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  37. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  39. val schemaType: SchemaType[T]
  40. def show: String
  41. def showValidators: Option[String]
  42. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  43. def title(t: String): Schema[T]
  44. def validate(v: Validator[T]): Schema[T]

    Add a validator to this schema.

    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.
  45. val validator: Validator[T]
  46. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from SchemaMacros[T]

Inherited from AnyRef

Inherited from Any

Ungrouped