core icon indicating copy to clipboard operation
core copied to clipboard

fromJson `model` option should allow fields to be coerced into Dates or ObjectIds

Open etsuo opened this issue 9 years ago • 1 comments

Right now, if you get back a date from the client fromJson will treat it as a string, so extra work has to be done to check for that and manually coerce the model field back into the right type... not the end of the world, but not elegant.

The model option currently only supports @Model types, but it should also accept other types like Date and ObjectID

etsuo avatar May 28 '17 22:05 etsuo

For the moment this can be handled using formatFromJson

etsuo avatar Feb 01 '18 21:02 etsuo