field<'model, 'target>Type

PackageReified.Schema
Declares one field inside schema<'model> { }, and configures it when followed by a block.

Specification

Kind
Type
Members
32
Examples
0
``.ctor``Signature
field(getter)
ConstrainSignature
constrain constraint'
ConstrainSignature
constrain constraint'
ConstrainSignature
constrain constraint'
ConstraintsSignature
constraints constraints

Summary

NameSignatureSynopsis
``.ctor``field(getter)Declares a field, deriving its camel-cased wire name from the property getter.
Constrainconstrain constraint'Adds a portable constraint to the field's current schema value.
Constrainconstrain constraint'Adds another portable constraint to an inferred field schema.
Constrainconstrain constraint'Adds a portable constraint to the field's current schema value.
Constraintsconstraints constraintsAdds portable constraints to the field's current schema value in declaration order.
Constraintsconstraints constraintsAdds portable constraints to the field's inferred schema in declaration order.
Constraintsconstraints constraintsAdds portable constraints to the field's inferred schema in declaration order.
DefaultValuedefaultValue valueSupplies the field value when the input omits it.
DefaultValuedefaultValue valueSupplies the field value when the input omits it.
DefaultValuedefaultValue valueSupplies the field value when the input omits it.
Describedescribe textAdds human-readable description metadata to the field's current schema.
Describedescribe textAdds human-readable description metadata to the field's schema.
Describedescribe textAdds human-readable description metadata to the field's schema.
Formatformat formatAdds format metadata to the field's current schema.
Formatformat formatAdds format metadata to the field's schema.
Formatformat formatAdds format metadata to the field's schema.
MayOmitmayOmit Allows this option-typed field's boundary input to be omitted.
MustSupplymustSupply Requires this field's boundary input to be supplied.
MustSupplymustSupply Requires this field's boundary input to be supplied.
MustSupplymustSupply Requires this field's boundary input to be supplied.
Refinerefine Refines the current raw schema with the destination type's canonical refinement.
Refinerefine refinementRefines the current raw schema with an explicit refinement.
Runthis.RunNo description available.
Runthis.RunNo description available.
Runthis.RunNo description available.
Runthis.RunNo description available.
Validatevalidate validationAdds executable validation after the pending refinement.
Validatevalidate validationAdds executable validation to the field's current schema value.
Validatevalidate validationAdds another executable validation to an inferred field schema.
Validatevalidate validationAdds executable validation to the field's current schema value.
WithSchemawithSchema schemaSupplies the schema transformed by the remaining operations in this field block.
Yieldthis.YieldNo description available.

``.ctor``

field(getter)
Member
Declares a field, deriving its camel-cased wire name from the property getter.

Parameters

NameTypeDescription
getterExpr<('model -> 'target)>

Returns

field<'model, 'target>

Verification Examples

type Signup = { Email: string }
 field (fun (s: Signup) -> s.Email)  // wire name "email"

Constrain

constrain constraint'
Member
Adds a portable constraint to the field's current schema value.

Parameters

NameTypeDescription
sourceConstraint<'current>

Returns

FieldWorking<'model, 'target, 'current>

Constrain

constrain constraint'
Member
Adds another portable constraint to an inferred field schema.

Parameters

NameTypeDescription
sourceConstraint<'target>

Returns

FieldConfigured<'model, 'target>

Constrain

constrain constraint'
Member
Adds a portable constraint to the field's current schema value.

Parameters

NameTypeDescription
initialConstraint<'target>

Returns

FieldConfigured<'model, 'target>

Constraints

constraints constraints
Member
Adds portable constraints to the field's current schema value in declaration order.

Parameters

NameTypeDescription
sourceConstraint<'current> list

Returns

FieldWorking<'model, 'target, 'current>

Constraints

constraints constraints
Member
Adds portable constraints to the field's inferred schema in declaration order.

Parameters

NameTypeDescription
sourceConstraint<'target> list

Returns

FieldConfigured<'model, 'target>

Constraints

constraints constraints
Member
Adds portable constraints to the field's inferred schema in declaration order.

Parameters

NameTypeDescription
initialConstraint<'target> list

Returns

FieldConfigured<'model, 'target>

DefaultValue

defaultValue value
Member
Supplies the field value when the input omits it.

Parameters

NameTypeDescription
source'current

Returns

FieldWorking<'model, 'target, 'current>

DefaultValue

defaultValue value
Member
Supplies the field value when the input omits it.

Parameters

NameTypeDescription
source'target

Returns

FieldConfigured<'model, 'target>

DefaultValue

defaultValue value
Member
Supplies the field value when the input omits it.

Parameters

NameTypeDescription
initial'target

Returns

FieldConfigured<'model, 'target>

Describe

describe text
Member
Adds human-readable description metadata to the field's current schema.

Parameters

NameTypeDescription
sourcestring

Returns

FieldWorking<'model, 'target, 'current>

Describe

describe text
Member
Adds human-readable description metadata to the field's schema.

Parameters

NameTypeDescription
sourcestring

Returns

FieldConfigured<'model, 'target>

Describe

describe text
Member
Adds human-readable description metadata to the field's schema.

Parameters

NameTypeDescription
initialstring

Returns

FieldConfigured<'model, 'target>

Format

format format
Member
Adds format metadata to the field's current schema.

Parameters

NameTypeDescription
sourceSchemaFormat

Returns

FieldWorking<'model, 'target, 'current>

Format

format format
Member
Adds format metadata to the field's schema.

Parameters

NameTypeDescription
sourceSchemaFormat

Returns

FieldConfigured<'model, 'target>

Format

format format
Member
Adds format metadata to the field's schema.

Parameters

NameTypeDescription
initialSchemaFormat

Returns

FieldConfigured<'model, 'target>

MayOmit

mayOmit
Member
Allows this option-typed field's boundary input to be omitted.

Returns

FieldWorking<'model, 'target, 'current option>

Verification Examples

open Reified.SchemaDSL
 type Signup = { Nickname: string option }
 schema<Signup> {
     field _.Nickname { mayOmit }
     construct (fun nickname -> { Nickname = nickname })
 }

MustSupply

mustSupply
Member
Requires this field's boundary input to be supplied.

Returns

FieldWorking<'model, 'target, 'current>

MustSupply

mustSupply
Member
Requires this field's boundary input to be supplied.

Returns

FieldConfigured<'model, 'target>

MustSupply

mustSupply
Member
Requires this field's boundary input to be supplied.

Returns

FieldConfigured<'model, 'target>

Verification Examples

open Reified.SchemaDSL
 type Signup = { Name: string }
 schema<Signup> {
     field _.Name { mustSupply }
     construct (fun name -> { Name = name })
 }

Refine

refine
Member
Refines the current raw schema with the destination type's canonical refinement.

Returns

FieldRefining<'model, 'target, 'raw>

Refine

refine refinement
Member
Refines the current raw schema with an explicit refinement.

Parameters

NameTypeDescription
sourceRefinement<'raw, 'target>

Returns

FieldWorking<'model, 'target, 'target>

Run

this.Run
Member

Parameters

NameTypeDescription
sourceFieldWorking<'model, 'target, 'current>

Returns

FieldDeclaration<'model, 'target>

Run

this.Run
Member

Parameters

NameTypeDescription
sourceFieldRefining<'model, 'target, 'raw>

Returns

RefiningFieldDeclaration<'model, 'raw, 'target>

Run

this.Run
Member

Parameters

NameTypeDescription
sourceFieldConfigured<'model, 'target>

Returns

ConfiguredFieldDeclaration<'model, 'target>

Run

this.Run
Member

Parameters

NameTypeDescription
sourceFieldWorking<'model, 'target, 'target>

Returns

FieldDeclaration<'model, 'target>

Validate

validate validation
Member
Adds executable validation after the pending refinement.

Parameters

NameTypeDescription
source'target -> Result<unit, SchemaError>

Returns

FieldRefining<'model, 'target, 'raw>

Validate

validate validation
Member
Adds executable validation to the field's current schema value.

Parameters

NameTypeDescription
source'current -> Result<unit, SchemaError>

Returns

FieldWorking<'model, 'target, 'current>

Validate

validate validation
Member
Adds another executable validation to an inferred field schema.

Parameters

NameTypeDescription
source'target -> Result<unit, SchemaError>

Returns

FieldConfigured<'model, 'target>

Validate

validate validation
Member
Adds executable validation to the field's current schema value.

Parameters

NameTypeDescription
initial'target -> Result<unit, SchemaError>

Returns

FieldConfigured<'model, 'target>

WithSchema

withSchema schema
Member
Supplies the schema transformed by the remaining operations in this field block.

Parameters

NameTypeDescription
initialSchema<'current>

Returns

FieldWorking<'model, 'target, 'current>

Yield

this.Yield
Member

Parameters

NameTypeDescription
unit

Returns

FieldInitial<'model, 'target>