> This page is for SDK, version Legacy.
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# TypeScript serde layer

> Learn how to enable the TypeScript serde layer in Fern SDK generator to transform API field names to camelCase and validate requests at runtime.

> **You're viewing the legacy SDK docs**
>
> These pages cover SDK generation configured with `generators.yml`. New projects use `sdk-config.yml`, so see [the Current version of this page](/learn/sdks/generators/typescript/serde-layer) for up-to-date guidance. To move an existing project, follow the [SDK Config migration guide](/learn/sdks/legacy/generators/migration-guides/sdk-config), which walks through `fern sdk migrate`, and review the [`sdk-config.yml` reference](/learn/sdks/reference/sdk-config).

Fern's TypeScript SDK generator includes an optional serde layer that determines whether the generated SDK matches your original API naming conventions (snake_case vs. camelCase, case-sensitive fields) or follows TypeScript conventions. This serde layer is controlled by the `noSerdeLayer` option.

By default, the serde layer is **disabled** (`noSerdeLayer: true`), meaning field names are preserved exactly as they appear in your API specification.

## When to enable the serde layer

**`generators.yml`**

```yaml title="generators.yml" {7}
groups:
  ts-sdk:
    generators:
    - name: fern-typescript-sdk
      version: 3.107.3
      config:
        noSerdeLayer: false # Enable serde layer
```

When you turn on the serde layer, (`noSerdeLayer: false`), the TypeScript SDK generator includes custom serialization code that:

* Transforms all property names from your API to camelCase
* Validates requests and responses at runtime
* Supports complex types like `Date` and `Set`.

Enable the serde layer when you want idiomatic TypeScript conventions and don't have case-sensitive field conflicts. Keep it disabled when your API has fields that differ only by casing or when you need exact field name preservation.

## Additional configuration options

Several configuration options work alongside an enabled serde layer:

* `skipResponseValidation` disables the serde layer's runtime validation while keeping its transformation features
* `allowExtraFields` permits properties not defined in your schema.
* `useBigInt` enables custom JSON handling to preserve large number precision.

These options only take effect when the serde layer is enabled (`noSerdeLayer: false`), as they require the custom serialization infrastructure.

**`generators.yml`**

```yaml title="generators.yml" {7-10}
groups:
  ts-sdk:
    generators:
    - name: fern-typescript-sdk
      version: 3.107.3
      config:
        noSerdeLayer: false           # Enable serde layer
        skipResponseValidation: true  # Disable runtime validation errors
        allowExtraFields: true        # Allow undefined fields in responses
        useBigInt: true               # Preserve precision for large numbers
```

For the complete list of all TypeScript configuration options, go to [TypeScript configuration](/learn/sdks/legacy/generators/typescript/configuration).