It would be very nice if camo validator would accept field with declared type Data values as strings.
Currently we may use numbers or date instances but no date strings.
I think simple Date.parse would suffice to interpret strings.
Why:
I'm using camo (with my neat hack) in a browser (via my own REST client for camo) and after serializing/deserializing JSON objects, all Date fields become ISO date strings on the backend.
The workaround is to:
Date.prototype.toJSON = Date.prototype.getTime in the browser.
but I would like to leave Date.prototype.toJSON untouched and allow the camo validators to convert those date strings to Date objects.
It would be very nice if camo validator would accept field with declared type Data values as strings. Currently we may use numbers or date instances but no date strings.
I think simple Date.parse would suffice to interpret strings.
Why:
I'm using camo (with my neat hack) in a browser (via my own REST client for camo) and after serializing/deserializing JSON objects, all Date fields become ISO date strings on the backend.
The workaround is to:
Date.prototype.toJSON = Date.prototype.getTime
in the browser.but I would like to leave Date.prototype.toJSON untouched and allow the camo validators to convert those date strings to Date objects.