首页 > 解决方案 > Swagger 编辑器不显示多部分表单请求参数

问题描述

还没有找到一个实际工作的例子。我有的:

"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 等。

标签: swaggerdocumentation-generationopenapiswagger-editor

解决方案


推荐阅读