beetbox / beetbox/confuse

list of dicts

Open
#41 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
424
Forks
57
PR merge metrics
No merged PRs in 30d

Description

hi,
I have not found a way to have a list of dicts and validate it.

this is the config
```
cars:
- manufacturer: volvo
color: red
modell: typec
- manufacturer: toyota
color: blue
modell: typeb
- manufacturer: volvo
color: green
modell: typea

```
example of not working validation:
```

cars: [
{
"manufacturer": confuse.String(default=""),
"color": confuse.String(default=""),
"modell": confuse.String(default="")
}
]
}
```

in the end i just validated it by:
`cars: list`

but when i run config.dump() i get back the config in yaml but the list as an json/dict
```
something: value
something2: value
cars: [{"manufacturer":"volvo","color":"red","modell":"typec"},{"manufacturer":"toyota","color":"blue","modell":"typeb"},{"manufacturer":"volvo","color":"green","modell":"typea"}]

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.