Changelog
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): 在生成的客户端中接入 OAuth 客户端凭证认证。当定义了 OAuth 客户端凭证方案时,生成的 ClientConfig 现在会携带解析后的令牌端点,且 HttpClient 在发起认证请求前会自动获取、缓存并刷新 bearer 令牌。此前 OAuth 脚手架虽然存在,但从未接入请求流程。
令牌交换现在遵循令牌端点所配置的请求/响应属性映射,而不再使用硬编码的 client_id/client_secret/grant_type 结构:请求体根据配置的属性名(例如 camelCase 的 clientId/clientSecret)构建,诸如 grant_type 之类的字面量属性仅在契约声明它们时才发送,访问令牌和过期时间也从配置的响应属性名中读取。
0.41.2
(fix): 为核心 as-is 模板文件添加健壮的解析链,使生成器在独立 Docker、嵌入式 CLI Docker
和 monorepo 开发布局中均能工作。支持 FERN_RUST_ASIS_DIR 环境变量覆盖。
(fix): 在生成的客户端方法名中转义 Rust 保留关键字。
名为例如”move”的端点现在生成 pub async fn r#move
而非无法解析的 pub async fn move。
0.41.1
(fix): 在 cliEmbedded 模式下跳过 README、CONTRIBUTING 和 reference.md 生成。
这些独立文档需要仅在独立 Docker 镜像中可用的静态资产(features.yml、asIs/),
嵌入式 SDK crate 不需要它们。
0.41.0
(internal): 在 SdkGeneratorCli 上暴露 generateAndReturnContext() 以供
CLI 生成器进行进程内调用。在生成完成后返回填充的 SdkGeneratorContext。
0.40.9
(fix): 修复带有二进制响应的多部分文件上传端点以使用流式方法,
并修复带有查询参数的文件上传端点以绑定查询折叠的信封类型而非裸体类型。
这两个问题导致了 ElevenLabs 语音转语音等端点(多部分 + 二进制响应 + 查询参数)的 cargo 构建失败。
0.40.8
(fix): 通过对共享 serde 重命名目标的查询参数字段使用 #[serde(skip)] 代替
#[serde(skip_serializing)],修复生成的请求结构体中的 unreachable pattern 警告。
(fix): 从生成的 HTTP 客户端模板中移除未使用的 ReqwestExecutor 结构体和实现。