Skip to main content
Feedback

OpenAPI (legacy) connector response examples

Response examples can be added to parameters, properties and objects in your OpenAPI document schema.

Response examples allow responses to be obtained using the connector, based on examples in the document schema, without actually having to retrieve response data from an external API.

An example key can be defined for a query endpoint, which will then be returned by the connector, instead of relying on a response from an external API.

For example:

1  "/crud/example/get-media":
2 get:
3 summary: Get where example returned is the one set against application/json media type
4 operationId: ExampleGetMedia
5 responses:
6 200:
7 description: successful operation
8 content:
9 application/json:
10 schema:
11 $ref: '#/components/schemas/ExampleGetMediaResponse'**
12 example:
13 id: 99
14 name: MediaType example**
15 security:
16 - x-api-key: []

To learn more about using OpenAPI response examples, refer to Adding examples in the SmartBear OpenAPI Guide.

Response examples

On this Page