Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Alert thresholds carry a
notify_onarray that decides which transitions notify.triggeredis always included; opting in toresolvedis what turns on the newalert.resolvedwebhook. 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_onis added toAlertThresholdBaseObject, 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.AlertThresholdObjectmarks 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-existingarray-params-pluralfindings 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.