Skip to content

Commit 8f89489

Browse files
committed
updated README
1 parent beb22f3 commit 8f89489

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.markdown

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,14 @@ get ':id' do
207207
end
208208
```
209209

210-
The coercion is handled by the [Virtus](https://github.com/solnic/virtus) gem which will convert the value if possible but
211-
in case of invalid input nothing will be done (ex: asking to coerce "ex" to Integer will return "ex" ).
212-
Proper type validation could be added later when Virtus will get a way to tell us.
210+
Declaring a parameter type causes the value to be coerced into that type, where possible.
211+
There is now implicit validation meaning that invalid input such as "foo" for an Integer will be left unmodified and passed through into the API,
212+
this might change in a future release.
213213

214+
However validations are executed in the order defined which allows you to do this:
215+
```ruby
216+
requires :id, regexp: /^[0-9]+$/, type: Integer
217+
```
214218

215219
## Headers
216220

0 commit comments

Comments
 (0)