2015-05-26 35 views

回答

7

好的,我只是想出了如何做到这一点,以防有人需要id。 除专用模型定义部分(“定义”)外,还可以进行内联模型描述。上面的代码会是这样的:

responses: 
    "200": 
     description: Matched Objects 
     schema: 
     type: object 
     properties: 
      data: 
      type: object 
      properties: 
       authors: 
       type: array 
       items: 
        $ref: "#/definitions/object_with_id_and_title" 
+1

你能不能给整个响应和定义吗? – Gargoyle

+0

该对象的'meta'对象和'total'属性在哪里? – JCobb

相关问题