strictyaml icon indicating copy to clipboard operation
strictyaml copied to clipboard

.data doesn't unpack YAML objects when using CommaSeparated of Enum

Open balaziks opened this issue 5 years ago • 2 comments

After running:

import strictyaml
schema = strictyaml.Map(
    {
        "key": strictyaml.CommaSeparated(strictyaml.Enum(["A","B","C"]))
    }
)
loaded = strictyaml.load("key: A, B", schema)

I would expect loaded.data to contain {'key': ['A', 'B']} it instead contains {'key': [YAML(A), YAML(B)]}.

Is this a bug or am I doing something wrong?

Python version: 3.9.2 strictyaml version: 1.3.2 ruamel.yaml version: 0.16.12

balaziks avatar Mar 04 '21 00:03 balaziks

Sorry for the first nonsensical version @crdoconnor, I pressed Ctrl+Enter instead of Enter by mistake when writing the Issue and it submitted.

As I saw you replying to issues via e-mail, you probably got the incomplete version sent to you. It's properly edited to make sense now. :)

balaziks avatar Mar 04 '21 00:03 balaziks

6de997d seems to have fixed this, but I haven't been able to set up and run the regression tests (on my Arch machine nor in the Github Actions), so I hesitate to open a pull request.

balaziks avatar Mar 04 '21 01:03 balaziks