Skip to content

Commit 19071ba

Browse files
authored
(api definitions) Add optional name field to x-fern-examples (#1185)
1 parent 750a21a commit 19071ba

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

fern/products/api-def/openapi-pages/extensions/examples.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@ you want to show more than one example in your documentation.
99

1010
`x-fern-examples` is an array of examples. Each element of the array
1111
can contain `path-parameters`, `query-parameters`, `request` and `response`
12-
examples values that are all associated. If you [defined global headers via the `x-fern-global-headers` extension](/api-definitions/openapi/extensions/global-headers), you must include the headers in your examples.
12+
examples values that are all associated. Optionally, you can add a `name` field to provide a descriptive label for each example.
1313

14-
```yaml title="openapi.yml" {5-19}
14+
If you [defined global headers via the `x-fern-global-headers` extension](/api-definitions/openapi/extensions/global-headers), you must include the headers in your examples.
15+
16+
```yaml title="openapi.yml" {4-21}
1517
paths:
1618
/users/{userId}:
1719
get:
1820
x-fern-examples:
19-
- headers:
21+
- name: Headers example # Optional descriptive label
22+
headers:
2023
custom_api_key: "capi_12345" # header defined using x-global-header extension
2124
userpool_id: "pool_67890" # header defined using x-global-header extension
22-
- path-parameters:
25+
- name: Get user 1234
26+
path-parameters:
2327
userId: user-1234
2428
response:
2529
body:

0 commit comments

Comments
 (0)