Closed waldoj closed 9 years ago
The problem appears to be that toISOString()
produces greater precision than JSON's date
datatype supports. The solution is probably to manually format the date-time.
Notably, and appropriately, both use ISO 8601. In theory, microseconds are supported. In practice—in the case of our JSON schema library—it is not.
Well, that was a horrible solution. Now the date-time string is being assembled manually, because that proved the simplest way to eliminate microseconds. (Other possibilities: a third-party library like Moment.js, or a regex.) But that fixes the problem. :-/
It's providing precision down to the microsecond, e.g.
2015-06-20T13:15:47.42Z
, but the spec only support seconds, e.g.2015-06-20T13:15:47Z
, causing the JSON to fail the validation check.