You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Properties declared in resources as Joi.date() are being persisted by the relationaldb store as strings but not being converted from the Date object that Joi returns, which results in the following error:
Rolling transaction back after error: {"name":"SequelizeValidationError","message":"string violation: birthDate cannot be an array or an object","errors":[{"message":"birthDate cannot be an array or an object","type":"string violation","path":"birthDate","value":"1969-12-31T16:00:00.000Z"}]} +6ms
Executing (917da062-51e8-4231-aec8-68bf5f19466c): ROLLBACK;
The text was updated successfully, but these errors were encountered:
SqlStore.prototype.populate=function(callback){varself=this;vartasks=[function(cb){self.baseModel.sync().asCallback(cb);},function(cb){async.each(self.relationArray,function(model,ecb){model.sync().asCallback(ecb);},cb);},function(cb){async.each(self.resourceConfig.examples,function(exampleJson,ecb){varvalidation=Joi.validate(exampleJson,self.resourceConfig.attributes);if(validation.error)returnecb(validation.error);// Notice that validation.value has been altered by Joi// exampleJson was correctly validated, but validation.value was not// ironically the validated values aren't valid// you can get around this by using the exampleJson values// was: self.create({ request: { type: self.resourceConfig.resource } }, validation.value, ecb);// create re-validates the value for usself.create({request: {type: self.resourceConfig.resource}},exampleJson,ecb);},cb);}];async.series(tasks,callback);};
Properties declared in resources as
Joi.date()
are being persisted by the relationaldb store as strings but not being converted from theDate
object that Joi returns, which results in the following error:The text was updated successfully, but these errors were encountered: