Swagger Editor给出了这个示例响应:
[
{
"simulation_run_id": 0
}
]对于定义:
/v1/simulation-run-submissions:
post:
summary: 'Post a simulation run creation TODO: Will need to update API with parameters weather file, glmfile, name, start,end,interval, etc.. check wireframe. Submit model file and get back validation and ID. We will use the same API above and just return validation error.'
#description:
responses:
'201':
description: The metadata for a simulation run
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SimulationRunSubmissionResponse'
...
components:
schemas:
SimulationRunId:
type : integer
format: int64
minimum: 1
exclusiveMinimum: trueexclusiveMinimum选项似乎没有应用于模式,因为示例显示为0。
发布于 2018-12-20 16:47:15
目前,Swagger UI和Swagger Editor在生成请求和响应示例时不使用minimum和exclusiveMinimum值。请随意使用submit an enhancement request。
最简单的解决方案是手动指定example:
components:
schemas:
SimulationRunId:
type : integer
format: int64
minimum: 1
exclusiveMinimum: true
example: 2 # <-------https://stackoverflow.com/questions/53860864
复制相似问题