Skip to navigation

Customize method names

View as Markdown
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 for up-to-date guidance. To move an existing project, follow the SDK Config migration guide, which walks through fern sdk migrate, and review the sdk-config.yml reference.

You can fine-tune your SDK method and group names to create intuitive, user-friendly code that matches your API’s purpose. For example, instead of client.postUsers you can configure your SDK to read client.users.create().

Generated SDK behavior

Fern generates SDK methods using your configured group and method names. Casing is automatically adapted for each language (snake_case in Python, camelCase in TypeScript, PascalCase in Go, etc.), so you define the endpoint structure once and get correctly formatted methods across all generated SDKs.

const response = await client.users.create();

Setting up method names

Configure how endpoints map to SDK method and group names in your API definition:

openapi.yml
paths:
/users:
post:
x-fern-sdk-group-name: users
x-fern-sdk-method-name: create

For full configuration details, see Method names in OpenAPI.

Ignoring OpenAPI tags

Without extensions, Fern derives group names from operation tags. Set ignore-tags in generators.yml to ignore tags and derive SDK structure from each operation’s operationId instead.