From d74f3f698955e2f035ca52fcb89a169850c2eaae Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 17:05:16 +0000 Subject: [PATCH] docs(sdks): document exactOptionalPropertyTypes TypeScript generator option Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../sdks/generators/typescript/configuration.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fern/products/sdks/generators/typescript/configuration.mdx b/fern/products/sdks/generators/typescript/configuration.mdx index c5c100575..666a7c26c 100644 --- a/fern/products/sdks/generators/typescript/configuration.mdx +++ b/fern/products/sdks/generators/typescript/configuration.mdx @@ -88,6 +88,18 @@ const bar: MyRootType.Foo.Bar = {}; ``` + +When enabled, every optional property in the generated SDK is emitted as `prop?: T | undefined`, and the generated `tsconfig` files enable TypeScript's [`exactOptionalPropertyTypes`](https://www.typescriptlang.org/tsconfig/#exactOptionalPropertyTypes) compiler option. This covers model types, inlined request types, client options, errors, and the `core/` utilities, so consumers whose own `tsconfig` sets `exactOptionalPropertyTypes: true` can use the SDK without type errors. + +This option applies with or without the serde layer, so it can be combined with either value of [`noSerdeLayer`](#noserdelayer). + +```yaml +# generators.yml +config: + exactOptionalPropertyTypes: true +``` + +