redoc
redoc copied to clipboard
List of Object referenced in OneOf is not generating sample response
Redoc possibly not creating the 'Sample response' when using OneOf referencing array of objects(same type).
Below is the sample API definition:
openapi: 3.0.3
info:
title: Simple Pets API
description: |-
This is a sample Pets API showcasing some `oneOf` scenarios
version: 0.0.1
tags:
- name: pets
description: Everything about your Pets
paths:
/animals:
get:
tags:
- pets
summary: Get pets from catalog
description: Returns a list of pets found on the server
operationId: getAnimals
responses:
'200':
description: successful operation
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
components:
schemas:
Animal:
type: object
properties:
breed:
type: string
example: poodle
Cat:
type: array
items:
$ref: '#/components/schemas/Animal'
Dog:
type: array
items:
$ref: '#/components/schemas/Animal'
Actual Behaviour: No sample response generated in swagger documentation
Expected behaviour: Sample response for array of objects need to generated in the swagger
"[ { "breed":"poodle" } ]"
Hey @sudhapublic! We can confirm the issue on our end. Thanks for the report!
Stay tuned for updates.