New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helpers for decoding content from requests with a body #1448

Merged
merged 7 commits into from Feb 13, 2018

Conversation

Projects
None yet
3 participants
@Joannis
Copy link
Member

Joannis commented Jan 24, 2018

No description provided.

@Joannis Joannis added the enhancement label Jan 24, 2018

@Joannis Joannis self-assigned this Jan 24, 2018

@Joannis Joannis requested a review from tanner0101 Jan 24, 2018

@@ -28,6 +28,30 @@ public struct RouteResponder<T>: Responder
}
}

/// A basic, closure-based responder.
public struct ContentRouteResponder<C, T>: Responder
where C: Content, T: ResponseEncodable

This comment has been minimized.

@tanner0101

tanner0101 Feb 9, 2018

Member

this should be just RequestDecodable. no reason to limit to Content.

@discardableResult
fileprivate func on<C, T>(
_ method: HTTPMethod,
to path: [PathComponent],

This comment has been minimized.

@tanner0101

tanner0101 Feb 9, 2018

Member

inconsistent labels (to: vs path: on the other calls). IMO this should be at: to match what we do in other parts of the framework, like in CodableKit

This comment has been minimized.

@Joannis

Joannis Feb 9, 2018

Author Member

That was just mimicking the existing function signature above. I'll have to change the existing public function, too, then.

@@ -28,6 +28,30 @@ public struct RouteResponder<T>: Responder
}
}

/// A basic, closure-based responder.
public struct ContentRouteResponder<C, T>: Responder

This comment has been minimized.

@tanner0101

tanner0101 Feb 9, 2018

Member

this should probably be RequestDecodableResponder as well

@twof

This comment has been minimized.

Copy link
Member

twof commented Feb 9, 2018

I really really like this one

tanner0101 added some commits Feb 13, 2018

@tanner0101 tanner0101 added this to the 3.0.0-beta.2 milestone Feb 13, 2018

@tanner0101 tanner0101 merged commit 6398793 into beta Feb 13, 2018

2 checks passed

ci/circleci: linux Your tests passed on CircleCI!
Details
dependency-ci Dependencies checked
Details

@tanner0101 tanner0101 deleted the content-helpers branch Feb 13, 2018

@tanner0101 tanner0101 added this to Done in Vapor 3 Feb 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment