Skip to content

docs(api): drop dry_run from member notify, document html validation 400 - #415

Merged
ysyneu merged 1 commit into
mainfrom
docs/member-notify-drop-dry-run
Sep 21, 2026
Merged

ysyneu merged 1 commit into
mainfrom
docs/member-notify-drop-dry-run

Conversation

@ysyneu

@ysyneu ysyneu commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove dry_run from MemberNotifyRequest and html from MemberNotifyResponse in all four OpenAPI spec files (openapi.{en,zh}.json, platform.openapi.{en,zh}.json).
  • Document the new mandatory server-side validation: the raw html is inspected before sanitizing, and a construct whose removal would change what recipients see (<style>, <svg>, <iframe>, <object>, <embed>, <form>, <input>, <button> tags; an <img> with a missing or non-https src; a link outside http/https/mailto) now returns 400 / InvalidParameter instead of being silently stripped. Constructs whose removal never changes rendering (<script>, <meta>, <link>, <base> tags, on* handlers) are still sanitized silently.
  • Update the Go SDK reference page (developer/go-sdk.mdx, en/zh), which documented the same removed field.

dry_run made "does this call have a side effect" a boolean inside the request body, while the documented workflow builds one body and reuses it for both calls. The response echoed no mode, so the only discriminator was whether html came back non-empty — and the generated SDK declares html without omitempty, so a real send also returns the key. The result was a call that could silently do nothing while looking exactly like a successful send. Replacing the optional pre-flight with a mandatory server-side check removes the mode instead of documenting it.

Test plan

  • python3 -m json.tool on all four spec files — valid JSON
  • git diff --stat — touches only the member-notify schema/path areas plus the two go-sdk.mdx paragraphs
  • git grep dry_run across the repo — no remaining references

dry_run made "does this call have a side effect" a boolean inside the
request body, while the documented workflow builds one body and reuses
it for both calls. The response echoed no mode, so the only
discriminator was whether html came back non-empty -- and the
generated SDK declares html without omitempty, so a real send also
returns the key. The result was a call that could silently do nothing
while looking exactly like a successful send.

Remove dry_run from the request schema and html from the response
schema in all four OpenAPI spec files (openapi.{en,zh}.json,
platform.openapi.{en,zh}.json), and document the new mandatory
server-side check: the raw html is inspected before sanitizing, and a
construct whose removal would change what recipients see (style, svg,
iframe, object, embed, form, input, button tags; an img with a missing
or non-https src; a link outside http/https/mailto) now returns 400 /
InvalidParameter instead of being silently stripped. Constructs whose
removal never changes rendering (script, meta, link, base tags, on*
handlers) are still sanitized silently. Also updates the Go SDK
reference page, which documented the same removed field.
@ysyneu
ysyneu merged commit c39d70c into main Sep 21, 2026
2 checks passed
@ysyneu
ysyneu deleted the docs/member-notify-drop-dry-run branch September 22, 2026 09:46
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