我正在设置一个新服务器,我的目标是在OpenApi3.0的yaml文件中实现multipart / form-data。我在Node.js中遇到“不应具有其他属性(消耗)”错误,并且想知道如何解决此错误或如何在OpenApi3.0的yaml文件中实现multipart / form-data?
这是我实现这个目标的OpenApi3.0的yaml文件,它将报告我上面提到的错误。
openapi: 3.0.1
info:
title: myapp
description: My cool app
version: 1.0.0
servers:
- url: /api/v1/user
tags:
- name: User
description: User Operations
paths:
/onboarding/signature:
post:
tags:
- User
description: Onboarding Upload Signature API - with parameters user's email and image file
requestBody:
description: Request Body {email, image}
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/onboardingSignature'
required: true
responses:
200:
description: OK
201:
description: Created
400:
description: Bad Request
500:
description: Internal Server Error
components:
schemas:
onboardingSignature:
description: Onboarding Signature File
type: object
properties:
email:
type: string
image:
format: binary
我希望以Swagger上传文件的实现使用multipart / form-data格式。