mirror of https://github.com/vapor/docs.git
Merge pull request #90 from jameslinjl/option_missing
added a missing ? to make the documentation work as is
This commit is contained in:
commit
1a9d7db5e4
|
|
@ -20,7 +20,7 @@ This creates a route that matches `users/:id` where the `:id` is an `Int`. Here'
|
|||
|
||||
```swift
|
||||
drop.get("users", ":id") { request in
|
||||
guard let userId = request.parameters["id"].int else {
|
||||
guard let userId = request.parameters["id"]?.int else {
|
||||
throw Abort.badRequest
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue