Endpoint request snippet

Use the <EndpointRequestSnippet> components to reference an endpoint request from your API Reference.

Usage

POST
/chat/:domain
1curl -X POST https://fai.buildwithfern.com/chat/domain \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "messages": [
6 {
7 "role": "user",
8 "content": "string"
9 }
10 ]
11}'
Markdown
1<EndpointRequestSnippet endpoint="POST /chat/{domain}" />

Reference particular examples

1

Set the example name in your spec

openapi.yml
1paths:
2 /pet:
3 put:
4 summary: Update an existing pet
5 operationId: pets_update
6 requestBody:
7 content:
8 application/json:
9 schema:
10 $ref: '#/components/schemas/Pet'
11 examples:
12 ExampleWithMarkley:
13 value:
14 name: Markley
15 id: 44
pets.yml
1service:
2 auth: true
3 base-path: ""
4 endpoints:
5 update:
6 docs: Update an existing pet
7 method: PUT
8 path: /pet
9 request: Pet
10 examples:
11 - name: ExampleWithMarkley
12 request:
13 name: Markley
14 id: 44
2

Directly reference the example

Markdown
1 <EndpointRequestSnippet
2 endpoint="PUT /pet"
3 example="ExampleWithMarkley"
4 />
Referencing examples

If the example includes a summary or docs field, use that for the example prop. If not summary is set, use the example name.