English 中文(简体)
• 如何用Swagger的开放式第23.0号记录上载荷?
原标题:How to upload a csv file using Swagger Open API 3.0?

我对单载荷作了以下说明:

requestBody:
        description: .csv file 
        content:
          application/csv:
            schema:
              type: string
              format: base64

我也尝试了不同类型的应用/办法,如多部分/格式数据、文本/原文等,但其中没有一个在Swagger UI(也试图改变格式,以逐字、双面、但无uck)上出现立案选择。 这些文件只提到图像文件上的有效载荷。

是否有办法可以找到文件上载选择,以备文件上或存档?

问题回答

As of April 2020, Swagger UI shows the upload button only for application/octet-stream and image/ media types. There s an open issue to support file upload for other media types as well:
https://github.com/swagger-api/swagger-ui/issues/5636

作为一种工作,您可尝试使用<代码> 申请/octet-stream而不是 申请/csv

paths:/upload:
 post:
   summary: Uploads a file.
   consumes:
     - multipart/form-data
   parameters:
     - in: formData
       name: upfile
       type: file
       description: The file to upload.




相关问题
Styling rows in table that uses CSV data through PHP

I ve been working on this simple code that puts a CSV file into a nice table. But because the data is imported, styling ODD rows is a pretty hard thing to do. All I need would be a method to address ...

PHP - Sanitise a comma separated string

What would be the most efficient way to clean a user input that is a comma separated string made entirely on numbers - e.g 2,40,23,11,55 I use this function on a lot of my inputs function clean($...

marking duplicates in a csv file

I m stumped with a problem illustrated in the sample below: "ID","NAME","PHONE","REF","DISCARD" 1,"JOHN",12345,, 2,"PETER",6232,, 3,"JON",12345,, 4,"PETERSON",6232,, 5,"ALEX",7854,, 6,"JON",12345,, ...

Interactive heat map in Flex

I’m at a very basic level with Flex and with programming in general. I am working on a project where I have data in an Excel (.csv) format, it’s a large Excel plot/matrix where each cell has a ...

热门标签