-
Notifications
You must be signed in to change notification settings - Fork 361
LambdaRequest Accessibility #92
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
Comments
@dbettin thanks for reaching out. There are good reasons for not making private interfaces public. It makes it possible to change without breaking application code. Depending on what your specific usecase is, there may be alternative ways of enabling what your trying to accomplish and still keep implementation details private. Can you walk me through your use case in more depth? As mentioned above, it's currently possible ( on master ) to construct full http requests using http crate builder methods and lambda http request ext methods. |
@softprops thanks for the response. I am quite aware of the general principle of information hiding. I am more interested in why this specific struct is not public. Our use case: we are calling our lambdas locally when developing and would like to pass in a file with json as the event. This works well with non-http lambdas but it is not trivial if we would like to take advantage of the lambda http crate. A public LambdaRequest struct makes this a breeze. Thanks! |
I'm thinking an interface that would just look like a func exposed that took in some bytes and returned the request, similar to serde's Would a |
The reason why the struct is not public is because its an implementation detail. It's only intended as an intermediary to get to the http interface. It's not meant to be a public interface. |
@softprops That would work great! |
Are there any disadvantages to making
lambda_http::LambdaRequest
public?For testing http handlers, I would like to deserialize json to a
http::Request
I am essentially after performing something akin to https://github.com/awslabs/aws-lambda-rust-runtime/blob/master/lambda-http/src/request.rs#L361.
The text was updated successfully, but these errors were encountered: