Skip to content

[2/4] fix: replace deprecated assets in the API examples and cover every request body - #151

Merged
dazzatronus merged 3 commits into
mainfrom
derk/current-api-examples
Sep 30, 2026
Merged

dazzatronus merged 3 commits into
mainfrom
derk/current-api-examples

Conversation

@dazzatronus

@dazzatronus dazzatronus commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The spec's examples teach deprecated features. The shared Edit example uses the title asset and timeline.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 $ref pointers, and one reaches the published types as an @example that 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 passes shotstack validate.

Published package: dist/zod is byte-identical, the JSON Schema output changes only the ImageAsset.model example annotation, schema.d.ts changes only inside @example comments, and api.bundled.json carries the new examples. As a fix:, merging releases a patch and triggers the SDK regeneration.

tests/request-examples.cjs requires 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)

PR Adds Why it is separate
1/4 #147 (merged) Keeps <?php in rendered PHP samples A Shins fix, independent of what the samples contain
2/4 ← this PR #151 Current, valid examples in the spec Changes the published spec, so it releases a patch
3/4 #148 Shows each request body's example in the reference Docs build only
4/4 #149 Current-idiom sample templates and a check that runs them Depends on the examples; the check and templates land together

@dazzatronus
dazzatronus merged commit ebbe0a0 into main Sep 30, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.20.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant