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

Describe Malli Schema Children using Malli #270

Open
ikitommi opened this issue Oct 5, 2020 · 1 comment
Open

Describe Malli Schema Children using Malli #270

ikitommi opened this issue Oct 5, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@ikitommi
Copy link
Member

ikitommi commented Oct 5, 2020

Each Schema has it's own syntax for children. We should describe them using Malli to get proper syntax validation. This is just a new protocol method in IntoSchema. Need to be an option for the DCE to remove these at runtime. This requires #180 to be implemented.

@ikitommi ikitommi added enhancement New feature or request blocked Can't be done yet, waiting for some other issue to complete labels Oct 5, 2020
@miikka
Copy link
Contributor

miikka commented Dec 8, 2020

Example by @mvarela – this broken schema is quietly accepted, but ideally it would give a syntax error:

;; Broken: :version schema is accidentally included in :project vector
(def Project [:map [:project string? :version string?]])
(m/validate Project {:project "malli", :version nil})  ; => true

;; The correct version, for comparison:
(def Project [:map [:project string?] [:version string?]])
(m/validate Project {:project "malli", :version nil})  ; => false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants