Contributions
Re: Swagger example for multipart/form-data sending file in body
Thank you for your answer, but I don't understand where I can add this example. I was trying to add example in external file "examples.json". The code above should be added in "examples.json" or in swagger.yaml? And what section should I add it? In the responses or schema examples? Thank you4.9KViews0likes1CommentSwagger example for multipart/form-data sending file in body
I am trying to add an example in "examples.json" external file a swagger.yaml. Until now for PUT/POSTI have: { "path": "/api/books/{id}", "method": "PUT", "examples": [ { "name": "Update book with file.", "url": "/api/book/8b7hhhd9-a21b-3m2l-k384-ck88d8b84h51", "description": "Updates book with ID 8b7dbbb0-a43f-4c6c-a339-cf11b8b04f72 with provided file.", "body": "-----12345W\r\nContent-Disposition=form-data; name=\"data\"\r\n\r\nUUHHGT5Y\r\n-----12345\r\n", "headers": { "Content-Type": "multipart/form-data; boundary=-----12345" } } ] } and even if I remove "body" parameter or change it, all I get is this error: have following errors - parameter 'body': 'multipart: NextPart: EOF'4.9KViews0likes3Comments