metal.js
metal.js copied to clipboard
Config does not validate required nested attributes
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 }]