types

Types

The value types Marreta uses for schema contracts, payloads, responses, and runtime values.

Marreta uses one set of types everywhere. The same types describe schema contracts, request payloads, responses, and the values your code works with at runtime. A field declared amount: decimal is validated on the way in, shaped on the way out, and is a real decimal in between.

Scalar types

TypeMeaningPage
stringText.string
integerA whole number.integer
floatA floating-point number.float
decimalAn exact decimal, safe for money.decimal
booleantrue or false.boolean

Collection types

TypeMeaningPage
listAn ordered list of values.list
mapA key-value object.map

Temporal types

TypeMeaning
instantA point in time.
dateA calendar date.
timeA wall-clock time.
durationA length of time.
intervalA span between two instants.

These are constructed and read through the time namespace. See Temporal types for construction, properties, and the on method.

Schema constructs

These appear in schema definitions to compose other types:

FormMeaning
enum ["a", "b"]One of a fixed set of strings.
<Schema>A reference to another schema, a foreign-key relation when the target is persistent.
list of <Schema>A typed list of another schema.