title: Swagger UI : "Choose file" button when input has both file AND json object?
body: <p><em>Asp.Net, .Net 5.0</em></p>
  <p>I have this <code>POST</code> endpoint that requires to BOTH upload a <strong>file</strong> and a &quot;complex&quot; object (<strong>json</strong>). In order to test it, I use <strong>Swagger UI</strong>.</p>
  <p><strong>1. Testing the upload of a file alone is easy.</strong></p>
  <p>If the endpoint looks like this...</p>
  <pre><code>public ActionResult TestUpload(bool testBool, IFormFile file) {
  </code></pre>
  <p>...then Swagger UI looks like this :</p>
  <p><a href="https://i.stack.imgur.com/XTzDg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XTzDg.png" alt="enter image description here" /></a></p>
  <p><strong>2. Testing the upload of a json object alone is easy too.</strong></p>
  <pre><code>public class DummyInput {
      public bool Field { get; set; }
  }
  </code></pre>
  <p>If the endpoint looks like this...</p>
  <pre><code>public ActionResult TestUpload(bool testBool, DummyInput input) {
  </code></pre>
  <p>...then Swagger UI looks like this :</p>
  <p><a href="https://i.stack.imgur.com/4EmXk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4EmXk.png" alt="enter image description here" /></a></p>
  <p><strong>3. I can even make my life easier like this :</strong></p>
  <p>public ActionResult TestUpload(bool testBool, <strong>[FromForm]</strong> DummyInput input) {</p>
  <p><a href="https://i.stack.imgur.com/kBy7N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kBy7N.png" alt="enter image description here" /></a></p>
  <p>That's great.</p>
  <p><strong>4. But what if I want BOTH the file and the 'input' json object ?</strong></p>
  <p><strong>attempt #1 :</strong></p>
  <pre><code>public ActionResult TestUpload(bool testBool, IFormFile file, DummyInput input) {
  </code></pre>
  <p>That obviously doesn't work because you cannot have two parameters &quot;From body&quot;, there can be only one.</p>
  <p><strong>attempt #2:</strong></p>
  <p>public ActionResult TestUpload(bool testBool, <strong>[FromForm]</strong> IFormFile file, <strong>[FromForm]</strong>
  DummyInput input) {</p>
  <p><a href="https://i.stack.imgur.com/5WjMV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5WjMV.png" alt="enter image description here" /></a></p>
  <p><strong>attempt #3:</strong></p>
  <pre><code>public class WrapperInput {
      public DummyInput Input { get; set; }
      public IFormFile File { get; set; }
  }
  
  
  public ActionResult TestUpload(bool testBool, WrapperInput input) {
  </code></pre>
  <p><a href="https://i.stack.imgur.com/bla7j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bla7j.png" alt="enter image description here" /></a></p>
  <p>So, in conclusion :  how do I get to enter my nice fields AND my &quot;Select file&quot; button?
  I've looked at <a href="https://stackoverflow.com/questions/53058838/swagger-listing-iformfile-parameter-as-type-object">this article</a> but it seems overly complicated -- and to be honest I'm not sure it's even related to my needs. I have a feeling that it's for OpenApi 2.0 rather than the better things we get from OpenApi 3.0.</p>