BijectionSchema

smithy4s.schema.Schema$.BijectionSchema
final case class BijectionSchema[A, B](underlying: Schema[A], bijection: Bijection[A, B]) extends Schema[B]

Attributes

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

Members list

Value members

Concrete methods

def hints: Hints

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: B => B, from: B => B): Schema[B]

Attributes

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

Attributes

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

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, B]): 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