Skip to content

Testing optional keys only #203

Answered by crdoconnor
mahadi asked this question in Q&A
Discussion options

You must be logged in to vote

No, it shouldn't. The Map validator implies that there should be at least one key and value, even though both individually are optional. If you wanted it to be possible to have neither, you would need

EmptyDict() | Map({Optional("username"): Str(), Optional("password"): Str()}).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mahadi
Comment options

Answer selected by crdoconnor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants