UnionRepresentationUnion
PackageReified.Schema
UnionRepresentation
UnionRepresentation is a complete, inspectable union wire representation. For a format not covered by a ready-made
value in UnionRepresentations, construct one directly:
UnionRepresentation.Internal("kind")
UnionRepresentation.Adjacent("kind", "fields", UnionPayloadStyle.Named)
UnionRepresentation.External(UnionPayloadStyle.Named, true)
Internal tagFieldwrites an internal tag inside the payload object, with named fields.Adjacent (tagField, payloadField, payloadStyle)writes the tag beside a single payload member holding the fields.External (payloadStyle, unwrapFieldless)writes a single-property object keyed by the case tag;unwrapFieldlessencodes fieldless cases as bare strings.
Adjacent and external formats accept every UnionPayloadStyle. See
UnionPayloadStyle for how each style shapes the payload, and
Advanced Union Handling for the JSON each combination produces.
Specification
Kind
Union
Members
6
Examples
0
IsExternalSignature
this.IsExternal
IsInternalSignature
this.IsInternal
IsAdjacentSignature
this.IsAdjacent
InternalSignature
Internal tagField
AdjacentSignature
Adjacent(tagField, payloadField, payloadStyle)
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Union cases | ||
| IsExternal | this.IsExternal | No description available. |
| IsInternal | this.IsInternal | No description available. |
| IsAdjacent | this.IsAdjacent | No description available. |
| Internal | Internal tagField | No description available. |
| Adjacent | Adjacent(tagField, payloadField, payloadStyle) | No description available. |
| External | External(payloadStyle, unwrapFieldless) | No description available. |