最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

Swagger无法创建对象数组

IT培训 admin 11浏览 0评论

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:属性:类型:数组项:...

回答如下:

只需删除“属性:”:

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:属性:类型:数组项:...

回答如下:

只需删除“属性:”:

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论