key

A key is very much similar to a record, but with restrictions on what field datatypes are supported.

A key is typically used for addressing an entity, therefore top level or nested vector types are not allowed as key field types. key definitions can includes trait declarations.

Multiple assert blocks can be specified to perform validation.

key CurrencyPair includes Addressable  {
    First : string
    Second : string
}

The fields which are part of a key contain the following restrictions:

  • Following field types not allowed
    • double
    • list
    • set
    • map
    • trait
    • union
    • Meta-types e.g. $entity, $record

Multiple assert blocks can be specified to perform validation.