3
---
swagger: '2.0'
info:
version: 0.0.0
title: Simple API
paths:
/:
get:
responses:
200:
description: OK
definitions:
Thing:
properties:
parent_thing:
allOf:
- $ref: '#/definitions/Thing'
description: parent of this thing
这是最简单的例子。如果我在swagger-editor中编写它,它会显示parent_thing的类型为undefined
:https://i.imgur.com/OGHlKxg.png如何在定义中引用自我?
如何解决这个问题?我想Thing
有一个参考其他Thing
s。
两种方式都显示“未定义”。顺便说一句,你认为使用allOf是错误的吗?我用它是因为我想使用自定义描述来说明属性的含义。 – CrabMan
请在swagger-editor中提交一张票。上面列出的内容是正确和有效的,如果不显示,则需要修正。 – fehguy