You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incomplete revalidation also causes a mismatch between the ruamel and strictyaml internal states in the YAMLChunk object. This is the same outcome as in #183, but the initial cause of the inconsistency is different, so I've listed this as a separate issue.
An example of the error:
fromstrictyamlimportInt, Map, Str, as_documentdat= {"a": 1, "b": "x"}
schema1=Map({"a": Int(), "b": Int()})
schema2=Map({"a": Int(), "b": Str()})
# The state is consistent hereyml._chunk.contents# ordereddict([('a', '1'), ('b', 'x')])yml._chunk.strictparsed()
# ordereddict([(YAML(a), YAML(1)), (YAML(b), YAML(x))])yml.revalidate(schema1)
# Fails (as it should)# But the state is now inconsistentyml._chunk.contents# ordereddict([('a', '1'), ('b', 'x')])yml._chunk.strictparsed()
# ordereddict([(YAML(b), YAML(x)), (YAML(a), YAML(1))])
The mismatch in the internal state means that revalidation with a correct schema will fail:
yml.revalidate(schema2)
...
strictyaml.exceptions.YAMLValidationError: when expecting an integer
found arbitrary text
in "<unicode string>", line 2, column 1:
b: x
^ (line: 2)
The text was updated successfully, but these errors were encountered:
Incomplete revalidation also causes a mismatch between the ruamel and strictyaml internal states in the
YAMLChunk
object. This is the same outcome as in #183, but the initial cause of the inconsistency is different, so I've listed this as a separate issue.An example of the error:
The mismatch in the internal state means that revalidation with a correct schema will fail:
The text was updated successfully, but these errors were encountered: