You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to 0.57, one could build and return a service from a function like this:
pubfnbuild_service() -> PokemonService{let service = PokemonService::builder_without_plugins().operation(operation_handler).build().expect("unable to build service");
service.boxed()}
This is because we had a default generic on the service struct. But since #3095, this no longer compiles, because we accidentally removed that default generic:
So even in the most common use case where the user doesn't want to be generic over the body type and was satisfied with aws_smithy_http_server::body::Body, they now need to write this function as:
pubfnbuild_service() -> PokemonService<
aws_smithy_http_server::routing::RoutingService<
aws_smithy_http_server::protocol::rest::router::RestRouter<
aws_smithy_http_server::routing::Route<aws_smithy_http_server::body::Body>,>,
aws_smithy_http_server::protocol::rest_json_1::RestJson1,>,>{let service = PokemonService::builder_without_plugins().operation(operation_handler).build().expect("unable to build service");
service.boxed()}
This is a regression we didn't catch because we don't have any tests in our suite that initialize the service within a function. We should keep providing a default for the S generic for the most common use case.
The text was updated successfully, but these errors were encountered:
This was accidentally removed in #3095.
Fixes#3177.
----
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
Prior to 0.57, one could build and return a service from a function like this:
This is because we had a default generic on the service struct. But since #3095, this no longer compiles, because we accidentally removed that default generic:
So even in the most common use case where the user doesn't want to be generic over the body type and was satisfied with
aws_smithy_http_server::body::Body
, they now need to write this function as:This is a regression we didn't catch because we don't have any tests in our suite that initialize the service within a function. We should keep providing a default for the
S
generic for the most common use case.The text was updated successfully, but these errors were encountered: