Skip to content

docs: document SDK snippets from sdk-config.yml builds - #7680

Merged
nerminamiller-postman merged 7 commits into
mainfrom
devin/1793305914-sdk-config-snippets
Nov 2, 2026
Merged

nerminamiller-postman merged 7 commits into
mainfrom
devin/1793305914-sdk-config-snippets

Conversation

@nerminamiller-postman

@nerminamiller-postman nerminamiller-postman commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Documents the sdk-gen SDK snippets feature from fern-api/fern#18480 and fern-api/fern#18512. The FERN_UPLOAD_SDK_GEN_SNIPPETS gate was removed in CLI 5.188.0 (fern-api/fern#18679), so this PR no longer needs to be held. The steps follow Adi's setup instructions.

Display SDK snippets (api-references/sdk-snippets.mdx)

Setup now has tabs, one per config file:

## Configuration
  Add examples to your API definition          (applies to both)
  <Tabs>
    <Tab "sdk-config.yml">  Requires CLI 5.188.0+. Steps: enable docs.snippets → add package + version in docs.yml → build at that version → generate the docs
    <Tab "generators.yml">  existing steps, unchanged + "Specify SDK versions" (moved in from Additional options)
## Additional options
  Set default snippet language                 (applies to both)
  • sdk-config.yml tab, step by step:
    1. Set docs.snippets.enabled: true in sdk-config.yml.
    2. In docs.yml, under the api: entry, add snippets.<lang> with package and version for each language you build. Use the version you're about to build, and list only languages you build.
    3. Run fern generate with a new version that matches docs.yml.
    4. Run fern generate --docs. On success the output shows Loaded SDK snippets (<lang>: N, ...).
  • Behavior notes in that tab:
    • Fern stores the snippets server-side and fern generate --docs fetches them (per Adi's review).
    • Builds are matched by sdkName, language and version.
    • A hand-written code sample in the same language takes precedence.
    • A failure only logs a warning, and the docs still publish.
  • Removed: the separate "Use SDK snippets with sdk-config.yml" H2. Its anchor is gone, so the sdk-config.yml reference now links to #enable-snippets-in-sdk-configyml.

sdk-config.yml reference

  • docs.snippets links to the new setup steps.
  • Adds a ### snippets subsection with enabled, format (md | json) and outputPath, taken from the @postman/sdk-config 0.17.0 schema.

Moved out: the Docs project structure changes are now in their own PR (#7704), because they don't depend on the flag.

Left out on purpose: the FERN_UPLOAD_SDK_GEN_SNIPPETS export (ignored since 5.188.0) and fern-beta (the flag removal shipped in the stable fern CLI).

Checked against fern-api/fern main (CLI code and tests)

  • docs.snippets.format / outputPath: the CLI never reads them. It reads only the artifact's placeholdersSnippetsUrl from sdk-gen-api and parses it as snippets.json. Whether sdk-gen honors them when it writes that file is server-side and not verifiable here.
  • experimental.dynamic-snippets: false: turns off only Fern's dynamic IR. sdk-gen snippets are attached in registerApiToFdr before and regardless of that check.
  • Languages: getSdkRequests asks sdk-gen for every targetLanguageSchema language except cli, mcp and terraform, so Swift and Rust are requested too (test: "reads the other SDK languages too, but not the targets that are not SDKs"). Kotlin has no docs.yml snippets key. The CLI changelog names only the seven languages the docs list.

Still open for the developer (@Postman-AdiBarHalevi)

  • Does sdk-gen produce snippets for Swift and Rust builds? If yes, the docs can add them.
  • Do format or outputPath change the placeholdersSnippetsUrl file?

Link to Devin session: https://app.devin.ai/sessions/de4b9751dd454ba1bcd0ad4d33e3dc72
Open in Devin Desktop: https://app.devin.ai/desktop/session/de4b9751dd454ba1bcd0ad4d33e3dc72?variant=devin
Requested by: @nerminamiller-postman

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

nerminamiller-postman and others added 2 commits October 29, 2026 20:42
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ture

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
nerminamiller-postman and others added 2 commits October 30, 2026 14:26
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ve project structure to its own PR

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@nerminamiller-postman
nerminamiller-postman marked this pull request as ready for review November 2, 2026 17:54
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@nerminamiller-postman
nerminamiller-postman merged commit 03fe625 into main Nov 2, 2026
4 checks passed
@nerminamiller-postman
nerminamiller-postman deleted the devin/1793305914-sdk-config-snippets branch November 2, 2026 19:09
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.

2 participants