Where it goes
Contoso keeps Iban 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 ValueTypeSpec in the GOL JSON Schema.
| Field | Presence | Shape |
|---|---|---|
base | Required | typeExpr |
constraints | Optional | constraints |
normalize | Optional | array |
check | Optional | cel |
sensitivity | Optional | sensitivity |
examples | Optional | array |
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.2 ValueType (DDD value object, scalar)
kind: ValueType
metadata: { name: Iban }
spec:
base: string
constraints: { pattern: "^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$", maxLength: 34 }
normalize: [trim, upper, removeSpaces]
check: gluon.iban.valid(self) # CEL, may call std functions
sensitivity: { pii: financial, masking: { method: partial, keepLast: 4 } }
examples: ["NL91ABNA0417164300"]
Constraints: minLength maxLength pattern format min max exclusiveMin exclusiveMax multipleOf precision scale oneOf minItems maxItems uniqueItems.
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.
