Changelog
0.46.4
(fix): Fix generated code failing to compile when a property is named self, Self, crate or super.
Rust rejects these as raw identifiers, so they are now suffixed with an underscore (self_)
and given an explicit #[serde(rename = "self")] to preserve the wire name.
0.46.3
(fix): Custom headers are applied when the SDK runs through an injected RequestExecutor (the path
used by generated CLI custom commands). ClientConfig::custom_headers — including an
X-Source-style override and the X-Fern-* platform headers — and
RequestOptions::additional_headers were previously dropped before delegating to the executor,
so they reached the wire on generated-path requests but not on custom-command ones. Auth and
retries remain the executor’s responsibility.
0.46.2
(fix): Endpoints that declare retries: { disabled: true } (x-fern-retries in OpenAPI) no longer
retry. The generated method pins max_retries to zero on the request options, overriding both
the client-level default and any caller-supplied value.
0.46.1
(fix): Fixed generated WireMock stubs for OAuth client credentials APIs whose token endpoint is
itself marked as authenticated: the token (and refresh) endpoint stub no longer requires
an Authorization header, since the token request is made to obtain the token and cannot
carry one yet.
0.46.0
(feat): Add respectOptionalRequestBody. When enabled, an endpoint whose request body the API does not
require takes the body as an Option, so a caller who passes None sends no body and no
Content-Type. Examples that omit the body render as None in snippets, reference docs, and
wire tests. The flag defaults to false, so existing SDKs keep their current method signatures.
0.45.0
(feat): Generated clients accept a custom reqwest::Client. ClientConfig gained a
reqwest_client: Option<reqwest::Client> field, set through the new
ApiClientBuilder::reqwest_client(...), and HttpClient uses it as-is when present
instead of building its own. This is the transport escape hatch other Fern SDKs already
expose (httpx_client in Python, OkHttpClient in Java, urlSession in Swift), and it
lets callers configure root certificates, client certificates, proxies and connection
pooling themselves. Authentication, custom headers and retries are still applied by the
SDK on top of the supplied client; when the field is None the client is built exactly
as before from timeout and user_agent.
0.44.5
(fix): Write the LICENSE file into the generated crate when a custom license is configured
(github.license.custom or metadata.license.custom), matching the other SDK generators.
When that file is written and neither packageLicense nor packageLicenseFile is set,
Cargo.toml now points license-file at it instead of defaulting to MIT.
0.44.4
(fix): Non-2xx responses with a body are now returned as errors instead of successes.
parse_response and parse_response_raw only consulted the status code inside
their empty-body branch, so any error response that carried a payload was
deserialized into the success type and returned Ok. When the success type can
absorb an arbitrary object — all-optional fields, a bare Value, a defaulted
collection — the call looked like an empty-but-successful result: a 401 surfaced
as “no results found” and the process exited 0, which a calling script reads as
“nothing to do”. The status is now checked before deserialization in both
methods, and the response body is carried through as the ApiError::Http
message so the server’s own error detail reaches the caller.
0.44.3
(fix): Fixed WireMock stubs for wire tests of APIs with auth: any combining Basic and
OAuth/Bearer schemes: stubs now accept either Authorization form instead of
requiring the exact Basic header the client may not send.
0.44.2
(fix): Fix discriminated union variants silently dropping inherited properties. When a variant’s
referenced object type got all of its properties from extends, the variant was inlined to
an empty struct, so the payload deserialized successfully but every field was discarded.
Such types are no longer inlined and keep their #[serde(flatten)] wrapper.
Note: this changes the generated public API for affected unions. A variant that was inlined
(e.g. FooExtended { age }, constructor foo_extended(age: i64)) now wraps the referenced
type (FooExtended { data: FooExtended }, constructor foo_extended(data: FooExtended)), so
consumers on a prior version with extends-based union variants may need to update call sites
when regenerating.
0.44.1
(fix): Apply client-level custom headers to the OAuth token request. The client-credentials
token exchange was built directly on the underlying HTTP client, so it was the only
request that skipped ClientConfig.custom_headers — APIs whose gateway requires a
header on the token endpoint rejected the exchange with a 401, and the
X-Fern-SDK-* headers were missing from token requests.
0.44.0
(feat): Add support for per-endpoint auth routing. When the API-level auth requirement is
ENDPOINT_SECURITY, each endpoint now applies only the auth scheme(s) it declares in
its IR security field (OR across the list of requirements, AND within a requirement,
and no auth when security is empty), instead of applying every configured credential
to every request. Behavior for the ALL and ANY auth requirements (the common cases)
is unchanged.
Inferred auth is not supported by the Rust SDK, so an endpoint whose only satisfiable
requirement is inferred auth returns a configuration error.
0.43.1
(fix): Escape Rust reserved keywords in generated enum variant names. An enum
value that PascalCases onto a keyword (e.g. self -> Self) is now
emitted as Self_ with the wire value preserved, instead of the
unparseable pub enum Foo { Self, ... }. Generated code examples
(README, reference docs, snippets, and doc-test comments) now reference
the same keyword-safe variant name so they compile too.
0.43.0
(feat): Endpoint methods now include a usage example in their rustdoc comments (under a
# Examples section), so IDEs surface a ready-to-use code snippet on hover. The
examples are the same dynamic snippets used for the README and reference.md, and
are fenced with ```no_run so cargo test doctests compile but do not execute them.
0.42.2
(fix): Endpoints now send API-, service- and endpoint-level headers whose types are literals
(e.g. Accept-Encoding: literal<"gzip">). Previously these headers were silently
dropped. Caller-supplied values via RequestOptions::additional_header still take
precedence over the literal defaults.
0.42.1
(fix): Enable the gzip feature on the generated SDK’s reqwest dependency so that
gzip-encoded response bodies are decompressed automatically. Previously,
reqwest was configured with default-features = false and no compression
features, so responses to requests with a spec-defined Accept-Encoding: gzip
header were returned as raw gzip bytes.
0.42.0
(feat): Wire up OAuth client-credentials authentication in the generated client. When an
OAuth client-credentials scheme is defined, the generated ClientConfig now carries
the resolved token endpoint and the HttpClient automatically fetches, caches, and
refreshes a bearer token before making authenticated requests. Previously the OAuth
scaffolding was present but never connected to the request flow.
0.41.2
(fix): Add a robust resolution chain for core as-is template files so the
generator works in standalone Docker, embedded CLI Docker, and
monorepo dev layouts. Supports FERN_RUST_ASIS_DIR env var override.
(fix): Escape Rust reserved keywords in generated client method names. An
endpoint named e.g. “move” now generates pub async fn r#move instead
of the unparseable pub async fn move.
0.41.1
(fix): Skip README, CONTRIBUTING, and reference.md generation when running in
cliEmbedded mode. These standalone docs require static assets (features.yml,
asIs/) only available in the standalone Docker image and are not needed for
embedded SDK crates.
0.41.0
(internal): Expose generateAndReturnContext() on SdkGeneratorCli for
in-process invocation by the CLI generator. Returns the populated
SdkGeneratorContext after generation completes.