Skip to content

Instantly share code, notes, and snippets.

@notizklotz
Created January 5, 2021 10:28
Show Gist options
  • Save notizklotz/5b772d0fa35b71bce83562dd3ab07780 to your computer and use it in GitHub Desktop.
Save notizklotz/5b772d0fa35b71bce83562dd3ab07780 to your computer and use it in GitHub Desktop.
OpenAPI spec with multipart file upload
openapi: 3.0.3
info:
version: "1.0.0"
title: "Multipart file upload"
paths:
/files:
post:
summary: Upload files
operationId: uploadFiles
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/ReceiptUpload'
responses:
201:
description: OK
components:
schemas:
ReceiptUpload:
type: object
properties:
nonfileProperty:
description: 'The PartnerNumber of the person this receipt references to'
type: string
file:
description: 'The documents to upload. Specify this parameter multiple times for multiple documents.'
type: array
items:
type: string
format: binary
required:
- nonfileProperty
- file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment