diff --git a/1.5/routing/collection.md b/1.5/routing/collection.md index 8a8debed..e8aad659 100755 --- a/1.5/routing/collection.md +++ b/1.5/routing/collection.md @@ -17,7 +17,7 @@ import Routing class V1Collection: RouteCollection { typealias Wrapped = HTTP.Responder - func build(_ builder: B) { + func build(_ builder: B) where B.Value == Wrapped { let v1 = builder.grouped("v1") let users = v1.grouped("users") let articles = v1.grouped("articles") @@ -53,7 +53,7 @@ typealias Wrapped = HTTP.Responder This limits our route collection to adding HTTP responders. While the underlying router is capable of routing any type, Vapor routes HTTP responders exclusively. If we want to use this route collection with Vapor, it's wrapped type needs to match. ```swift -func build(_ builder: B) { +func build(_ builder: B) where B.Value == Wrapped { ``` This method accepts a route builder and also verifies that the route builder accepts `Wrapped` or, as defined in the last line, `HTTP.Responder`s. Vapor's `Droplet` and any route [group](group.md) created with Vapor are `RouteBuilder`s that accept HTTP responders.