UnionRepresentationsModule

PackageReified.Schema

UnionRepresentations

UnionRepresentations holds complete, ready-made union wire representations for recommended authoring and serializer-compatible lifting. Pass one of these values together with the same case catalogue used by Schema.union to Schema.unionWith; the chosen format is then used consistently for parsing, JSON output, JSON Schema, generated test data, and inspection.

Format Use JSON
Internal tag and named fields UnionRepresentations.recommended { "type": "move", "x": 1, "y": 2 }
FSharp.SystemTextJson default UnionRepresentations.fsharpSystemTextJsonDefault { "Case": "Move", "Fields": [1, 2] }
FSharp.SystemTextJson external, named, and unwrapped UnionRepresentations.fsharpSystemTextJsonExternalNamed "stop", { "rename": "Ada" }, { "resize": { "width": 1, "height": 2 } }
Adjacent tag and named payload UnionRepresentations.reifiedAdjacent { "type": "move", "value": { "x": 1, "y": 2 } }
External tag and named payload UnionRepresentations.compactExternal "stop", { "move": { "x": 1, "y": 2 } }

UnionRepresentations.recommended is Reified's default internally tagged, named-field representation. fsharpSystemTextJsonDefault reads and writes FSharp.SystemTextJson's default Case/Fields positional format.

See Advanced Union Handling for the recipes that use these profiles.

Summary

NameSignatureSynopsis
Operations
recommendedUnionRepresentations.recommended Reified's recommended internally tagged, named-field representation.
fsharpSystemTextJsonDefaultUnionRepresentations.fsharpSystemTextJsonDefault FSharp.SystemTextJson's default Case/Fields positional representation.
fsharpSystemTextJsonInternalNamedUnionRepresentations.fsharpSystemTextJsonInternalNamed The recommended FSharp.SystemTextJson internal-tag plus named-fields profile.
fsharpSystemTextJsonExternalNamedUnionRepresentations.fsharpSystemTextJsonExternalNamed FSharp.SystemTextJson external tags with named multi-field payloads and unwrapped fieldless/single-field cases.
reifiedAdjacentUnionRepresentations.reifiedAdjacent Reified's former adjacent { type, value } representation.
compactExternalUnionRepresentations.compactExternal A compact external representation with fieldless cases encoded as strings.

Operations

kind:member

recommended

UnionRepresentations.recommended
Member
Reified's recommended internally tagged, named-field representation.

Returns

UnionRepresentation
kind:member

fsharpSystemTextJsonDefault

UnionRepresentations.fsharpSystemTextJsonDefault
Member
FSharp.SystemTextJson's default Case/Fields positional representation.

Returns

UnionRepresentation
kind:member

fsharpSystemTextJsonInternalNamed

UnionRepresentations.fsharpSystemTextJsonInternalNamed
Member
The recommended FSharp.SystemTextJson internal-tag plus named-fields profile.

Returns

UnionRepresentation
kind:member

fsharpSystemTextJsonExternalNamed

UnionRepresentations.fsharpSystemTextJsonExternalNamed
Member
FSharp.SystemTextJson external tags with named multi-field payloads and unwrapped fieldless/single-field cases.

Returns

UnionRepresentation
kind:member

reifiedAdjacent

UnionRepresentations.reifiedAdjacent
Member
Reified's former adjacent { type, value } representation.

Returns

UnionRepresentation
kind:member

compactExternal

UnionRepresentations.compactExternal
Member
A compact external representation with fieldless cases encoded as strings.

Returns

UnionRepresentation