Skip to content

Commit bcb4f5d

Browse files
devin-ai-integration[bot]aditya-arolkar-swedevalog
authored
Add x-fern-retries OpenAPI extension documentation (#1824)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Devin Logan <[email protected]>
1 parent 42c73be commit bcb4f5d

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

fern/products/api-def/api-def.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ navigation:
6666
path: ./openapi-pages/extensions/parameter-names.mdx
6767
- page: Property names
6868
path: ./openapi-pages/extensions/property-names.mdx
69+
- page: Retry behavior
70+
path: ./openapi-pages/extensions/retries.mdx
6971
- page: Schema names
7072
path: ./openapi-pages/extensions/schema-names.mdx
7173
- page: Server names

fern/products/api-def/openapi-pages/extensions/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ The table below shows all available extensions and links to detailed documentati
2929
| [`x-fern-sdk-variables`](./sdk-variables) | Set common path parameters across all requests |
3030
| [`x-fern-parameter-name`](./parameter-names) | Customize parameter variable names |
3131
| [`x-fern-property-name`](./property-names) | Customize object property variable names |
32+
| [`x-fern-retries`](./retry-behavior) | Configure retry behavior for endpoints |
3233
| [`x-fern-type-name`](./schema-names) | Override auto-generated names for inline schemas |
3334
| [`x-fern-server-name`](./server-names) | Name your servers |
3435

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Retry behavior
3+
subtitle: Configure retry behavior for endpoints using `x-fern-retries` extension
4+
---
5+
6+
<Callout intent="info">
7+
The `x-fern-retries` extension is supported in Python SDKs only.
8+
</Callout>
9+
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.
13+
14+
To disable retries for specific endpoints, set `disabled: true`.
15+
16+
```yaml title="openapi.yml" {4-5,15-16}
17+
paths:
18+
/plants/{plantId}:
19+
get:
20+
x-fern-retries:
21+
disabled: true
22+
operationId: get_plant
23+
parameters:
24+
- name: plantId
25+
in: path
26+
required: true
27+
schema:
28+
type: string
29+
/plants:
30+
post:
31+
x-fern-retries:
32+
disabled: true
33+
operationId: create_plant
34+
requestBody:
35+
required: true
36+
content:
37+
application/json:
38+
schema:
39+
type: object
40+
properties:
41+
name:
42+
type: string
43+
species:
44+
type: string
45+
responses:
46+
'201':
47+
description: Plant created successfully
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

Comments
 (0)