Skip to content

lambda_http: Use http_body::Body for responses #409

@nmoutschen

Description

@nmoutschen

Since #406, lambda_http::Body implements http_body::Body. However, lambda_http::LambdaResponse only accepts lambda_http::Body as response body.

With this proposal, we could create a LambdaResponse from any Request<http_body::Body>, which means Lambda functions could return anything that implements this trait.

Drawbacks

Right now, we support receiving a serde_json::Value or other values that implement Into<Body> because we use a custom type.

I think this would no longer be possible if we accept a foreign trait, or would involve a bit more complexities on the implementation side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions