Open
Description
I'm using version 2.0.0.rc41
When a response consists of a schema with some oneOf
elements not at root level only the first possibility is shown on json sample panel.
openapi: 3.0.0
info:
version: '1.0'
title: Test
security: []
paths:
'/test':
post:
operationId: test
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/S'
components:
schemas:
S:
type: object
properties:
p1:
oneOf:
- $ref: '#/components/schemas/S1'
- $ref: '#/components/schemas/S2'
S1:
type: string
S2:
type: integer
If instead the oneOf
element is at the root of the response the json sample correctly shows the switching schema buttons.
openapi: 3.0.0
info:
version: '1.0'
title: Test
security: []
paths:
'/test':
post:
operationId: test
responses:
'201':
description: Created
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/S1'
- $ref: '#/components/schemas/S2'
components:
schemas:
S1:
type: string
S2:
type: integer