docs(api): drop dry_run from member notify, document html validation 400 - #415
Merged
Merged
Conversation
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.
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.
Summary
dry_runfromMemberNotifyRequestandhtmlfromMemberNotifyResponsein all four OpenAPI spec files (openapi.{en,zh}.json,platform.openapi.{en,zh}.json).htmlis 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-httpssrc; a link outsidehttp/https/mailto) now returns400/InvalidParameterinstead of being silently stripped. Constructs whose removal never changes rendering (<script>,<meta>,<link>,<base>tags,on*handlers) are still sanitized silently.developer/go-sdk.mdx, en/zh), which documented the same removed field.dry_runmade "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 whetherhtmlcame back non-empty — and the generated SDK declareshtmlwithoutomitempty, 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.toolon all four spec files — valid JSONgit diff --stat— touches only the member-notify schema/path areas plus the two go-sdk.mdx paragraphsgit grep dry_runacross the repo — no remaining references