问题
The following YAML:
openapi: 3.0.0
info:
title: test
version: 1.0.0
paths:
/test:
get:
summary: test
responses:
'200':
description: Test
content:
application/json:
schema:
oneOf:
- allOf:
- type: object
properties:
firstA:
type: string
- type: object
properties:
firstB:
type: string
- allOf:
- type: object
properties:
secondA:
type: string
- type: object
properties:
secondB:
type: string
Does not render at all in the swagger editor.
In ReDoc it also fails to render properly:
If nesting multiple allOf
instances directly inside of oneOf
is invalid, how could I achieve the same result with a valid spec?
回答1:
ReDoc author here. It is a ReDoc bug. Your spec is valid.
It has been already fixed and will be available in 2.0.0-alpha.40
.
来源:https://stackoverflow.com/questions/52563638/openapi-3-0-allof-inside-oneof