Parameter Names

Use x-fern-parameter-name to customize SDK parameter names for message properties

By default, Fern uses the property names from your AsyncAPI message schemas as SDK parameter names. You can customize these using the x-fern-parameter-name extension.

Customize message property names

Use x-fern-parameter-name to specify custom parameter names for message properties:

asyncapi.yml
1components:
2 schemas:
3 UserEvent:
4 type: object
5 properties:
6 user_id:
7 type: string
8 description: Unique user identifier
9 x-fern-parameter-name: userId
10 created_at:
11 type: string
12 format: date-time
13 x-fern-parameter-name: createdAt
14 notification_type:
15 type: string
16 enum: [email, sms, push]
17 x-fern-parameter-name: notificationType

This generates SDK methods with cleaner parameter names:

1// Instead of send({user_id: "123", created_at: new Date(), notification_type: "email"})
2client.sendNotification({
3 userId: "123",
4 createdAt: new Date(),
5 notificationType: "email"
6});

Language-specific parameter names

You can specify different parameter names for different programming languages:

asyncapi.yml
1components:
2 schemas:
3 OrderEvent:
4 type: object
5 properties:
6 order_id:
7 type: string
8 x-fern-parameter-name:
9 python: order_id
10 typescript: orderId
11 go: OrderID
12 java: orderId
13 csharp: OrderId

Channel parameter names

Customize parameter names for channel address variables:

asyncapi.yml
1channels:
2 user/{user_id}/notifications:
3 address: user/{user_id}/notifications
4 parameters:
5 user_id:
6 description: User identifier
7 x-fern-parameter-name: userId
8 schema:
9 type: string

This ensures consistent naming conventions across your SDK while maintaining compatibility with your existing message formats.