Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kotlin Swagger UI以非分解形式发送表单参数_Kotlin_Swagger_Swagger Ui_Openapi - Fatal编程技术网

Kotlin Swagger UI以非分解形式发送表单参数

Kotlin Swagger UI以非分解形式发送表单参数,kotlin,swagger,swagger-ui,openapi,Kotlin,Swagger,Swagger Ui,Openapi,我不明白为什么“columns”和“documentid”参数被swagger ui作为逗号分隔的值发送,而不是作为默认的分解键=val1&key=val2形式发送 定义如下: RouterOperation( path = "$BASE_PATH/loss/excel", beanClass = ExcelExportHandler::class, beanMethod = "

我不明白为什么“columns”和“documentid”参数被swagger ui作为逗号分隔的值发送,而不是作为默认的分解键=val1&key=val2形式发送

定义如下:

        RouterOperation(
            path = "$BASE_PATH/loss/excel",
            beanClass = ExcelExportHandler::class,
            beanMethod = "export",
            method = [POST],
            operation = Operation(
                operationId = "excelExport",
                security = [
                    SecurityRequirement(name = "Authorization")
                ],
                requestBody = RequestBody(
                    required = true,
                    description = "form data",
                    content = [
                        Content(
                            mediaType = APPLICATION_FORM_URLENCODED_VALUE,
                            schema = Schema(implementation = ExcelExportRequest::class),
                            encoding = [
                                Encoding(name = "columns", explode = true),
                                Encoding(name = "documentIds", explode = true)
                            ]
                        )
                    ],

                ),
                responses = [
                    ApiResponse(
                        content = [
                            Content(
                                mediaType = APPLICATION_OCTET_STREAM_VALUE
                            )
                        ]
                    ),
                    ApiResponse(
                        responseCode = "200"
                    )
                ]
            )
        )
请求:

internal class ExcelExportRequest {
    @Schema(name = "columns", required = true)
    var columns: List<String>? = null

    @Schema(name = "documentIds", required = true)
    var documentIds: List<String>? = null
}
内部类请求{
@架构(name=“columns”,required=true)
变量列:列表?=null
@架构(name=“documentIds”,required=true)
var documentIds:列表?=null
}
使用swagger-2.1.2(OpenAPI v3)