Closed Bascy closed 3 months ago
Could you provide examples of a yaml file and a schema to better illustrate your question?
I've managed to recreated a simple example demonstrating the problem. It seems that the missing include is reported when other errors are present
Schema:
nodes: map(include('node'), key=str(), required=False)
---
node: >
any(
include('Node1'),
include('Node2'),
)
---
Node1:
type: str(equal='Node1')
id1: int()
Succeeding yaml file:
nodes:
name:
type: node2
id1: 123
Failing yaml file:
nodes:
name:
type: node2
Errors:
nodes.name.id1: Required field missing Include 'Node2' has not been defined.
Any news on this issue?
Not by design but does seem minor since this will correctly not error in the case that none of the files being validated ever need the undefined include. Will consult internally on fixing this and report back.
I've merged a change to make this always fail when there's an undefined type. Will go out soon in the next release.
Thanks!
I have noticed if I use
include('xxx')
in an any() validation, that it will not complain if the xxx does not exists at all. Is this by design?