mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
4c31f3683c
* ai/ keywords * api/ keywords * components/ keywords * create/ keywords * customize/ keywords * api-playground/ keywords * dashboard/ keywords * deploy/ keywords * guides/ keywords * insights/ keywords * integrations/ keywords * optimize/ keywords * organize/ keywords * root/ keywords * rm temp files
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
---
|
|
title: "Multiple responses"
|
|
description: "Document multiple response variations for API endpoints."
|
|
keywords: ["response examples", "conditional responses", "response variations", "examples property"]
|
|
---
|
|
|
|
If your API returns different responses based on input parameters, user context, or other conditions of the request, you can document multiple response examples with the `examples` property.
|
|
|
|
This property can be added to any response and has the following schema.
|
|
|
|
```yaml
|
|
responses:
|
|
"200":
|
|
description: Successful response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/YourResponseSchema"
|
|
examples:
|
|
us:
|
|
summary: Response for United States
|
|
value:
|
|
countryCode: "US"
|
|
currencyCode: "USD"
|
|
taxRate: 0.0825
|
|
gb:
|
|
summary: Response for United Kingdom
|
|
value:
|
|
countryCode: "GB"
|
|
currencyCode: "GBP"
|
|
taxRate: 0.20
|
|
```
|