Swagger 招摇过市编辑器:无法在多部分请求中设置内容类型
我正在使用OpenAPI 3.0的在线招摇过市编辑器,我必须创建一个文件上传的定义。问题在于编辑器生成的卷曲 在文件扩展名为“未知”(如.abc)的情况下,编辑器不会生成类型Swagger 招摇过市编辑器:无法在多部分请求中设置内容类型,swagger,swagger-editor,Swagger,Swagger Editor,我正在使用OpenAPI 3.0的在线招摇过市编辑器,我必须创建一个文件上传的定义。问题在于编辑器生成的卷曲 在文件扩展名为“未知”(如.abc)的情况下,编辑器不会生成类型 curl -X POST "http://localhost:xxxx/files/upload" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "upload=@text.abc;type=" 如果扩展名为“已知”,则忽略YAML定义的cont
curl -X POST "http://localhost:xxxx/files/upload" -H "accept: */*" -H
"Content-Type: multipart/form-data" -F "upload=@text.abc;type="
如果扩展名为“已知”,则忽略YAML定义的contentType:
应该是(我需要):
YAML是:
/files/upload:
post:
summary: upload file
operationId: uploadFile
description: this API is for file upload
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
upload:
type: string
format: binary
encoding:
upload:
contentType: application/octet-stream
responses:
200:
description: Operation performed succesfuly.
400:
description: Operation failed
我在这里遗漏了什么?您的定义看起来是正确的。在Swagger UI存储库中提交错误或功能请求:。您是否在repo中创建了问题?如果是,你能分享这个链接吗?对不起,我不能。我们公司的防火墙阻止对githab的访问
curl -X POST "http://localhost:xxxx/files/upload" -H "accept: */*" -H
"Content-Type: multipart/form-data" -F "upload=@text.txt; type=application/octet-stream"
/files/upload:
post:
summary: upload file
operationId: uploadFile
description: this API is for file upload
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
upload:
type: string
format: binary
encoding:
upload:
contentType: application/octet-stream
responses:
200:
description: Operation performed succesfuly.
400:
description: Operation failed