Where it goes
Contoso keeps RiskRating in domains/party/types.yaml. The loader reads every YAML file under the package root, so folders are a convention you can change. Name it in PascalCase. The name must be unique within its domain across all type kinds.
Fields
The keys under spec. Nested shapes follow EnumTypeSpec in the GOL JSON Schema.
| Field | Presence | Shape |
|---|---|---|
ordered | Optional | boolean |
extensible | Optional | boolean |
values | Required | object |
Syntax and rules
The examples are fragments. Put them in a package next to the resources they reference. A ... stands for a CEL expression you write yourself.
4.4 EnumType
GOL · YAML
kind: EnumType
metadata: { name: ContractState }
spec:
ordered: true
values:
draft: { title: Draft, color: neutral }
active: { title: Active, color: success }
expiring: { title: Expiring, color: warning }
expired: { title: Expired, color: danger, terminal: true }
void: { title: Void, deprecated: { since: 2.0.0, replacedBy: expired } }
extensible: false # true lets an Extension add values
Check your package
Shell
gluon validate examples/contoso
gluon test examples/contoso
validate reports each problem with a GLN code and its place in the file. test runs the package's Test resources. See the language guide and the diagnostics.
