For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Overview
    • Introduction
    • How it works
    • Quickstart
    • Customer showcase
  • Working with SDKs
    • Project structure
    • Adding custom code
    • Migrating to Replay
    • Capabilities
  • Generators
      • Generating an SDK
      • Publishing as a Swift package
      • Configuration
      • Changelog
  • Reference
    • generators.yml
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • clientClassName
  • environmentEnumName
  • moduleName
  • maxRetries
  • enableWireTests
  • nullableAsOptional
GeneratorsSwift

Swift configuration

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Publishing as a Swift package

Next

Changelog

You can customize the behavior of the Swift SDK generator in generators.yml:

generators.yml
1groups:
2 swift-sdk:
3 generators:
4 - name: fernapi/fern-swift-sdk
5 version: 0.35.0
6 config:
7 clientClassName: YourClientName
8 environmentEnumName: YourCustomEnvironment
9 moduleName: MyCustomModule
10 enableWireTests: false
11 nullableAsOptional: true
clientClassName
string

The name of the generated client class. This allows you to customize the class name that users will instantiate when using your SDK.

environmentEnumName
string

The name of the generated environment enum. This allows you to customize the enum name that defines your API environments (such as production, staging, development) and ensures consistent naming across SDK generations.

moduleName
string

The module name used in client code (e.g., import MyCustomModule). When provided, this name is used consistently across the library, product, and target.

maxRetries
number

The default number of retries for failed requests. When not set, the generated SDK uses its own built-in default. SDK users can still override this per-request via request options.

enableWireTests
booleanDefaults to true

Generates mock server (wire) tests to verify that the SDK sends the correct HTTP requests and correctly handles responses per the API spec.

nullableAsOptional
booleanDefaults to false

When enabled, nullable fields are decoded as Swift optionals (T?) instead of the Nullable<T> wrapper type. This simplifies type handling but loses the ability to distinguish between explicit null values and absent fields. When disabled (default), nullable fields use the Nullable<T> wrapper type which preserves the distinction between fields explicitly set to null and fields that are missing from the response.