跳到导航

Changelog

1.64.2

(fix): Return a completed HTTP response instead of discarding it when the request context is canceled after the response has been fully received but before it is decoded. Caller.Call previously re-checked ctx.Err() at that point and returned context.Canceled / context.DeadlineExceeded with a nil response, which dropped valid responses that had already been buffered (for example by a logging http.RoundTripper that ends its scope before returning). Calls canceled before the request is sent, and calls whose response body cannot be read to completion once the context ends, continue to fail with the context’s error, and a canceled context still never triggers a retry.

1.64.1

(chore): Bump bundled @fern-api/generator-cli to 0.10.3. When the hosted auto-version analysis of the full SDK diff fails, generator-cli now retries chunk-by-chunk instead of silently applying a PATCH bump; any remaining unavailable or incomplete analysis adds a “Version bump not verified” notice to the SDK PR body and disables automerge.

1.64.0

(fix): Object type descriptions are now written directly above the type X struct declaration so go doc and editors attach them to the type. Previously the comment landed above the internal field-bitmask var (...) block emitted before the struct.

(feat): Fluent child methods on XML-encoded (TwiML) types (e.g. response.Say(...), dial.AddNumber(...)) now name the appended element and include the child type’s description in their doc comment.

1.63.0

(feat): Generated error types that carry a body now expose a nil-safe GetBody() accessor that returns the same type as the Body field. This lets callers handle every status-specific error through a single interface-based errors.As, e.g. type bodyProvider interface{ GetBody() *ErrorBody }. Errors without a body are unchanged.

(fix): reference.md now documents enum-typed query parameters, headers, and inlined request body properties (including lists of enums) with the same value types used on the generated request structs (e.g. []acme.CountryCode instead of []*acme.CountryCode).

1.62.1

(fix): Point the “Neither an import path nor a module path was specified” warning at the Go generator README in the fern monorepo; the old fern-api/fern-go link now 404s.

1.62.0

(feat): Generate the shared WebhooksHelper from the API-wide api.settings.webhook-signature setting in generators.yml (IR sdkConfig.webhookSignatureVerification). The helper is emitted even when the API definition models no webhooks; webhook-specific signature overrides still produce their own named helpers.

1.61.0

(feat): Errors declared with a 4XX or 5XX wildcard status code are now decoded into their typed error struct for any status in the 400-499 / 500-599 range. A concrete status code declared alongside a wildcard always wins, and a body that fails to decode as the wildcard error’s schema still returns the untyped *core.APIError.

1.60.2

(chore): Bump bundled @fern-api/generator-cli to 0.10.1. Auto-versioned MAJOR/MINOR bumps no longer produce a version-only changelog.md block when the AI analysis returns an empty changelog entry; the PR description, version bump reason, or commit message body is used instead.

1.60.1

(fix): DateTime.MarshalJSON now formats with time.RFC3339Nano, so fractional seconds survive a decode/encode round-trip. Whole-second values marshal byte-identically to before because .999999999 omits trailing zeros.

(fix): Date.UnmarshalJSON now accepts date-time input (e.g. 2025-02-15T00:00:00Z) as a fallback, preserving the calendar date exactly as written and discarding the time.

1.60.0

(feat): Add XML support for xml-encoded object types (e.g. TwiML). Generated types gain ToXml()/ToXmlElement(), <Type>FromXml(string)/<Type>FromXmlElement(...), fluent child builders (e.g. response.Say(...), Add-prefixed on collision), and ExtraAttributes/ExtraChildren to round-trip unknown attributes and elements. A standard-library core/xml.go runtime is emitted only when xml-encoded types exist.

1.59.0

(feat): Generate wire tests for endpoints that return a file download (io.Reader). The generated test calls the raw client, asserts the served Content-Type, reads the stream to completion and compares the bytes against the fixture. The WireMock mapping for these endpoints now serves a real binary payload (a small valid PDF via base64Body, application/octet-stream) instead of the JSON string "" with Content-Type: application/json. This also applies to OpenAPI-imported endpoints whose only autogenerated examples are error responses (e.g. Plaid’s /asset_report/pdf/get).

1.58.1

(fix): Preserve required-nullable fields that arrive as null when a decoded model is marshaled again. Generated UnmarshalJSON now records which required-nullable keys were present in the incoming JSON (via a per-type wire-name-to-field-bit table) so that MarshalJSON re-emits them as null instead of dropping them. Fields absent from the input stay absent, and freshly constructed values (e.g. request bodies) serialize exactly as before.

1.58.0

(feat): Add the enableNestedRequestBodyPagination configuration option, which extends enableRequestBodyPagination to page properties that live inside nested request objects, e.g. offset: $request.options.offset. Such endpoints previously generated without a pager, so the option defaults to false to preserve their existing return types.

- name: fernapi/fern-go-sdk
config:
enableRequestBodyPagination: true
enableNestedRequestBodyPagination: true

1.57.13

(fix): Calling a SetXxx setter on a value copy of a request or model type no longer changes the JSON of the value it was copied from. The private explicitFields bitmask is reached through a pointer, so a plain struct assignment aliased it and require mutated it in place, making every explicit-field bit set on one copy visible in all of them (e.g. copied.SetOptions(...) added "options":null to the original’s body). The bitmask is now replaced rather than mutated, so each copy gets its own on first write.

1.57.12

(fix): The retrier no longer waits out a Retry-After/backoff delay after its final attempt. Previously the sleep happened before the attempt budget was checked, so a client with retries disabled (or MaxAttempts: 1) still blocked for the full Retry-After on a 429/5xx, and the default two-attempt retrier paid two delays for one retry. Retrier exhaustion now returns immediately.

1.57.11

(fix): Fix HandleExplicitFields silently corrupting the JSON body of types that have date/date-time fields. When any SetXxx setter was called on such a type, the generated MarshalJSON wrapper (embedded struct plus date shadow fields) was not recognized as the embed pattern, so the explicit-field bits were applied to the wrapper’s fields instead of the embedded type’s fields and the embedded struct itself was dropped from the output (e.g. req.SetCount(&n) produced {"end_date":null} instead of {"count":7}). This also caused offset-based auto-pagination to loop forever. Shadow fields are now preserved and omitempty is stripped from the shadow field when the shadowed date field is explicitly set, so SetStartDate(nil) emits "start_date":null.

1.57.10

(fix): Optional idempotency headers are no longer sent with a Go expression prefix prepended to their value. An optional<string> idempotency header was sent with a literal * in front of the caller’s value, and an optional<base64> one with a literal base64.StdEncoding.EncodeToString(, because the dereference/encode prefix used to build the value expression was also interpolated into the fmt.Sprintf format string. Required headers were unaffected.

1.57.9

(fix): Retry backoff now waits on the request context, so a cancelled or expired context interrupts the wait instead of sleeping through it (previously a Retry-After of up to 60s could hold a call well past its deadline).

(fix): option.WithoutRetries() is now honored when passed to the client constructor. Previously the flag was dropped by NewRetrier and only worked per call. Request-scoped WithMaxAttempts still overrides it.

1.57.8

(fix): Honor endpoint-level retry configuration (x-fern-retries: { disabled: true }, or retries: { disabled: true } in a Fern definition). Endpoints that disable retries are now issued exactly once, regardless of the client-level and per-request retry options.

1.57.7

(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.