File swagger editor未生成正确的文件上载请求
我正在使用Swagger编辑器构建一个上传文件的post请求。我的swagger json文件定义如下File swagger editor未生成正确的文件上载请求,file,file-upload,swagger-editor,File,File Upload,Swagger Editor,我正在使用Swagger编辑器构建一个上传文件的post请求。我的swagger json文件定义如下 swagger: '2.0' info: version: 0.0.0 title: '<enter your title>' host: 'localhost:11235' paths: /form/upload: post: description: | Post files. consumes: -
swagger: '2.0'
info:
version: 0.0.0
title: '<enter your title>'
host: 'localhost:11235'
paths:
/form/upload:
post:
description: |
Post files.
consumes:
- multipart/form-data
produces:
- application/octet-stream
parameters:
- name: file
in: formData
description: upload file
required: true
type: file
- name: text
description: additional info
in: formData
type: string
responses:
'200':
description: Successful response
schema:
type: file
文件内容不会在请求中传输。只有文件名被写入请求中。这是因为swagger editor不支持文件上载还是我的swagger json错误?谁能帮我一下吗?谢谢。对于《大摇大摆》的编辑来说,还有一个悬而未决的问题: 据报道,它已在swagger api中修复: 使用swagger ui进行文件上载,它正在工作:
- in: formData
name: document
description: Documento Fiscal
required: true
type: file
- in: formData
name: document
description: Documento Fiscal
required: true
type: file