question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do i POST attachment along with body parameter in swagger 2.0 ?

See original GitHub issue

I am trying to include an excel file attachment along with body in swagger 2.0 and it is not working. I am not sure if swagger support this ? I would appreciate if someone could shed some light on this -

"parameters": [
        {
       "name": "file",
       "in": "formData",
       "type": "file",
 		"description": "upload file"
		},
		
        {
         "name": "request",
          "in": "body",
          "type": "string",
           "description": "Enter request",
           "required": true,
           "schema": 
       {
             "$ref": "#/definitions/post"
       }
     }
     ],

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
webroncommented, Jul 31, 2017

3.0 was already released, and it’s included there, yes.

0reactions
dipak84patelcommented, Jul 31, 2017

sounds good

Read more comments on GitHub >

github_iconTop Results From Across the Web

File Upload - Swagger
The operation payload is defined using formData parameters (not body parameters). The file parameter must have type: file : paths: /upload: post: summary: ......
Read more >
Swagger send body and formData parameter - Stack Overflow
I'm using Swagger 2.0 and I have a problem to send multiple post parameters. I have a swagger error Operation cannot have a...
Read more >
Post body and formData parameter · Issue #889 · swagger-api ...
I'm using Swagger 2.0 and I have a problem to send multiple post parameters. I have a swagger error Operation cannot have a...
Read more >
Designing REST API with Open API Specification (OAS) v2.0 ...
The file spec.json defined inside swagger-2.0 is defined ... Body Parameters: This kind of parameter is expected as part of request body, ...
Read more >
Adding a File Upload Field to Your Swagger UI ... - Alex Dunn
However, this only handles the most common cases of required requests with query string parameters and HTTP Body content. In this post ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found