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:
|
convertValueFromStringToType = function(value, type) { |
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!
Hi @mac-, would you accept a PR to automatically convert strings defined with
date-timeformats toDateobject? This is useful, for example, when savingDateobjects to MongoDB - otherwise they are persisted as strings by default.Current behavior is here:
ratify/lib/RouteSchemaManager.js
Line 107 in 9f3b09d
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!