ratify
ratify copied to clipboard
Convert strings formatted as date-time to Date objects?
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!