-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Support plan
- which support plan is this issue covered by? (e.g. Community, Core, Plus, or Enterprise): Communtiy
- is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): no
Context
- node version: 12.16.1
- module version with issue: 17.1.0
- last module version without issue: N/A
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): standalone
- any other relevant information: N/A
What are you trying to achieve or the steps to reproduce?
I'm extending a schema with a complex array base:
const custom = Joi.extend({
type: 'test',
base: Joi.array().items(Joi.string().required());
});
const schema = custom.test();
schema.validate(['x']); // No errors
const description = schema.describe();
const newSchema = custom.build(description);
newSchema.validate(['x']); // "value" does not contain 1 required value(s)What was the result you got?
A validation error on what is supposed to be valid
What result did you expect?
No error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect