Skip to content

[ING-512] docs(alerts): document notify_on on alert thresholds - #585

Open
aquinofb wants to merge 1 commit into
mainfrom
ing-512-notify-on
Open

aquinofb wants to merge 1 commit into
mainfrom
ing-512-notify-on

Conversation

@aquinofb

Copy link
Copy Markdown
Contributor

Context

Alert thresholds carry a notify_on array that decides which transitions notify. triggered is always included; opting in to resolved is what turns on the new alert.resolved webhook. The REST endpoints accept and return it, but the specification never described it, so the generated clients cannot set it and the reference does not mention the opt-in at all.

Changes

notify_on is added to AlertThresholdBaseObject, which the input, the alert response, the wallet alert response and the triggered alert payload all build on, so one definition covers reading and writing on every surface.

AlertThresholdObject marks it required, because a threshold that was never given one still comes back carrying the default.

Verification

npm run test (bundle, redocly lint, spectral lint) reports 0 errors. The 23 warnings are pre-existing array-params-plural findings on orders, quotes and subscriptions, untouched by this change. The bundled diff is 14 additive lines and nothing else moved.

Pairs with getlago/lago-api#6431, which opens the field over REST.

The REST endpoints accept and return notify_on on every alert threshold, but
the specification did not describe it, so the generated clients had no way to
set it and anyone reading the reference would not know the opt-in existed.

It sits on the shared base object, which the input, the alert response, the
wallet alert response and the triggered alert payload all build on, so one
definition covers reading and writing on every surface. The response variant
marks it as always present, since a threshold that was never given one still
comes back with the default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant