我正在通过Swagger 2.0创建API。在Swagger 2.0上一切都很好,但是,将其构建为Slate时,不会显示所有示例值,而仅显示数据类型。
例如大张旗鼓,我想要的是:
{
"cd": 0,
"data": {
"Num1": "113.90083333",
"Num2": "113.5991"
}
}
但是在构建后的Slate界面中,
{
"cd": "string",
"data": {
"Num1": "number",
"Num2": "number"
}
}
YAML代码:
/mar:
get:
tags:
- MP
operationId: "MP1"
produces:
- application/json
responses:
200:
description: "WELL"
schema:
type: object
properties:
cd:
type: string
example: 0
data:
type: object
properties:
Num1:
type: number
example: "113.90083333"
Num2:
type: number
example: "113.5991"