docs(api): document /template/update as a partial update - #303
Merged
Conversation
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.
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.
What
POST /template/updateis 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.descriptiononTemplateUpdateRequestbecome"type": ["string", "null"], matching howfeishu_app_card_v2_table_enabledalready models "omit keeps the current setting".team_idbecomes nullable and losesdefault: 0. The field has always been optional-and-preserved server-side, but a documented default of0reads as "omitting this moves the template to account scope", which it never did.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.py→OK: 12 spec files, no violations.