foundy / e-joi

Joi middleware for express
MIT License
2 stars 1 forks source link

Attribute extraction bug with describe #5

Closed foundy closed 6 years ago

foundy commented 6 years ago

Depending on the type of schema, the reference value of the part that extracts the attribute is different.

// TypeError: Cannot read property 'children' of undefined
const props = Object.keys(describe.children || describe.base.children);
foundy commented 6 years ago

The schema type must be an object. If it is an alternatives type, the base type must be an object.

This is because the request object to be compared is extracted in the schema. 😢