wonderlic/swagger-validation — pull request #9 by darrin (2014-11-11 05:57:09+00:00)
Title: Allow the date and dateTime validators to tolerate date types... 

The validation middleware was added multiple times during unittest. In this case the date comes in as a date object rather than string. Although this was fixed in the unittests by ensuring the middleware was only added once - it seems wise and reasonable to handle this case and just allow the dates to pass through. If this is not present and you run through validation a second time or otherwise have a json object with a real date object attached you'll get a format failure bc of a transformation from the raw date to locale base string format before moment tries to parse it again. Quite confusing. This fixes that issue by passing dates straight through - leaving the normal case the same and tolerating the case where dates are passed in.