Where it goes
Contoso keeps procurement in domains/procurement/domain.yaml. The loader reads every YAML file under the package root, so folders are a convention you can change. Name it in lowercase kebab-case. Files under domains/<name>/ take this domain automatically.
Fields
The keys under spec. Nested shapes follow DomainSpec in the GOL JSON Schema.
| Field | Presence | Shape |
|---|---|---|
subdomain | Optional | enum: core, supporting, generic |
color | Optional | color |
icon | Optional | string |
glossary | Optional | array |
contextMap | Optional | array |
imports | Optional | 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.
3.2 Domain (bounded context)
GOL · YAML
kind: Domain
metadata: { name: procurement, title: Procurement }
spec:
subdomain: core # core | supporting | generic
color: "#7C5CFF" # designer swimlane colour
icon: file-contract
glossary: # ubiquitous language; terms resolve in chat before types do
- term: renewal
definition: The act of extending a contract beyond its expiry date.
refersTo: ["Contract#renewalDate", RenewContract]
synonyms: [extension, verlenging]
contextMap: # DDD strategic patterns
- with: party
relationship: customer-supplier # partnership | shared-kernel | customer-supplier |
direction: downstream # conformist | anticorruption-layer | open-host | published-language
via: [party.Organization] # the types this domain is allowed to reference
- with: finance
relationship: published-language
direction: upstream
imports:
strict: true # when true, referencing a type not listed in a contextMap `via` is GLN-E204
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.
