【发布时间】:2021-12-17 19:24:48
【问题描述】:
我正在尝试在 swagger 中创建一个 YAML 模式,它具有如图所示的树状结构。数组中的数组中应该有数组。使用$ref 来指代相同的结构,但我变得空白。它没有生成完整的结构。
Asset:
type: array
items:
id:
type: string
serial:
type: number
...
...
Asset:
type: array
items:
$ref: '#/components/schemas/Asset'
【问题讨论】:
-
你能添加一个你试图描述的 JSON 结构的例子吗?
-
更新 - 所以,它按预期工作。虽然我看不到结构,但类是以树格式生成的。