首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未应用Swagger OAS3.0中的exclusiveMinimum

未应用Swagger OAS3.0中的exclusiveMinimum
EN

Stack Overflow用户
提问于 2018-12-20 08:12:03
回答 1查看 283关注 0票数 0

Swagger Editor给出了这个示例响应:

代码语言:javascript
复制
[
  {
    "simulation_run_id": 0
  }
]

对于定义:

代码语言:javascript
复制
  /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: true

exclusiveMinimum选项似乎没有应用于模式,因为示例显示为0。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-20 16:47:15

目前,Swagger UI和Swagger Editor在生成请求和响应示例时不使用minimumexclusiveMinimum值。请随意使用submit an enhancement request

最简单的解决方案是手动指定example

代码语言:javascript
复制
components:
  schemas:
    SimulationRunId:
      type : integer
      format: int64
      minimum: 1
      exclusiveMinimum: true
      example: 2  # <-------
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53860864

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档