From 4d0b5ae1ed75d045edf1a16c6271e020f5243e58 Mon Sep 17 00:00:00 2001 From: Sylvain WITMEYER Date: Fri, 18 Mar 2016 18:12:44 -0400 Subject: [PATCH] Update schema.js If you want to use UUID in a nested object, you have to call explicitly the function v4() or v1() --- lib/schema.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/schema.js b/lib/schema.js index eeced1d..33a1cbe 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -160,11 +160,11 @@ Schema.types.binarySet = function () { }; Schema.types.uuid = function () { - return Joi.string().guid().default(nodeUUID.v4); + return Joi.string().guid().default(nodeUUID.v4()); }; Schema.types.timeUUID = function () { - return Joi.string().guid().default(nodeUUID.v1); + return Joi.string().guid().default(nodeUUID.v1()); }; Schema.prototype.validate = function (params, options) {