Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions fern/products/api-def/openapi-pages/extensions/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ you want to show more than one example in your documentation.

`x-fern-examples` is an array of examples. Each element of the array
can contain `path-parameters`, `query-parameters`, `request` and `response`
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.
examples values that are all associated. Optionally, you can add a `name` field to provide a descriptive label for each example.

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

```yaml title="openapi.yml" {4-21}
paths:
/users/{userId}:
get:
x-fern-examples:
- headers:
- name: Headers example # Optional descriptive label
headers:
custom_api_key: "capi_12345" # header defined using x-global-header extension
userpool_id: "pool_67890" # header defined using x-global-header extension
- path-parameters:
- name: Get user 1234
path-parameters:
userId: user-1234
response:
body:
Expand Down