Skip to content

docs(api): re-sync the API reference with the current backends - #299

Merged
ysyneu merged 4 commits into
mainfrom
docs/api-review-20260821
Aug 22, 2026
Merged

docs(api): re-sync the API reference with the current backends#299
ysyneu merged 4 commits into
mainfrom
docs/api-review-20260821

Conversation

@ysyneu

@ysyneu ysyneu commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Four drifts between the published API reference and what the backends actually do.

1. priority is gone from silence / inhibit / unsubscribe rules

The matching engine evaluates these rules in creation order, so priority never affected behaviour; it has been removed from the request inputs, the response items and the doc→item transfer.

The response item schemas had already dropped the property, but two request schemas and three response examples still carried the field:

  • CreateDropRuleRequest.priority, UpdateDropRuleRequest.priority — removed
  • 200-response examples of /channel/silence/rule/list, /channel/inhibit/rule/list, /channel/unsubscribe/rule/listpriority removed from the sample items

Escalation rules and subscription rules keep priority and are untouched — theirs is genuinely used for matching and ordering.

2. The rule item schemas still required priority

InhibitRuleItem, SilenceRuleItem and UnsubscribeRuleItem lost the priority property when the field left the API but kept priority in their required list, so each schema demanded a key its endpoint never returns — including in its own response examples. The three stale entries are removed.

(AlertRuleInfoResponse also lists required names it does not declare inline, but that one is deliberate: it is an allOf over AlertRule that tightens which server-assigned fields are guaranteed present. Left alone.)

3. duty_version is missing from the knowledge pack item

KnowledgePackItem now carries duty_version, the pack version at which DUTY.md was last authored or re-affirmed; the console compares it against version to decide whether DUTY.md still reflects the pack's files. The field is always emitted, so it is added to the schema's required list and to the pack list / get / ensure / update response examples.

Affects /safari/knowledge/pack/list, /safari/knowledge/get, /safari/knowledge/pack/ensure, /safari/knowledge/pack/update.

4. Drop rules cannot be reordered

The drop-rule note claimed rules can be dragged to change their execution priority. There is no ordering mechanism behind it — drop rules carry no order field, and the only reorder endpoints are for channels, escalation rules and incident comment types. The accurate half (sequential list order, first match discards the event) is kept.

This one is prose-only and can be dropped independently of the three spec commits if you would rather confirm the console behaviour first.

Scope

No endpoint was added, removed, or had its auth changed: the gateway registry lists 337 app_key-callable rows and the reference documents exactly those 337 — the two sets match in both directions.

Checks

  • python3 scripts/lint_openapi.py — clean (12 spec files, no violations)
  • All 13 spec JSON files parse
  • Every schema's required names a property it declares, except the intentional allOf case noted above
  • en/zh structural parity — 0 divergences across all five modules
  • Consolidated openapi.{en,zh}.json match the per-module files — 337 paths, 707 schemas, 0 content differences
  • docs.json nav and both api-catalog.mdx indexes still reconcile at 337 operations

ysyneu added 4 commits August 21, 2026 09:16
Silence, inhibit and unsubscribe rules no longer accept or return
`priority`. The matching engine evaluates these rules in creation order,
so the field never affected behavior and its "lower runs first" wording
misdescribed how rules are ordered.

Remove it from the drop-rule create/update request schemas, which still
declared it, and from the silence/inhibit/unsubscribe list-response
examples, which still showed it. Escalation and subscription rules keep
`priority` — theirs is genuinely used for matching and ordering.
Knowledge packs now carry `duty_version`, the pack version at which
DUTY.md was last authored or re-affirmed. The console compares it against
`version` to decide whether DUTY.md still reflects the pack's files, so
API consumers need it to reproduce that check.

Add the property to `KnowledgePackItem` (and to its required list — the
field is always emitted), and show it in the pack list, get, ensure and
update response examples.
The drop-rule note claimed rules can be dragged to change their
execution priority. There is no ordering mechanism behind it: drop rules
carry no order field, and the only reorder endpoints are for channels,
escalation rules and incident comment types.

Keep the accurate half — rules run sequentially in list order and the
first match discards the event — and remove the drag claim.
The silence, inhibit and unsubscribe rule item schemas dropped their
`priority` property when the field left the API, but kept `priority` in
their `required` list. The schemas then demanded a key the endpoints
never return — including in their own response examples.

Remove the three stale required entries.
@ysyneu
ysyneu merged commit 3b254e9 into main Aug 22, 2026
2 checks passed
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