-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): support
x-fern-parameter-name
on path parameters (#4349)
- Loading branch information
Showing
44 changed files
with
2,917 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
fern/pages/api-definition/openapi/extensions/method-names.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Customize SDK Method Names | ||
description: Use `x-fern-sdk-method-name` and `x-fern-sdk-group-name` to finetune SDK naming. | ||
--- | ||
|
||
<Note> | ||
The `x-fern-sdk-group-name` and `x-fern-sdk-method-name` extensions allow you to customize the generated SDK method | ||
names. | ||
</Note> | ||
|
||
## Usage | ||
|
||
In the example below, Fern will generate a method called `client.users.create()` for the `POST /users` endpoint. | ||
|
||
```yaml title="openapi.yaml" | ||
paths: | ||
/users: | ||
post: | ||
x-fern-sdk-group-name: users | ||
x-fern-sdk-method-name: create | ||
``` | ||
## Top level methods | ||
If you omit the `x-fern-sdk-group-name` extension, then the generated SDK method will live at the root. | ||
In the example below, Fern will generate a method called `client.send()`: | ||
|
||
```yaml title="openapi.yaml" | ||
paths: | ||
/send: | ||
post: | ||
x-fern-sdk-method-name: send | ||
``` | ||
|
||
## Multiple levels of nesting | ||
|
||
If you add more than one `x-fern-sdk-group-name` extension, then the generated SDK will nest group names. | ||
The order of the group names is preserved in the generated SDK method. | ||
|
||
In the example below, Fern will generate a method called `client.users.notifications.send()`: | ||
|
||
```yaml title="openapi.yaml" | ||
paths: | ||
/users/notifications: | ||
post: | ||
x-fern-sdk-group-name: | ||
- users | ||
- notifications | ||
x-fern-sdk-method-name: send | ||
``` |
Oops, something went wrong.