docs: document runtime-version config for Python and Java SDK generators - #6452
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
docs: document runtime-version config for Python and Java SDK generators#6452devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| </ParamField> | ||
|
|
||
| <ParamField path="runtime-version" type="boolean" default="false" required={false} toc={true}> | ||
| When enabled, the generated SDK resolves the version it reports in the `X-Fern-SDK-Version` header and the `User-Agent` version segment at runtime from the jar manifest, instead of the version baked in at generation time. The generated `build.gradle` records the project version in the manifest, and the generation-time version is used as a fallback when the manifest attribute is absent. Enable this when external release tooling (such as `release-please`) determines the published version after generation, so the reported version always matches the published artifact. |
Contributor
There was a problem hiding this comment.
[FernStyles.Please] Avoid using 'please' in technical documentation.
| </ParamField> | ||
|
|
||
| <ParamField path="runtime_version" type="bool" default="false" required={false} toc={true}> | ||
| When enabled, the generated SDK resolves the version it reports in the `X-Fern-SDK-Version` header and the `User-Agent` version segment at runtime with `importlib.metadata.version()`, instead of the version baked in at generation time. Enable this when external release tooling (such as `release-please`) determines the published version after generation, so the reported version always matches the installed package. The generation-time version is used as a fallback when the distribution isn't installed. |
Contributor
There was a problem hiding this comment.
[FernStyles.Please] Avoid using 'please' in technical documentation.
Contributor
|
🌿 Preview your docs: https://fern-preview-devin-1785345024-runtime-version-config.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
Generated SDKs report their own version in telemetry (
X-Fern-SDK-Versionand the version segment ofUser-Agent), and that version is normally baked in as a literal when Fern generates the code. When an external tool owns versioning (release tooling that picks the version at release time, after generation), the baked guess can differ from what actually gets published, so the SDK reports a version that never existed. The Python and Java generators now accept an opt-in flag that resolves the version at runtime from the packaging layer instead, so the reported version always equals the installed or published package version.This documents that flag in the generator configuration references:
fern/products/sdks/generators/python/configuration.mdx: addsruntime_version(bool, defaultfalse) — resolves viaimportlib.metadata.version(), falling back to the generation-time version when the distribution isn't installed.fern/products/sdks/generators/java/configuration.mdx: addsruntime-version(boolean, defaultfalse) — resolves from the jar manifest (the generatedbuild.gradlerecords the project version there), falling back to the generation-time version when the manifest attribute is absent.Both entries are placed in the existing alphabetical
<ParamField>ordering. No changelog entries added — the SDK generator changelogs for this release already cover it (fern/products/sdks/generators/{java,python}/changelog/2026-07-28.mdx).Link to Devin session: https://app.devin.ai/sessions/f3747ac61a604274b333df8e8552729d