Skip to content

Instantly share code, notes, and snippets.

@mathis-m
Created October 7, 2021 22:49
Show Gist options
  • Select an option

  • Save mathis-m/d9e6564090d0259c1363df233f5c6b91 to your computer and use it in GitHub Desktop.

Select an option

Save mathis-m/d9e6564090d0259c1363df233f5c6b91 to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Test API
version: '1.0'
servers:
- url: 'http://localhost:3000'
paths:
# Generated CURL request uses:
# -d '{}'
# (This doesn't work; it could use something like --data-binary '@<file name>' instead.)
/upload1:
post:
summary: Simple upload
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: OK
# Generated CURL request uses:
# -F 'fileName=@<file name>;type=<mime type>'
# (This works fine.)
/upload2:
post:
summary: Multipart upload
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
fileName:
type: string
format: binary
responses:
'200':
description: OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment