Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide generates a bad schema with an empty non-map collection #196

Closed
groundedsage opened this issue Apr 8, 2020 · 0 comments
Closed

Comments

@groundedsage
Copy link

Behaviour:

Generating a schema fails when empty non-map collection are used

Input
(mp/provide [{:example []}])
Output
[:map [:example [:vector [:or]]]]

Input
(mp/provide [{:example '()}])
Output
[:map [:example [:list [:or]]]]
Input
(mp/provide [{:example #{}}])
Output
[:map [:example [:set [:or]]]]

Expected:

The expected behaviour is the same as when providing an empty map

Input
(mp/provide [{:example {}}])
Output
[:map [:example [:map]]]

Possibly related issue

This fails

  (mu/union [:map [:example string?]]
            [:map [:example [:vector]]])

This succeeds

  (mu/union [:map [:example string?]]
            [:map [:example [:map]]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant