Swagger 大摇大摆的名单<;对象>;类型示例

Swagger 大摇大摆的名单<;对象>;类型示例,swagger,swagger-ui,swagger-2.0,Swagger,Swagger Ui,Swagger 2.0,我的回复中包含列表图像,如下所示 { images: [ { "name": "ABC", "content": "This is text" }, { "name": "ABC", "content": "This is text" } ] } YAML文件类似于以下示例。下面的YAML文

我的回复中包含
列表
图像,如下所示

  {
         images: [
          {
            "name": "ABC",
             "content": "This is text"
          },
          {
          "name": "ABC",
          "content": "This is text"
        }
       ]
  }
YAML
文件类似于以下示例。下面的
YAML
文件是否有效,是否等同于上面的图像JSON响应

responses:
     '200':
         description: 'Request is successful.'
         schema:
           $ref: '#/definitions/Images'

definitions:
   Images:
        type: array
        items:
          $ref: '#/definitions/Image'

   Image:
      type: object
      properties:
         name:
           type: string
         content:
           type: string
      required:
          - name
          - content

响应架构缺少包装器属性
images
。除此之外,你的定义是正确的

按如下方式更改
图像
模式:

定义:
图像:
类型:对象
特性:
图像:
类型:数组
项目:
$ref:“#/definitions/Image”
必修的:
-图像