Enabling Date and DateTime for Header response

Merged
#46 · Created  · Last updated

Merged pull request

Merged in BrunoMuratore/swagger-request-validator (pull request #46)

4db8993·Author: ·Closed by: ·2017-07-21

Description

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.

0 attachments

0 comments

Loading commits...