type constraint

The type argument of a variable, such as string, number, bool, list(string), map(string) or object({...}), which rejects values of the wrong shape.

In more detail

Primitive types hold one value; collection types (list, set, map) hold many values of one type; structural types (object, tuple) describe a precise shape. A set has no order and no duplicates, which is why for_each accepts sets but not lists. The type any turns checking off and is best avoided.

Examples

type = map(string)
type = object({ name = string, size = optional(number, 2) })

Related terms

Taught in

References

Certification courses