0

嗨,我正在尝试更新一些 api swagger 文档,我想向键添加值,而不是只显示类型,例如

isGuaranteed: type: boolean value : true name: type: string value :John 无论如何添加标签值而不是只有类型?

4

1 回答 1

1

example您可以通过向属性定义添加和值来提供示例值:

      isGuaranteed:
        type: boolean
        example: true
      name:
        type: string
        example :John

在 Swagger UI 中渲染:

招摇UI

于 2016-05-16T17:49:14.373 回答