title: How to pass formData for POST request in swagger.json?
body: <p>In my play framework application, I have registered APIs in route file as:</p>
  
  <pre><code>POST /api/rmt-create-request controllers.Api.CreateRMTRequestForm
  </code></pre>
  
  <p>On action of controller, I am using following code to access formData submitted with form submit as :</p>
  
  <pre><code>public Result CreateRMTRequestForm()
      {
          Map&lt;String, String[]&gt; params = request().body().asMultipartFormData().asFormUrlEncoded();
  </code></pre>
  
  <p>Its working fine as API when I submit the form with forntend application.</p>
  
  <p>I am trying to create APIs documentation with swagger.ui in which within swagger.json file I have written following JSON data.</p>
  
  <pre><code>"paths": {"/api/rmt-create-request": {
        "post": {
          "tags": [
            "RMT APIs"
          ],
          "description" : "Return newly created request data",
          "operationId": "create-new-rmt-request",
          "consumes": ["application/x-www-form-urlencoded"],
          "parameters": [
            {
              "name": "rootNodeName",
              "in": "formData",
              "description": "Root node class name for item",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/rmt-request-data"
                  }
                }
              }
            },
            "default": {
              "$ref": "#/components/responses/default"
            }
          }
        }
      },
  </code></pre>
  
  <p>While inspecting RequestHeader data, its not showing content-Type property with value <strong>'multipart/form-data'</strong> as well as formData are not attached, which makes controller to throw null exception.</p>
  
  <p>Can anyone help whats missing in swagger.json file ?</p>