Where it goes
Contoso keeps Auditable in domains/core/interfaces.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 InterfaceSpec in the GOL JSON Schema.
| Field | Presence | Shape |
|---|---|---|
extends | Optional | refList |
properties | Optional | propertyMap |
links | Optional | array |
actions | Optional | array |
search | Optional | search |
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.
7. Interface
kind: Interface
metadata: { name: Agreement, domain: core }
spec:
extends: [core.Auditable]
properties:
startsOn: { type: date, required: true }
endsOn: { type: date }
renewalDate: { use: core.renewalDate }
links: # link constraints every implementer must satisfy
- { role: counterparty, to: party.LegalEntity, multiplicity: "1..*" }
actions: [Renew] # action contracts implementers must bind
search: { facets: [startsOn] }
An implementing ObjectType lists implements[].map for every interface property whose local name differs, implements[].links binding each interface link constraint to one of its own link roles, and implements[].actions binding each action contract to a concrete ActionType. A binding may be omitted only when the local name is identical. Missing mappings GLN-E221, type mismatch GLN-E222, unsatisfied link constraint GLN-E223. Interfaces can be link ends, policy resources, chat scopes and action parameter types.
Check your package
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.
