Customize parameter names

The x-fern-parameter-name extension allows you to customize the variable names of parameters in your generated SDKs.

Headers

In the example below, the header X-API-Version is renamed to version in the generated SDK. The rename makes the SDK more human readable.

1paths:
2 "/user":
3 get:
4 operationId: list_user
5 parameters:
6 - in: header
7 name: X-API-Version
8 x-fern-parameter-name: version
9 schema:
10 type: string
11 required: true

Query parameters

In the example below, the query parameter q is renamed to search_terms in the generated SDK. The rename makes the parameter more approachable for end users.

1paths:
2 "/user/search":
3 get:
4 operationId: search_user
5 parameters:
6 - in: query
7 name: q
8 x-fern-parameter-name: search_terms
9 schema:
10 type: string
11 required: false

Path parameters

In the example below, the path parameter userId is renamed to id in the generated SDK. The rename makes the SDK less verbose.

1paths:
2 "/user/{userId}":
3 get:
4 operationId: get_user
5 parameters:
6 - in: path
7 name: userId
8 x-fern-parameter-name: id
9 schema:
10 type: string
11 required: false