Last active
July 16, 2021 12:30
-
-
Save tiholic/99cf45e7eebe24ff4fc3bc02802f4485 to your computer and use it in GitHub Desktop.
openapi schema with multipart and json inputs with different payloads for same endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.0", | |
"info": { | |
"title": "API", | |
"description": "API", | |
"version": "1.0" | |
}, | |
"components": { | |
"schemas": { | |
"FileInput": { | |
"type": "object", | |
"properties": { | |
"file": { | |
"type": "string", | |
"format": "binary" | |
} | |
}, | |
"required": [ | |
"file" | |
] | |
}, | |
"FileInputAsJson": { | |
"type": "object", | |
"properties": { | |
"key": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"key" | |
] | |
} | |
} | |
}, | |
"paths": { | |
"/api/v2/action/": { | |
"post": { | |
"responses": { | |
"201": { | |
"description": "" | |
} | |
}, | |
"tags": [ | |
"v2api" | |
], | |
"security": [ | |
{ | |
"jwt": [] | |
} | |
], | |
"operationId": "upload2", | |
"summary": "Upload file temporarily", | |
"requestBody": { | |
"content": { | |
"multipart/form-data": { | |
"schema": { | |
"$ref": "#/components/schemas/FileInput" | |
} | |
}, | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/FileInputAsJson" | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment