Skip to content

Commit 887ec38

Browse files
committed
add name field for x-fern-examples
1 parent 068fa58 commit 887ec38

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 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.
13+
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.
1315

1416
```yaml title="openapi.yml" {5-19}
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)