Open colinphill-mdsol opened 4 days ago
Ah, appears the same issue happens with unions.
type StrBox {
value: String
}
type IntBox {
value: Integer
}
union StrIntBox = StrBox | IntBox
type StrIntBoxBox {
value: StrIntBox
}
(gen/sample ((lgen/generator schema) :StrIntBoxBox))
Execution error (AssertionError) at clojure.test.check.generators/fmap (generators.cljc:103).
Assert failed: Second arg to fmap must be a generator
(generator? gen)
Hi,
Thanks for reporting this, and the reproduction. I'm not sure when I'll be able to get around to looking at this but in the meantime PRs are welcome.
Cheers
I think this might explain some of the other reported issues. The library appears to simply not support the concept of an interface. In this schema, you can generate values of
Person
, but not ofNameHolder
, because the latter has a field whose type is an interface.Schema:
Code:
Result: