title: 400 Bad Request in Spring Boot Swagger UI for POST
body: <p>I've created a Spring Boot application with RestController. I enabled Swagger UI and it works fine as I can login to the UI and execute any GET methods. But for POST methods accepting objects in the body, when I fire off the request using Swagger UI, it always returns 400 status code. I can see the request never reached the particular POST method.  May I know if any special config I need for Swagger UI?</p>
  
  <p>The particular method in my Spring Boot RestController</p>
  
  <pre><code>@ApiOperation(value = "Query requests by search criteria")
  @RequestMapping(value = "/api/query", method = POST)
  public PageResult&lt;MyPOJO&gt; find(@RequestBody SearchRequest request) {
      //implementation omitted.
  }
  </code></pre>
  
  <p>and I'm using </p>
  
  <pre><code> "io.springfox:springfox-swagger2:2.1.2",
   "io.springfox:springfox-swagger-ui:2.1.2"
  </code></pre>
  
  <p>This one (generated by Swagger UI) for the corresponding api gives me 400 bad request:</p>
  
  <pre><code> {
    "listEntrySearchCriteria": {
      "summary": {
        "createdBy": "string",
        "createdOn": "2016-03-21T10:33:05.048Z",
        "effectiveEnd": "2016-03-21T10:33:05.048Z",
        "effectiveStart": "2016-03-21T10:33:05.048Z",
        "id": 0,
        "region": "string",
        "type": "ETB",
        "updatedBy": "string",
        "updatedOn": "2016-03-21T10:33:05.048Z",
        "version": 0
      }
    },
    "listSummarySearchCriteria": {
      "effectiveEnd": "2016-03-21T10:33:05.048Z",
      "effectiveStart": "2016-03-21T10:33:05.048Z",
      "statuses": [
        "string"
      ],
      "types": [
        "string"
      ]
    },
    "pageRequest": {
      "orders": [
        {
          "direction": "ASC",
          "ignoreCase": true,
          "nullHandling": "NATIVE",
          "property": "string"
        }
      ],
      "page": 0,
      "size": 0
    }
  }
  </code></pre>
  
  <p>But if I supply a random request for the same method, it at least reaches my method:</p>
  
  <pre><code>  {
    "orders": [
      {
        "direction": "ASC",
        "ignoreCase": true,
        "nullHandling": "NATIVE",
        "property": "id"
      }
    ],
    "page": 0,
    "size": 0
  }
  </code></pre>