wadofgum-uuid
A mixin to make sure your models have an 'id' field configured to be a uuid string. This mixin does nothing if you don't have a validation mixin loaded.
When using this mixin an id
property will be added to your class schema and defined as Joi.string().guid()
. When calling validate if the instance's id
property is blank, a uuid will be assigned for you.
const Wadofgum = ;const Validation = ;const UUID = ;const Joi = ; {};Modelschema = name: Joi ; let model = name: 'test' ;modelid; // undefinedmodel;