douzi2785 2018-11-09 20:46
浏览 98

如何在招摇中定义原型上传的多部分/表单数据

I'm having a hard time figuring this out.

We have defined some proto files as our contract for swagger, and I can't quite figure out how to define a multipart/form-data field on the request object.

We are using proto3 and Swagger 2.0

The request object is pretty straight forward.

message ImportRequest {
   bytes file = 1;
}

The above isn't the result I'm looking for ... it results in this

Swagger file import result

What I need to generate from the proto file above is a swagger output like so..

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

The above is from here -> https://swagger.io/docs/specification/2-0/file-upload/

Any thoughts?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100