-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Environment:
- py39 (3.9.16)
- strictyaml: 1.7.3
strictyaml.MapCombined docs show a different traceback
Straight from the documentation
from strictyaml import Any, Int, MapCombined, Optional, Str, load
schema = MapCombined(
{
"required": Str(),
Optional("foo"): Int(),
},
Str(),
Any(),
)
yaml_snippet = """1: Hello World
not_an_integer: 42"""
load(yaml_snippet, schema)
Expected (shown in docs)
strictyaml.exceptions.YAMLValidationError:
when expecting an integer
found arbitrary text
in "", line 2, column 1:
not_an_integer: '42'
^ (line: 2)
Actual
strictyaml.exceptions.YAMLValidationError: while parsing a mapping
in "", line 1, column 1:
'1': Hello World
^ (line: 1)
required key(s) 'required' not found
in "", line 2, column 1:
not_an_integer: '42'
^ (line: 2)
Recommended action
- Confirm
- Update the docs (story)
The bigger question: How can the docs (story) be wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels