StructSchema

smithy4s.schema.Schema.StructSchema
final case class StructSchema[S](shapeId: ShapeId, hints: Hints, fields: Vector[Field[S, _]], make: IndexedSeq[Any] => S) extends Schema[S]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Schema[S]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

final def addHints(hints: Hints): Schema[A]

Attributes

Inherited from:
Schema
final def addHints(hints: Hint*): Schema[A]

Attributes

Inherited from:
Schema
final def addMemberHints(hints: Hints): Schema[A]

Attributes

Inherited from:
Schema
final def addMemberHints(hints: Hint*): Schema[A]

Attributes

Inherited from:
Schema
final def biject[B](to: S => B)(from: B => S): Schema[B]

Attributes

Inherited from:
Schema
final def biject[B](bijection: Bijection[S, B]): Schema[B]

Attributes

Inherited from:
Schema
final def compile[F[_]](fk: PolyFunction[Schema, F]): F[A]

Attributes

Inherited from:
Schema
final def error(unlift: S => Throwable)(lift: PartialFunction[Throwable, S]): ErrorSchema[A]

Turns this schema into an error schema.

Turns this schema into an error schema.

Attributes

Inherited from:
Schema
final def findPayload(find: Field[_, _] => Boolean): SchemaPartition[A]

Finds the first field that matches the criteria used, and applies a bijection between the schema it holds and partial data, which ensures for the field's schema to be used as "top level" when decoding "payloads".

Finds the first field that matches the criteria used, and applies a bijection between the schema it holds and partial data, which ensures for the field's schema to be used as "top level" when decoding "payloads".

NB : a "payload" is typically a whole set of data, without a typical field-based splitting into subparts. This can be, for instance, an http body.

Attributes

Inherited from:
Schema
final def getDefault: Option[Document]

Attributes

Inherited from:
Schema
final def getDefaultValue: Option[A]

Attributes

Inherited from:
Schema
final def isOption: Boolean

Attributes

Inherited from:
Schema
final def isPrimitive[P](prim: Primitive[P]): Boolean

Finds whether a schema (or the underlying schema in the case of bijections/surjections, etc) is a primitive of a certain type.

Finds whether a schema (or the underlying schema in the case of bijections/surjections, etc) is a primitive of a certain type.

Attributes

Inherited from:
Schema
final def isUnit: Boolean

Checks whether a schema is Unit or an empty structure

Checks whether a schema is Unit or an empty structure

Attributes

Inherited from:
Schema
final def oneOf[Union]: PartiallyAppliedOneOf[Union, A]

Attributes

Inherited from:
Schema
final def option: Schema[Option[A]]

Attributes

Inherited from:
Schema
final def optional[Struct]: PartiallyAppliedOptional[Struct, A]

Attributes

Inherited from:
Schema
final def partition(filter: Field[_, _] => Boolean): SchemaPartition[A]

When applied on a structure schema, creates a schema that, when compiled into a codec, will only encode/decode a subset of the data, based on the hints of each field.

When applied on a structure schema, creates a schema that, when compiled into a codec, will only encode/decode a subset of the data, based on the hints of each field.

This can be used to only encode some fields of the data into the http body

Returns a SchemaPartition that indicates whether :

  • no field match the condition
  • some fields match the condition
  • all fields match the condition

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
final def refined[B]: PartiallyAppliedRefinement[A, B]

Attributes

Inherited from:
Schema
final def required[Struct]: PartiallyAppliedRequired[Struct, A]

Attributes

Inherited from:
Schema
final def transformHintsLocally(f: Hints => Hints): Schema[A]

Attributes

Inherited from:
Schema

Attributes

Inherited from:
Schema
final def validated[C](c: C)(implicit constraint: Simple[C, S]): Schema[A]

Attributes

Inherited from:
Schema
final def withId(namespace: String, name: String): Schema[A]

Attributes

Inherited from:
Schema
final def withId(newId: ShapeId): Schema[A]

Attributes

Inherited from:
Schema