I have a TypeSafe Codeable route in Kitura defined like this:
app.router.post("/games") { (auth: BasicAuth, respondWith: @escaping (Game?, RequestError?) -> ()) in
...
}
But when I make a get request, I receive Could not decode received JSON: The required key 'id' not found.
. This seems like the router is attempting to parse the auth
object from the POST body rather than from the basic auth header. If I change the route to GET it works just fine, but I don't understand the Type Safe Codeable routing very well and I'm confused about what changed with the POST route. How do I get my BasicAuth
to work the same with POST as with GET?