1.47.2
(fix): Normalize the architecture label in the structured User-Agent (emitted when
includePlatformHeaders is enabled) so the 64-bit x86 aliases (x64,
amd64, x86_64) all report as the canonical x86_64, keeping the value
consistent across generators.
1.47.1
(fix): Decompress gzip-encoded response bodies when the Accept-Encoding header is set
explicitly on the request. Go’s net/http only performs transparent gzip
decompression when it adds the Accept-Encoding header itself, so responses to
requests with a spec-defined Accept-Encoding: gzip header were previously
returned as raw gzip bytes.
1.47.0
(feat): Add opt-in support for a structured User-Agent header on generated SDK
clients for better runtime/platform observability. When enabled, the header
takes the form {sdkName}/{sdkVersion} ({os}; {arch}) Go/{version}, where the
operating system (runtime.GOOS), architecture (runtime.GOARCH), and Go
runtime version (runtime.Version()) are all resolved at runtime; unknown
components are omitted rather than reported as empty. This behavior is gated
behind a new includePlatformHeaders config option and is disabled by
default, so existing generated output is unchanged. When enabled it is still
subject to omitFernHeaders and is omitted when that is set.
1.46.5
(fix): Honor the OAuth client-credentials token endpoint’s declared request content-type
instead of unconditionally forcing application/x-www-form-urlencoded. Token
endpoints that consume application/json now send Content-Type: application/json,
while form-urlencoded remains the default when the spec does not declare a content-type
(per RFC 6749 §4.4.2). Previously a JSON token endpoint received an HTTP 415 that
surfaced as a generic 401.
1.46.4
(fix): 将 SSE 流自动重连与参考 TypeScript 实现对齐:
(1) 未配置流终止符时不重连(防止在正常 EOF 时出现重连风暴)。(2) 当服务器未发送 retry: 指令时,重连之间应用默认 1 秒最小退避。(3) 仅在已分发事件(空行边界)时提交 Last-Event-ID,而非在中途断开的未完成事件中解析但未分发的 id 上——修复重连时的静默事件丢失。
(4) 在进度(每个产出的事件)时重置连续重连尝试计数器。(5) 优雅处理失败/nil-body 重连响应,通过消耗一次尝试并重试,而非立即暴露错误。(6) 未分发任何事件 ID 时不重连——使用空 Last-Event-ID 重连会重放整个流(重复事件)。(7) 防止 reconnectFn 返回 nil *http.Response 时的 nil 指针 panic。
(8) 当 reconnectFn 同时返回响应和错误时关闭响应体。
1.46.3
(fix): 生成的 raw_client.go 现在对成功响应体为可选的端点(例如同时返回带请求体的
2xx 和 204 No Content 的操作)在 CallParams 中设置 ResponseIsOptional: true。
此前该字段从未生成,导致真正的 204(空请求体)在调用方触发 io.EOF,
作为错误返回而非成功的无请求体响应。
1.46.2
(fix): 修复 v2 GoTypeMapper 和 DynamicTypeMapper 中可空 $ref 别名字段的双指针类型,
与 model.go 中 v1 的修复保持一致。
1.46.1
(fix): 修复通过 $ref 引用共享组件 schema 的可空日期字段生成双指针类型的问题。
当可空类型别名(例如 type Iso8601DateNullable = *time.Time)用作字段类型时,
生成器错误地生成了 *Iso8601DateNullable(实际上是 **time.Time),
导致 Go 编译错误。生成器现在检测已解析为指针类型的别名并避免额外的指针包装。
1.46.0
(feat): Add a dedupeUnionBaseProperties config option (default false). When enabled, a
discriminated union no longer emits a duplicate top-level field for base properties
that every variant already carries (e.g. properties lifted from a shared parent by
infer-discriminated-union-base-properties). Without it, such a property appears both
on the union and inside each variant struct, and the top-level copy is silently
dropped when marshaling samePropertiesAsObject variants. With the flag on, the
shared property is exposed through a getter that switches on the discriminant and reads
from the active variant — a single source of truth that still allows top-level access
without a type switch. The flag is opt-in to preserve the existing generated surface;
the default will flip in a future major version with a migration.
1.45.5
(fix): Fix compile errors in generated Go SDKs where the v2/ TypeScript client,
its generated tests, and the generated dynamic snippet tests referenced
types in their original package after the v1 generator had relocated those
leaf types into the shared common package to break an import cycle. The v1
generator now records the relocations in a sidecar that the v2 generator
reads, and also writes them to a host-readable file (when the Fern CLI asks
for it) so the CLI’s dynamic snippet test generator references the relocated
types from the same package too.
1.45.4
(fix): Fix generated Go failing to compile when an undiscriminated union is sent as
a request header. Such unions now generate a String() method (fmt.Stringer)
and the client serializes the header via that method, instead of passing the
union struct where a string is expected.
1.45.3
(fix): Fixed pagination for endpoints whose results property is a named alias to a
list or set (e.g. results: $response.data where data is a UserList
alias). Previously v1 generation aborted with “unsupported pagination
results type”, and once that was resolved the generated pager used the alias
itself as the page element type, producing code that did not compile. The
results element type is now resolved through alias indirection (and
optional/nullable wrappers) in both generators, so the pager’s element type
matches the endpoint’s returned page type.
1.45.2
(fix): Skip generating wire test files when all endpoints in a service are
skipped (e.g., file download or bytes request body endpoints). Previously
this produced a test file with a missing require import.
1.45.1
(fix): Skip file download response endpoints from wire test generation. Autogenerated
examples for these endpoints produce error responses rather than binary content,
causing wire tests to always fail.
1.45.0
(feat): The Go SDK now accepts space-separated datetime strings (e.g. “2025-02-15 10:30:00+00:00”)
in addition to standard RFC3339 format during deserialization. This matches the leniency of
the Python and TypeScript SDKs.
1.44.9
(fix): Fixed a compilation error when a discriminated union’s discriminant property
name collides with one of its member discriminant values (e.g. a discriminant
“event” with a union member also keyed “event”). The discriminant struct field
is now disambiguated to keep the generated Go code valid and compilable.
1.44.8
(fix): Fixed a nil-pointer panic when an object or inlined request body extends an
alias. The generator now resolves the extended type through alias
indirection to its underlying object, so its properties are inherited
correctly instead of crashing generation.
1.44.7
(fix): Fix duplicate struct fields and getters generated for a discriminated union
when a base property shares a name with a property inherited via extends.
The base property is now skipped in favor of the extended property, so the
generated Go compiles.
1.44.6
(fix): Fix generated Go failing to compile for APIs that use literals. Undiscriminated
union members whose literal value is not a valid Go identifier (e.g. starting with
a digit) now produce a valid exported field name, literal query parameters are no
longer double-quoted, and literal path parameters are now passed as their concrete
value in dynamic snippets instead of nil.
1.44.5
(fix): Support endpoints that use URI- or path-based pagination (next_uri / next_path).
The v1 generator no longer aborts with “uri pagination is not supported yet”; these
endpoints are generated as regular methods that return the full response.