Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Isolate implementation details from application #4

Open
sergeysova opened this issue May 4, 2020 · 0 comments
Open

Isolate implementation details from application #4

sergeysova opened this issue May 4, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@sergeysova
Copy link
Member

sergeysova commented May 4, 2020

Instead of passing body, header, path extractors to a route:

pub async fn route(
    body: web::Json<request_bodies::Register>,
    app: web::Data<crate::App>,
) -> Answer<'static, register_request::Response> {

Generate a single extractor for all data. Router implementation doesn't know about API details:

pub async fn route(
    params: paths::register_request::Params,
    app: web::Data<crate::App>,
) -> Answer<'static, register_request::Response> {
@sergeysova sergeysova added the enhancement New feature or request label May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant