metal.js icon indicating copy to clipboard operation
metal.js copied to clipboard

Config does not validate required nested attributes

Open p2kmgcl opened this issue 5 years ago • 0 comments

When using Config.arrayOf(...) and Config.shapeOf(...) it does not check nested attributes inside them, for example, for this rule:

Config.arrayOf(
	Config.shapeOf({
		a: Config.string().required()
	})
)

Metal say's these are valid:

  • []
  • [{ a: '' }]

But also this, which shouldn't be:

  • [{}]

How ever, it does throw an error for:

  • [{ a: 1 }]

p2kmgcl avatar Mar 28 '19 07:03 p2kmgcl