Swagger中的条件查询参数

时间:2017-04-12 00:23:26

标签: swagger swagger-ui swagger-2.0 swagger-editor

我正在使用Swagger Editor创建API,在实现搜索端点时,我正在尝试这样做:

/pets:
    get:
      summary: Retrieve a list of pets
      description: Retrieve a list of pets based on search parameters
      parameters:
        - name: countryCode
          in: query
          description: The ISO 2-digit country code.
          required: false
          type: string
        - name: subdivisionCode
          in: query
          description: The ISO subdivision code.
          required: false
          type: string

如果包含countryCode,我只需要subdivisionCode,否则它们都是可选的。

有没有办法在Swagger中实现这一目标?

谢谢!

0 个答案:

没有答案
相关问题