AppSpring Docs

Shared enum domains (EnumDecl)

Generated from the doc schema (CatalogDocSchema, @canonify/kernel-catalog/doc): each field’s type, default and description are the schema’s own, and each example is a bundle file that readBundle decodes. A field’s Example is its value in one of those examples.

EnumDecl

A shared enum domain: one list of values that several enum and set properties and action inputs name.

The enums slot of the doc holds these, keyed by id. In a bundle each is one file, enums/<name>.json, named by its name, which the file then leaves out.

Field Type Required Default Example Description
id EnumId yes (propose assigns it; a new declaration leaves it out) — — A shared enum id (en_…); renames keep it.
name Ident yes — "position" The domain name: how a typeref names it (enum<position>), unique among the domains.
label Text yes (a draft may leave it out: propose writes a default made from the name, catalog.label_defaulted) — "Position" The words shown for the domain.
values EnumValue[] yes — (see the example) The declared values, in their order.
ordered boolean no — false Whether the declared order is a ranking (comparisons and sorting follow it).

enums/position.json

{
  "label": "Position",
  "values": [
    { "code": "chef", "label": "Chef" },
    { "code": "waiter", "label": "Waiter" }
  ],
  "ordered": false
}

This page as Markdown