如何在 Swagger 的 Content-Type header 中添加 multipart/mixed MIME 边界

How to add multipart/mixed MIME boundary in Content-Type header in Swagger

在 Swagger UI 中,有没有办法提供可以包含在 Content-Type header 中的 MIME 边界?

使用 Swagger,我可以通过使用 Swagger 规范中的 consumes 属性 在 Swagger UI 中生成/提交不同的内容类型,例如application/jsonapplication/xml 等。但是,我需要提供每个请求可能不同的 MIME 边界。例如,在以下来自 RFC 2049 的 Content-Type header 中,最好将唯一边界值作为文本字段输入到 UI 中。无论如何在规范中表明这一点?

Content-Type: multipart/mixed; boundary=unique-boundary-1

这目前不受支持,已被接受为 Github 的 Swagger.Next 提案中可能的增强功能:

https://github.com/swagger-api/swagger-spec/issues/303