我在OpenAPI 3.0中将YAML用于api文档。对于一个字段,数据类型应为项目列表。
有没有办法做到这一点?
order-info-list:
type: List<#/components/schemas/Item>
这是Item模式。
components:
schemas:
Item:
type: object
properties:
id:
type: string
description: ID of item
name:
type: string
description: Name of item
quantity:
type: integer
description: Item quantity
unit-price:
type: integer
description: >-
Item unit price in cents
Same currency code & conversion exponent applies
additional-detail:
type: Map<string, string>
xml:
name: Item