I have document search request to DB which results in possibly 2 responses.
- List Response (If DB finds, multiple documents)
- Detailed response (If DB finds, 1 document).
Can we design in OpenAPI based on example return 200 - List Response and 201 - Detailed Response? Or Within 200 Response can we have sub type structures case 1 - List Response Structure and 2) Detailed Response Structure?
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/List'
'201':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/Detailed'