Swagger编辑器未显示多部分表单请求参数

时间:2018-12-07 09:55:46

标签: swagger documentation-generation openapi swagger-editor

没有找到实际可行的示例。我所拥有的:

"beacons/add/picture": {
  "post": {
    "tags": [
      "Beacon"
    ],
    "description": "Add Beacon Picture",
    "operationId": "addBeaconPic",
    "produces": [
      "application/json"
    ],
    "requestBody" : {
      "required": true,
      "content" : {
        "multipart/form-data" : {
          "schema" : {
            "$ref": "#/definitions/AddBeaconPicture"
          }
        }
      }
    },
    "responses": {
      "200": {
        "description": "",
        "schema": {
          "$ref": "#/definitions/BaseResponse"
        }
      },
      "400": {
        "description": "unexpected error",
        "schema": {
          "$ref": "#/definitions/ErrorModel"
        }
      }
    }
  }
}

在文档中,参数看起来为空,但是需要多个表单参数,例如id,name等。

0 个答案:

没有答案