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 +``` + +