Enabling Date and DateTime for Header response
Bruno Muratore
Branch: BrunoMuratore/swagger-request-validator:master
Branch: atlassian/swagger-request-validator:master
Merged
Merged pull request
Merged in BrunoMuratore/swagger-request-validator (pull request #46)
This solves Issue 54
As defined in OpenAPI spec, a response header can contain primitive types, like Date and DateTime, as can be seen in the following example (from Swagger's PetStore API, GET @ user/login):
"headers": { "X-Expires-After": { "type": "string", "format": "date-time", "description": "date in UTC when token expires" } }
Since today we don't expect DateTimeProperties here, the value is being incorrectly parsed. This PR enables Date and DateTime to be properly parsed. The tests show the scenarios that were missing.
This PR also reveals an issue, that is represented by the validate_withDateTimeProperty_shouldPass_withTimezone test, that is ignored since it is failing.