You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/api-def/openapi-pages/extensions/retries.mdx
+7-23Lines changed: 7 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@ subtitle: Configure retry behavior for endpoints using `x-fern-retries` extensio
7
7
The `x-fern-retries` extension is supported in Python SDKs only.
8
8
</Callout>
9
9
10
-
The `x-fern-retries` extension allows you to configure retry behavior at the endpoint level in your OpenAPI specification. This gives you fine-grained control over how the generated SDK handles retries for specific endpoints, overriding any user-defined or default retry configuration.
10
+
The `x-fern-retries` extension configures retry behavior per endpoint in your OpenAPI specification, overriding any
11
+
retry settings configured by SDK users. Use it to disable retries for non-idempotent operations like payment
12
+
processing or order creation.
11
13
12
-
## Disable retries
14
+
To disable retries for specific endpoints, set `disabled: true`.
13
15
14
-
To disable retries for a specific endpoint, set `disabled: true`:
15
-
16
-
```yaml title="openapi.yml" {4-5}
16
+
```yaml title="openapi.yml" {4-5,15-16}
17
17
paths:
18
18
/plants/{plantId}:
19
19
get:
@@ -26,24 +26,6 @@ paths:
26
26
required: true
27
27
schema:
28
28
type: string
29
-
```
30
-
31
-
When retries are disabled at the endpoint level, the generated SDK won't retry failed requests to that endpoint, regardless of the SDK's user custom configuration.
32
-
33
-
## Use cases
34
-
35
-
The `x-fern-retries` extension is useful when you want to:
36
-
37
-
- **Disable retries for non-idempotent operations**: Prevent automatic retries on endpoints that shouldn't be retried, such as payment processing or order creation endpoints
38
-
- **Override user configuration**: Ensure specific endpoints never retry, even if the end user has configured global retry settings in their SDK client
39
-
- **Control retry behavior per endpoint**: Apply different retry strategies to different parts of your API based on their characteristics
40
-
41
-
## Example: Disable retries for a POST endpoint
42
-
43
-
This example disables retries for a plant creation endpoint to prevent duplicate entries:
44
-
45
-
```yaml title="openapi.yml" {4-5}
46
-
paths:
47
29
/plants:
48
30
post:
49
31
x-fern-retries:
@@ -64,3 +46,5 @@ paths:
64
46
'201':
65
47
description: Plant created successfully
66
48
```
49
+
50
+
When retries are disabled at the endpoint level, the generated SDK won't retry failed requests to that endpoint, regardless of the SDK's user custom configuration.
0 commit comments