【发布时间】:2021-01-30 17:16:42
【问题描述】:
为了以应用程序为中心来描述 REST API,我正在尝试使用 ALPS 描述符及其工具。
假设我有一个对象“艺术品”,一件艺术品具有以下属性:标题、艺术形式、作者等。
我应该如何描述属性“作者”?在 OpenAPI 规范中这很简单,只需说“type: Array”,然后在“items”下指定引用。在 ALPS 中描述集合的等效方式是什么?
我使用 YAML 格式来描述 API。
我当前的描述符如下所示:
descriptors:
# vocabulary properties
- id: "identifier"
type: "semantic"
text: "Unique identifier within Alpha Org. This is not the serial number of the item. This identifier is automatically generated when a new artwork item is created in the system."
ref: "https://schema.org/identifier"
- id: "headline"
type: "semantic"
text: "Title of the artwork"
ref: "https://schema.org/headline"
- id: "artform"
type: "semantic"
text: "Form of the artwork: painting? photograph? sculpture? others?"
ref: "https://schema.org/artform"
- id: "authors"
type: "semantic"
text: "Authors of this artwork"
ref: "https://schema.org/author"
- id: "serialNumber"
type: "semantic"
text: "Serial number of the artwork. If the artwork does not have a serial number, such as an original painting from an artist, then this number is simply the examplar number, usually 1."
ref: "https://schema.org/serialNumber"
- id: "description"
type: "semantic"
text: "Description of the artwork"
ref: "https://schema.org/description"
- id: "obtainDate"
type: "semantic"
text: "Date on which Alpha Org obtained the ownership of this artwork."
ref: "https://schema.org/Date"
- id: "itemLocation"
type: "semantic"
text: "Location of the storage of the artwork item"
ref: "https://schema.org/itemLocation"
- id: "images"
type: "semantic"
text: "Images of the artwork"
ref: "https://schema.org/image"
【问题讨论】:
标签: api descriptor