[4/4] docs: generate API reference samples that run, in current idioms - #149
Merged
Merged
Conversation
This was referenced Sep 29, 2026
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 29, 2026 13:08
6050494 to
c35ac8c
Compare
dazzatronus
added this pull request to stack #150
September 29, 2026 13:18
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 29, 2026 13:18
c35ac8c to
525ba45
Compare
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 29, 2026 23:05
525ba45 to
ddede70
Compare
dazzatronus
marked this pull request as draft
September 30, 2026 00:01
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 30, 2026 00:06
ddede70 to
e6ee699
Compare
dazzatronus
marked this pull request as ready for review
September 30, 2026 00:07
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 30, 2026 00:19
e6ee699 to
8d551ba
Compare
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 30, 2026 00:29
8d551ba to
a32ab00
Compare
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 30, 2026 00:33
a32ab00 to
c906de0
Compare
dazzatronus
force-pushed
the
derk/reference-code-samples
branch
from
September 30, 2026 00:43
c906de0 to
0e55c94
Compare
|
🎉 This PR is included in version 1.20.3 🎉 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.
Run against a local server, no POST sample in the reference worked in any language. Most sent no body, Ruby, Java and HTTP never sent the API key, Go didn't compile, and NodeJS needed
node-fetch, which no longer supportsrequire.This replaces widdershins's sample templates with
templates/code-samples. Each template reads like the sample it produces; the shared logic (header selection and rendering JSON as each language's literals) lives insample.def. Every sample reads the key fromSHOTSTACK_API_KEY(HTTP showsYOUR_API_KEY) and uses the language's current client: built-infetch,requests, Guzzle 7, Ruby'sNet::HTTP,java.net.httpand Go'snet/http. Optional headers are left out, so the Generate samples no longer all send one fixedIdempotency-Key.tests/reference-code-samples.cjsruns all 176 samples, plus each language against a body built to break string quoting, and checks the method, path, key and body that arrive. CI installs the eight runtimes.Also fixes the Direct Upload samples, which called the Edit API: the
build-docs.shrewrite missed/upload.463 lines: the templates and the check that proves them land together, because the check fails on the old templates.
Verify: CI step "Check reference code samples" →
184 of 184 ran correctly.Stack (merge in order)
<?phpin rendered PHP samples