theleoborges / bouncer

A validation DSL for Clojure & Clojurescript applications
364 stars 38 forks source link

Validators added: integer, string, boolean, in-range #26

Closed mishadoff closed 9 years ago

mishadoff commented 10 years ago

Added four more validators.

integer - needed to avoid decimal values, which are passes number validator string/boolean - if we get some untrusted data and it must match the type, also useful for api clients validation to skip and not process broken requests in-range - member is not acceptable for range checking, because it is slow for wide ranged (-1e9, 1e9) and doesn't handle decimals (valid? {:rating 3.7} :rating [[member (range 5)]]) => false

Few tests added and doc updated as well.

theleoborges commented 10 years ago

Hi @mishadoff

I really appreciate you taking the time. It's been a very busy couple of weeks on my end so I apologise.

I'll do my best to get to this PR this week.

Thanks

robinheghan commented 9 years ago

@leonardoborges when do you have the time to merge this in? I don't want to bother you if you are super busy, and I can wait until it suits you better, but I actually have use for these functions in my project now, so it would've been nice to see this merged :)

theleoborges commented 9 years ago

Hi @mishadoff ,

I finally worked through the other PR's and a few things got merged first so this PR doesn't merge cleanly any longer. Would mind rebasing and updating the PR?

I'll merge it once that's done a publish a point release.

Thanks

stephenmuss commented 9 years ago

@mishadoff @leonardoborges this looks useful. Any way the conflicts can be resolved and then this can be merged?

theleoborges commented 9 years ago

Sorry about the delay. Fixed on #33