Parse DateTime in format that is accepted by Schema Validator

Merged
#48 · Created  · Last updated

Merged pull request

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

c30d723·Author: ·Closed by: ·2017-07-27

Description

This solves issue #63

Since Schema Validator doesn't accept dates that are valid according to RFC3339, some date times would throw a validation.schema.format error when it shouldn't.

As suggested by James Navin on PR #46, this PR uses the custom RFC3339 formatter to try to parse the date, and if it is valid, parses it in a format that the Schema Validator will accept.

If RFC3339 fails to parse the date, then let the flow continue since the Schema Validator will throw the appropriate error. This is done by using an empty catch block, any suggestion to improve this is welcome.

0 attachments

0 comments

Loading commits...