swagger.io
swagger.io copied to clipboard
missing file object in yaml spec for upload file specs
In the upload file documentation there is a missing property for the multipart request example
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
orderId:
type: integer
userId:
type: integer
fileName:
type: string
+ file:
+ type: string
+ format: binary
Link to the doc: https://swagger.io/docs/specification/describing-request-body/file-upload/
Here is an excerpt from OpenAPI 3.0.3:
@frankkilcommins I think @ahdbk is right.
We either have to do this modification:
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
orderId:
type: integer
userId:
type: integer
fileName:
type: string
format: binary
or
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
orderId:
type: integer
userId:
type: integer
fileName:
type: string # this property only defines the name of the file, not it's content
file:
type: string
format: binary