SchemaGenModule

PackageReified.Schema.Testing
FsCheck generators derived from Schema metadata.

Summary

NameSignatureSynopsis
Operations
rawWithSchemaGen.rawWith custom schemaDerives constraint-satisfying structured data, using field-path overrides for unsupported constraints or domain-specific distributions.
rawSchemaGen.raw schemaDerives a generator of constraint-satisfying structured data for a built schema.
roundTripWithSchemaGen.roundTripWith count seed schemaChecks seeded samples through JSON encoding and decoding; unsupported rules fail closed.
roundTripSchemaGen.roundTrip schemaChecks 100 reproducible samples with seed 0; use roundTripWith to choose a seed and sample count.
modelSchemaGen.model schemaDerives models by generating structured data and parsing it through the schema.

Operations

kind:member

rawWith

SchemaGen.rawWith custom schema
Member
Derives constraint-satisfying structured data, using field-path overrides for unsupported constraints or domain-specific distributions.

Parameters

NameTypeDescription
customMap<string, Gen<Data>>
schemaSchema<'model>

Returns

Result<Gen<Data>, SchemaGenerationError>
kind:member

raw

SchemaGen.raw schema
Member
Derives a generator of constraint-satisfying structured data for a built schema.

Parameters

NameTypeDescription
schemaSchema<'model>

Returns

Result<Gen<Data>, SchemaGenerationError>
kind:member

roundTripWith

SchemaGen.roundTripWith count seed schema
Member
Checks seeded samples through JSON encoding and decoding; unsupported rules fail closed. Failures include the seed for replay with the same sample count. <example><code>SchemaGen.roundTripWith 100 42UL schema |> Result.defaultWith (failwithf "%A")</code></example>

Parameters

NameTypeDescription
countint
seeduint64
schemaSchema<'model>

Returns

Result<unit, SchemaGenerationError>
kind:member

roundTrip

SchemaGen.roundTrip schema
Member
Checks 100 reproducible samples with seed 0; use roundTripWith to choose a seed and sample count. <example><code>SchemaGen.roundTrip schema |> Result.defaultWith (failwithf "%A")</code></example>

Parameters

NameTypeDescription
schemaSchema<'model>

Returns

Result<unit, SchemaGenerationError>
kind:member

model

SchemaGen.model schema
Member
Derives models by generating structured data and parsing it through the schema.

Parameters

NameTypeDescription
schemaSchema<'model>

Returns

Result<Gen<'model>, SchemaGenerationError>