[2/4] fix: replace deprecated assets in the API examples and cover every request body - #151
Merged
Merged
Conversation
This was referenced Sep 30, 2026
|
🎉 This PR is included in version 1.20.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
The spec's examples teach deprecated features. The shared Edit example uses the
titleasset andtimeline.soundtrack, and five of the seven request bodies have no example, so generated clients and the reference fill them with placeholders. The Edit example also had three uses; the bundler turned two into$refpointers, and one reaches the published types as an@examplethat is only a pointer.This rewrites the Edit example with rich-text, an audio track and public sample media, gives the two response examples their own copy, and adds a small example to each remaining request body, inline so the generated zod exports don't change. Image generation examples use the default model,
nano-banana-2. Every Edit passesshotstack validate.Published package:
dist/zodis byte-identical, the JSON Schema output changes only theImageAsset.modelexample annotation,schema.d.tschanges only inside@examplecomments, andapi.bundled.jsoncarries the new examples. As afix:, merging releases a patch and triggers the SDK regeneration.tests/request-examples.cjsrequires a valid, pointer-free example for every JSON request body.Verify:
pnpm build && pnpm test:examples→Request examples: 7 valid.Risk: the SDKs regenerate; their changes should be limited to example documentation.
Stack (merge in order)
<?phpin rendered PHP samples