kindrecord
Kindrecord is a data modeling pattern used to represent a heterogeneous collection of entities within a single record by embedding a kind or type discriminator and a corresponding payload. The idea is to allow a single field to indicate what shape the rest of the data takes, enabling polymorphic records in serialized forms.
A kindrecord typically includes at least two parts: a kind field that names the variant, and a
Common examples appear in API payloads that must support multiple resource kinds in a single endpoint, or
Benefits include schema evolution flexibility, forward and backward compatibility, and simplified transport of heterogeneous data. Drawbacks
Related concepts include discriminated unions, sum types, tagged unions, polymorphic records, and type fields in data