【发布时间】:2021-12-22 15:48:49
【问题描述】:
当使用以下招摇时,生成的端点有一个示例响应与我认为招摇(和模型)规定的不一致。
大摇大摆:
components:
examples: {}
headers: {}
parameters: {}
requestBodies: {}
responses: {}
schemas:
SubSubData:
type: object
properties:
subSubDataProp:
type: string
SubData:
allOf:
- $ref: '#/components/schemas/SubSubData'
- type: object
properties:
subDataProp:
type: string
Data:
allOf:
- $ref: '#/components/schemas/SubData'
- type: object
properties:
dataProp:
type: string
ExampleResponse:
type: object
properties:
data:
$ref: '#/components/schemas/Data'
info:
title: __PROJECT_NAME__
version: 1.0.0
description: |
Add your Swagger description here.
license:
name: ISC
contact:
name: Me
openapi: 3.0.0
paths:
/example:
get:
operationId: GetData
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/ExampleResponse'
security: []
预期的反应:
{
"data": {
"dataProp": "string",
"subDataProp": "string",
"subSubDataProp": "string"
}
}
实际:
{
"data": {
"dataProp": "string"
}
}
我错过了什么吗?或者这是swagger ui/openapi中的一个错误
【问题讨论】:
标签: swagger swagger-ui openapi