diff --git a/api-playground/openapi/advanced-features.mdx b/api-playground/openapi/advanced-features.mdx index d68b47e6..b3c78e4b 100644 --- a/api-playground/openapi/advanced-features.mdx +++ b/api-playground/openapi/advanced-features.mdx @@ -135,3 +135,32 @@ paths: const planter = require('planter'); planter.list({ potted: true }); ``` + +## Multiple Response Examples + +If your API returns different responses based on the request, you can provide multiple examples. + +For example here's two different responses for a 200 response. + +```yaml [expandable] +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 +```