malli
malli copied to clipboard
Equality (or equivalence) definition
Regarding equality, should both
(mu/equals [:map
[:id int?]
[:b int?]]
[:map
[:b int?]
[:id int?]])
;; => false
and
(mu/equals [:map
[:id [:or string? int?]]
[:b int?]]
[:map
[:id [:or int? string?]]
[:b int?]])
;; => false
return true?
Right now I can generate samples from one and validate with the other schema as a quick tests (but with no guarantees).
It depends. If you generate a web-form out of the two, the order matter and the forms would look different. For validators, generators etc, they behave the same way. But, Schemas could implement equality via better means than form diffing (the current impl in mu/equals), which is slow.