core
core copied to clipboard
fromJson `model` option should allow fields to be coerced into Dates or ObjectIds
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
For the moment this can be handled using formatFromJson