allOf 与数组项中的属性
GET/allof-with-properties-in-array-item
一个演示 allOf 与数组项中的属性的图书列表。
模式:
type: array
items:
$ref: '#/components/schemas/Book'
模式组件:
BookBase:
type: object
required:
- id
- title
- author
properties:
id:
type: integer
format: int64
description: 书籍的唯一标识符
title:
type: string
description: 书籍的标题
author:
type: string
description: 书籍的作者
AdditionalBookInfo:
type: object
properties:
publishedDate:
type: string
format: date
description: 书籍发布日期
genre:
type: string
description: 书籍的类型
tags:
type: array
items:
type: string
description: 与书籍相关的标签
CategorizedBook:
allOf:
- $ref: '#/components/schemas/BookBase'
- $ref: '#/components/schemas/AdditionalBookInfo'
properties:
category:
type: string
description: 书籍的分类
Responses
- 200
图书列表