ratify icon indicating copy to clipboard operation
ratify copied to clipboard

Convert strings formatted as date-time to Date objects?

Open rolodato opened this issue 9 years ago • 0 comments

Hi @mac-, would you accept a PR to automatically convert strings defined with date-time formats to Date object? This is useful, for example, when saving Date objects to MongoDB - otherwise they are persisted as strings by default.

Current behavior is here: https://github.com/mac-/ratify/blob/9f3b09dc5c93d5d4597f683405df52196a5e8eee/lib/RouteSchemaManager.js#L107

Seems this would be a breaking change. The only other JSON schema string format that has an equivalent Node type is uri, which we might want to convert automatically as well. Let me know what you think.

Thanks!

rolodato avatar Jan 05 '17 15:01 rolodato