SchemaGenModule
PackageReified.Schema.Testing
FsCheck generators derived from Schema metadata.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Operations | ||
| rawWith | SchemaGen.rawWith custom schema | Derives constraint-satisfying structured data, using field-path overrides for unsupported constraints or domain-specific distributions. |
| raw | SchemaGen.raw schema | Derives a generator of constraint-satisfying structured data for a built schema. |
| roundTripWith | SchemaGen.roundTripWith count seed schema | Checks seeded samples through JSON encoding and decoding; unsupported rules fail closed. |
| roundTrip | SchemaGen.roundTrip schema | Checks 100 reproducible samples with seed 0; use roundTripWith to choose a seed and sample count. |
| model | SchemaGen.model schema | Derives models by generating structured data and parsing it through the schema. |
Operations
kind:member
Derives constraint-satisfying structured data, using field-path overrides for unsupported constraints or domain-specific distributions.
Parameters
| Name | Type | Description |
|---|---|---|
| custom | Map<string, Gen<Data>> | |
| schema | Schema<'model> |
Returns
Result<Gen<Data>, SchemaGenerationError>
kind:member
kind: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
| Name | Type | Description |
|---|---|---|
| count | int | |
| seed | uint64 | |
| schema | Schema<'model> |
Returns
Result<unit, SchemaGenerationError>
kind: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
| Name | Type | Description |
|---|---|---|
| schema | Schema<'model> |
Returns
Result<unit, SchemaGenerationError>