带有复杂内容和多个附件OpenAPI 3.0的电子邮件
我需要一个带有一些complext内容(JSON格式)和多个数组附件的电子邮件的示例。附件应该能够具有任何格式。到目前为止,我到处都在搜索,我开始认为这可能是不可能的。我想要的是下面类似的东西:
/somepath:
put:
summary: sends an email
description: Send an email
operationId: send-mail
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/data.SomeData'
type: object
properties:
format: binary
attachment:
content:
multipart/form-data:
schema:
properties:
my-attachment:
type: array
items:
type: string
format: binary
这是我在Swagger 2.0中尝试做的事情,看起来更现实,Swagger 2.0不接受:
/somePath:
put:
consumes:
- multipart/form-data
description: Send an email
operationId: send-mail
parameters:
- description: The Data model
in: body
name: someData
required: true
schema:
$ref: '#/definitions/data.someData'
type: object
- description: Base 64 upload attachment
in: formData
name: file
type: array
items:
type: string
format: binary
I need an example for an email with some complext content(json format) and multiple array attachment. The attachments should be able to be of any format. so far I have searched everywhere and I am starting to think it may not be possible. what I would like is something like below:
/somepath:
put:
summary: sends an email
description: Send an email
operationId: send-mail
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/data.SomeData'
type: object
properties:
format: binary
attachment:
content:
multipart/form-data:
schema:
properties:
my-attachment:
type: array
items:
type: string
format: binary
This is what I have tried to do in swagger 2.0, which looks more realistic and swagger 2.0 does not accept:
/somePath:
put:
consumes:
- multipart/form-data
description: Send an email
operationId: send-mail
parameters:
- description: The Data model
in: body
name: someData
required: true
schema:
$ref: '#/definitions/data.someData'
type: object
- description: Base 64 upload attachment
in: formData
name: file
type: array
items:
type: string
format: binary
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了OpenAPI 3.0的答案:
Found the Answer for Openapi 3.0 :