Conditional rules
Use thewhen
clause to activate a rule only if a condition evaluates to true
. The condition uses the same operators as the search DSL on the profile’s property paths.
Supported operators
Operator | Description |
---|---|
eq | Checks equality. Use * as a wildcard to test for presence. |
lt | Valid for numeric or temporal fields to enforce “less than or equal.” |
gt | Valid for numeric or temporal fields to enforce “greater than or equal.” |
Nested objects
when
clauses reference properties from the root of the profile. For nested structures, use dot notation:
Arrays of objects
When validating within arrays, you can target:- Any element — Refer to the property directly (for example,
contacts.system
). - The current element — Use
[current]
to reference the object that is currently being validated.
Cardinality
Cardinality expresses how many instances of a property are allowed within a complex type.Notation | Name | Description | Validation |
---|---|---|---|
0:1 | Zero to one | Optional property, maximum one value | Property can be omitted or appear once |
1:1 | One to one | Required property, exactly one value | Missing or duplicate values fail validation |
0:* | Zero to many | Optional property, unlimited values (arrays) | Property can be omitted or contain any number of elements |
1:* | One to many | Required property, at least one value (arrays) | Enforces a non-empty array |
Cardinality rules are enforced during validation. Missing required properties or over-populated single-valued properties will fail ingestion.
Continue with vocabulary binding to link fields to controlled concept sets.