Endpoint response snippet

Use the <EndpointResponseSnippet> component to reference an endpoint response from your API Reference.

Usage

Response
1{
2 "turns": [
3 {
4 "role": "user",
5 "content": "string"
6 }
7 ],
8 "citations": [
9 "string"
10 ]
11}
Markdown
1<EndpointResponseSnippet endpoint="POST /chat/{domain}" />

Reference particular examples

1

Set the example name in your spec

openapi.yml
1paths:
2 /pet/{petId}:
3 put:
4 summary: Get a pet
5 operationId: pets_get
6 responses:
7 '200':
8 content:
9 application/json:
10 schema:
11 $ref: '#/components/schemas/Pet'
12 examples:
13 ExampleWithMarkley:
14 summary: This is an example of a Pet
15 value:
16 name: Markley
17 id: 44
pets.yml
1service:
2 auth: true
3 base-path: ""
4 endpoints:
5 update:
6 docs: Get a pet
7 method: GET
8 path: /pet/{petId}
9 response: Pet
10 examples:
11 - name: ExampleWithMarkley
12 docs: This is an example of a Pet
13 response:
14 body:
15 name: Markley
16 id: 44
2

Directly reference the example

Markdown
1 <EndpointResponseSnippet
2 endpoint="GET /pet/{petId}"
3 example="ExampleWithMarkley"
4 />