From 754519d74f9ae69334ee23e2a1ef7454f911fdf8 Mon Sep 17 00:00:00 2001 From: Kenza Iraki Date: Sun, 7 May 2017 15:52:43 -0400 Subject: [PATCH 1/2] Update collection.md --- 1.5/routing/collection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.5/routing/collection.md b/1.5/routing/collection.md index 8a8debed..d3c78f47 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") From d34362f1270bc1ec675b533610677035ae43e50c Mon Sep 17 00:00:00 2001 From: Kenza Iraki Date: Sun, 7 May 2017 16:11:34 -0400 Subject: [PATCH 2/2] Updated the same function declaration in the breakdown --- 1.5/routing/collection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.5/routing/collection.md b/1.5/routing/collection.md index d3c78f47..e8aad659 100755 --- a/1.5/routing/collection.md +++ b/1.5/routing/collection.md @@ -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.