Contents of array is not displayed within the response when using oneOf
Open
@AlexVarchuk is already working on this.
Since Jul 7, 2022.
p2
Type: Bug
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
When a schema has an array, the contents of the array are shown in the right hand side display window when set as a response, however when oneOf is used it shows as an empty array.
openapi: "3.0.2"
info:
title: API Title
version: "1.0"
servers:
- url: https://api.server.test/v1
paths:
/test_oneof:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/a'
/test_without_oneof:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/a'
components:
schemas:
a:
type: array
items:
type: object
properties:
b:
type: string

The details are shown in the centre panel regardless of whether oneOf is used or not.
Below shows that this is valid and displayed correctly in the swagger editor

(edit: added swagger editor screenshot)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.