Closed WesTyler closed 7 years ago
const schema = Joi.object({ alternative: Joi.alternatives().try(Joi.number().integer().min(1), Joi.string().guid().lowercase()).required() }); const Document = Felicity.entityFor(schema); const doc = new Document(); /* Error: Cannot read property 'type' of undefined at childrenKeys.forEach (/[redacted]/felicity/lib/joiGenerator.js:72:33) at Array.forEach (native) at schemaMapper (/[redacted]/felicity/lib/joiGenerator.js:52:26) at Constructor.generate (/[redacted]/felicity/lib/joiGenerator.js:93:5) at new Constructor /[redacted]/felicity/lib/index.js:88:22) */
The document should be instantiated with the alternative key set to null.
alternative
null
Error: Cannot read property 'type' of undefined
Context
What are you trying to achieve or the steps to reproduce ?
What result did you expect ?
The document should be instantiated with the
alternative
key set tonull
.What result did you observe ?
Error: Cannot read property 'type' of undefined