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

Composing conformers & types #27

Open
ikitommi opened this issue Feb 20, 2017 · 0 comments
Open

Composing conformers & types #27

ikitommi opened this issue Feb 20, 2017 · 0 comments

Comments

@ikitommi
Copy link
Member

ikitommi commented Feb 20, 2017

Separating conformers from specs is a good idea, but still it would be nice to be able to compose conformers and add multiple types to specs. Currently, there can be only one installed conformer per :type and specs can have only one :type.

Something like should be available:

(st/spec ::person {:type [:map ::human]})

(st/conform 
  ::person 
  {"age" 20, "height" 200, "weight" 80, "level" :boss} 
  {:map [conform/strip-extra-keys (conform/transform-keys keyword)]
   ::human bmi-conform})
; => {:age 20, :height 200, :weight 80, :bmi 20}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant