{% operation %}
Attributes
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | ✓ | Unique kebab-case operation name (e.g., 'get-bookmark') |
type | enum | ✓ | read | write — whether the operation modifies state |
idempotent | boolean | — | True if multiple calls with the same input produce the same result. Default false. |
Valid Children
| Tag | Multiplicity |
|---|---|
{% property %} | [*] |
{% returns %} | [?] |
{% throws %} | [*] |
Valid Parent Contexts
This tag is valid inside: {% api %}
Rules
| Rule | Force | Realm | Reference | Description |
|---|---|---|---|---|
operation-or-action-exclusive | | | — | A specific domain intent should be modeled as either an or an , but not both. |
operation-read-verb-nouns | | | — | Use for descriptive verb-nouns: , . |
operation-write-verb-nouns | | | — | Use for imperative verb-nouns: , . |
Declares a named invocable unit with a typed input payload, a typed success response, and a set of declared domain errors.
Operation with properties, returns, and throws
{% operation name="get-bookmark" type="read" idempotent=true %}Returns a single bookmark by its identifier.
{% property name="bookmark-id" type="uuid" required=true /%}
{% returns %} {% property name="url" type="string" required=true /%}{% /returns %}
{% throws ref="bookmark-not-found" /%}{% /operation %}