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

qualified-keyword with namespace doesn't generate the ns #642

Closed
Invertisment opened this issue Feb 15, 2022 · 0 comments · Fixed by #643
Closed

qualified-keyword with namespace doesn't generate the ns #642

Invertisment opened this issue Feb 15, 2022 · 0 comments · Fixed by #643

Comments

@Invertisment
Copy link
Contributor

Invertisment commented Feb 15, 2022

Let's say I have this schema:

[:map {}
  [:id/house [:qualified-keyword {:namespace :house}]]
  [:house/address string?]]

If I generate the value I get this output:

{:id/house :a.../IJ9-7RW
 :house/address "EHL2302t6Afp79tX79A"}

But if I try to validate it I get a false.
But if I change the generated value into this then it passes:

{:id/house :house/IJ9-7RW
 :house/address "EHL2302t6Afp79tX79A"}

I think that the generated value should be the same as the fixed value.
i.e. the namespace of the generated keyword should be house.

Example test:

(malli/validate
   [:map {}
    [:id/house [:qualified-keyword {:namespace :house}]]
    [:house/address string?]]
   (mg/generate [:map {}
                 [:id/house [:qualified-keyword {:namespace :house}]]
                 [:house/address string?]]))

It also doesn't work with a string.

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

Successfully merging a pull request may close this issue.

1 participant