1

我有这个大摇大摆的定义

/memberdetails/Prospect:
    post:
      tags:
        - memberdetails
      summary: Create member details using member object.
      operationId: memberdetails.Prospect
      parameters:
        - name: authenticationkey
          in: formData
          required: true
          type: string
          format: JSON
        - name: member_object
          in: form
          required: true
          type: string
          format: JSON
      responses:
        '200':
          description: Request was successful
          schema:
            type: object
            properties:
              data:
                type: object
      deprecated: false

但它给了我以下错误

✖ Swagger 错误不是有效的参数定义跳转到第 6996 行详细信息对象代码:“ONE_OF_MISSING”参数:数组 [0] 消息:“无效的参数定义”路径:数组 [5] schemaId:“ http://swagger.io /v2/schema.json# “内部:数组 [2] 级别:900 类型:“Swagger 错误”描述:“不是有效的参数定义”行号:6996

4

1 回答 1

1

您的第二个参数的“in”值无效,它应该是formData

根据 Swagger 规范:

in:参数的位置。可能的值为“query”、“header”、“path”、“formData”或“body”。

于 2016-07-26T14:10:16.777 回答