onyxframework / http

An opinionated framework for scalable web 🌎
https://onyxframework.com/http
MIT License
142 stars 11 forks source link

Custom params validation #3

Closed vladfaust closed 6 years ago

vladfaust commented 7 years ago
def foo_valid?(foo)
  some_code?(foo)
end

params do
  param :id, Int32, ->{ p > 0 }
  param :foo, String?, validate: foo_valid?
end