Bug: Or on deeper structures breaks
See original GitHub issueHi, i found a bug when trying to “or” deeper nested structures:
from strictyaml import load, Map, MapPattern, Str, Int
yaml="""
configuration:
test1:
helptext: "some text"
test2:
helptext: "some other text."
min: 0
"""
schema = Map(
{
"configuration": MapPattern(
Str(),
Map({
"helptext": Str(),
}) | Map({
"helptext": Str(),
"min": Int(),
}),
minimum_keys=1
),
}
)
data = load(yaml, schema=schema)
print(data.data)
which results in
strictyaml.exceptions.YAMLValidationError: when expecting an integer
found arbitrary text
in "<unicode string>", line 5, column 1:
helptext: some other text.
^ (line: 5)
the strange thing is, it “works” when themin
validator is a Str()
so i guess the validators are applied to the wrong content?
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
What is a bug (computer bug)? - TechTarget
Software bugs have caused car crashes, explosions and other deadly accidents. ... In computer technology, a bug is a coding error in a...
Read more >Insect morphology - Wikipedia
Insect morphology is the study and description of the physical form ; There is enormous variation in body structure amongst insect species. Individuals...
Read more >Security bugs and flaws: Both bad, but in different ways
Security flaws are different from bugs, but they endanger the security of applications and systems just the same. Here's how to find and...
Read more >Outshine breaks org-cycle with heading structure starting below ...
Hi, If outshine is just (require)d, org-cycle breaks with heading structures starting below level 1 (eg, a chapter before a part): Left shows...
Read more >Brown Marmorated Stink Bug - Penn State Extension
The stink bug will not reproduce inside structures or cause damages. If many of them are crushed or sucked into a vacuum cleaner,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks. And thanks once again for pointing it out.
I’m working on preventing the above bug from occurring by preventing the combination of Maps / Seqs using the Or validator. I’ll put a message hinting that the end user should use revalidation for their purposes so future users won’t fall down the same rabbit hole.
I have a small question, Though it’s not stated that project version is following semantic versioning, my general feeling says that patch version update shouldn’t introduce breaking changes. Do you have some policy about versioning for this project?