Skip to content

docs(api): document /template/update as a partial update - #303

Merged
ysyneu merged 2 commits into
mainfrom
docs/template-update-patch-semantics
Aug 24, 2026
Merged

docs(api): document /template/update as a partial update#303
ysyneu merged 2 commits into
mainfrom
docs/template-update-patch-semantics

Conversation

@ysyneu

Copy link
Copy Markdown
Contributor

What

POST /template/update is moving to partial-update semantics on the server: a field absent from the request is left alone, and only an explicit empty string clears a channel. Today the endpoint writes all channel-content fields unconditionally, so omitting a channel silently blanks it — this PR makes the reference describe the new contract.

  • The 14 channel-content properties plus description on TemplateUpdateRequest become "type": ["string", "null"], matching how feishu_app_card_v2_table_enabled already models "omit keeps the current setting".
  • Each description states both writes explicitly: omit to keep the current content, send an empty string to clear.
  • team_id becomes nullable and loses default: 0. The field has always been optional-and-preserved server-side, but a documented default of 0 reads as "omitting this moves the template to account scope", which it never did.
  • The operation description no longer claims the call replaces the content of every channel.

Applied to all four specs that carry the schema (on-call.openapi.{en,zh}.json, openapi.{en,zh}.json). Content-only change: no properties added or removed, no auth or required-set changes.

Ordering

Do not merge before the server-side change is released. The site deploys from main, so merging early would publish a contract the running server does not yet honour — and the failure mode is the destructive direction (a caller who trusts "omit keeps" would blank channels).

The generated SDK and CLI both remain correct under either server behaviour once they carry nullable fields, so they can be regenerated from this spec ahead of the release.

Checks

python3 scripts/lint_openapi.pyOK: 12 spec files, no violations.

Model every optional field on TemplateUpdateRequest as nullable and say what
omission means. The 14 channel-content fields plus `description` are now
`["string", "null"]`, mirroring how `feishu_app_card_v2_table_enabled` already
expresses "omit keeps the current setting", and each description spells out the
two distinct writes: omit to keep the current content, send an empty string to
clear the channel.
`team_id` drops its `default: 0` and becomes nullable for the same reason — the
field is optional and omitting it keeps the template's current team, so a
documented default of 0 read as "omission moves the template to account scope".
The operation description no longer says the call replaces the content of every
channel.
…emantics
The rendered Usage bullet still described the write as "every channel field in
the request overwrites the stored value", which reads as a full replace and, more
to the point, said nothing about the fields a request leaves out — the one thing
a caller needs to know. Replace it with the omission rule stated directly, in
both languages, across the per-module specs Mintlify renders and the
consolidated reference copies.
@ysyneu
ysyneu merged commit 7adde2f into mainAug 24, 2026
2 checks passed
Sign up for freeto 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

@ysyneu