【发布时间】:2016-03-18 11:49:00
【问题描述】:
如何访问特定定义的属性?我需要在我的 200 响应中显示“模式”节点中的属性,而不是整个“定义”。
这是 Yaml 代码:
paths:
/user/{user_id}:
get:
description: Devuelve un `user` pasándole su `user_id`.
produces:
- application/json
parameters:
- name: user_id
in: path
description: Identificador del `user`.
required: true
type: string
format: VarChar (255)
responses:
'200':
description: Ok
schema:
$ref: "#/definitions/User"
definitions:
User:
properties:
user_id:
type: integer
format: BigInt
description: Identificador del usuario.
email:
type: string
format: VarChar (255)
description: Email del usuario
pwd:
type: string
format: VarChar (255)
description: Password del usuario.
我的意思是,我只需要这样的东西:
responses:
'200':
description: Ok
schema:
$ref: "#/definitions/User/user_id"
有什么想法吗?
【问题讨论】: