FormData in body fails validation (Body not expected)

Issue #28 closed
Rahil Bohra created an issue

Steps to reproduce:

  • Create a swagger definition with an endpoint taking one formData parameter with the method POST. E.g. POST /test expecting a parameter foo with type formData
  • Try to validate a request with the formdata in the body, e.g.
POST  /test HTTP/1.1
Host: localhost:11111
Content-Type: application/x-www-form-urlencoded

foo=bar
  • Validation fails with "No request body is expected for %s on path '%s'."

I suspect this is a bug as formData can indeed be in the request body.

Looks like the issue is at RequestValidator.java:65

I can work on a fix for this, as long as you consider it a bug too :)

Comments (3)

  1. Log in to comment