Swagger无法创建对象数组
您好,我正在尝试在swagger集线器中创建对象数组
但是我似乎无缘无故出现错误
LocationGetAllResponse:
properties:
type: array
items:
$ref: '#/components/schemas/LocationObject'
LocationObject:
type: object
properties:
longitude:
type: number
example: 1
latitude:
type: number
example: 2
altitude:
type: number
example:
我按照官方文档建模
但是我遇到的错误是>
Structural error at components.schemas.LocationGetAllResponse.properties.type
应该是对象
基本上在type:array上它应该是一个对象
任何帮助将不胜感激
您好,我正在尝试在swagger集线器中创建对象数组,但是我似乎由于似乎没有理由而得到一个错误LocationGetAllResponse:属性:类型:数组项:...
回答如下:只需删除“属性:”: