docs icon indicating copy to clipboard operation
docs copied to clipboard

OpenAPI Spec: Issues with uploading files

Open karanataryn opened this issue 11 months ago • 12 comments

The Mintlify Web UI does not correctly upload files in the API request, passing it as a string instead of a file object. This leads to errors as seen below: {"detail":[{"type":"value_error","loc":["body","file"],"msg":"Value error, Expected UploadFile, received: <class 'str'>","input":"[object Object]","ctx":{"error":{}}}]}

The construction of the cURL object is incorrect, as seen below: curl --request POST \ --url https://url \ --header 'Authorization: Bearer REDACTED' \ --header 'Content-Type: multipart/form-data' \ --form 'file={}'

which should instead contain --form '[email protected]'

karanataryn avatar Nov 12 '24 19:11 karanataryn