params do
requires :number, type: Integer, values: ->(v) { v.even? && v < 25 }
end
params do
optional :category
given category: ->(val) { val == 'foo' } do
requires :description
end
end
Created
October 10, 2019 06:56
-
-
Save hieunguyentrung/a30176224f333cca6245fdc3c1f5bb67 to your computer and use it in GitHub Desktop.
Grape useful
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment