Server Test

Server Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb

Files changed:

tmp-codegen-diff/codegen-server-test/naming_test_ops-http0x/rust-server-codegen/src/types.rs

@@ -0,1 +0,5 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use ::aws_smithy_types::date_time::Format as DateTimeFormat;
           3  +
pub use ::aws_smithy_types::error::display::DisplayErrorContext;
           4  +
pub use ::aws_smithy_types::Blob;
           5  +
pub use ::aws_smithy_types::DateTime;

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/Cargo.toml

@@ -1,1 +56,60 @@
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#awsJson1_1"
   12     12   
[dependencies.aws-smithy-http]
   13     13   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http"
   14     14   
[dependencies.aws-smithy-http-server]
   15     15   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-http-server"
   16     16   
[dependencies.aws-smithy-json]
   17     17   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
   18     18   
[dependencies.aws-smithy-runtime-api]
   19     19   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          20  +
features = ["http-1x"]
   20     21   
[dependencies.aws-smithy-types]
   21     22   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          23  +
features = ["http-body-1-x"]
   22     24   
[dependencies.futures-util]
   23     25   
version = "0.3"
   24         -
[dependencies.http]
   25         -
version = "0.2.9"
   26         -
[dependencies.hyper]
   27         -
version = "0.14.26"
          26  +
[dependencies.http-1x]
          27  +
version = "1"
          28  +
package = "http"
          29  +
[dependencies.http-body-util]
          30  +
version = "0.1.3"
   28     31   
[dependencies.mime]
   29     32   
version = "0.3"
   30     33   
[dependencies.pin-project-lite]
   31     34   
version = "0.2"
   32     35   
[dependencies.tower]
   33     36   
version = "0.4"
   34     37   
[dependencies.tracing]
   35     38   
version = "0.1"
   36     39   
[dev-dependencies.aws-smithy-protocol-test]
   37     40   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
          41  +
features = ["http-1x"]
   38     42   
[dev-dependencies.bytes]
   39     43   
version = "1.4.0"
   40     44   
[dev-dependencies.hyper]
   41         -
version = "0.14.12"
          45  +
version = "1"
   42     46   
[dev-dependencies.pretty_assertions]
   43     47   
version = "1.3.0"
   44     48   
[dev-dependencies.tokio]
   45     49   
version = "1.23.1"
   46     50   
features = ["macros", "test-util", "rt-multi-thread"]
   47     51   
[dev-dependencies.tracing-test]
   48     52   
version = "0.2.5"
   49     53   
features = ["no-env-filter"]
   50     54   
[features]
   51     55   
rt-tokio = ["aws-smithy-types/rt-tokio"]

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/lib.rs

@@ -19,19 +128,131 @@
   39     39   
)]
   40     40   
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
   41     41   
//! modules provide the types used in each operation.
   42     42   
//!
   43     43   
//! ### Running on Hyper
   44     44   
//!
   45     45   
//! ```rust,no_run
   46     46   
//! # use std::net::SocketAddr;
   47     47   
//! # async fn dummy() {
   48     48   
//! use naming_test_ops::{Config, ConfigConfig};
          49  +
//! use naming_test_ops::serve;
          50  +
//! use ::tokio::net::TcpListener;
   49     51   
//!
   50     52   
//! # let app = Config::builder(
   51     53   
//! #     ConfigConfig::builder()
   52     54   
//! #         .build()
   53     55   
//! # ).build_unchecked();
   54         -
//! let server = app.into_make_service();
   55     56   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   56     57   
//!     .expect("unable to parse the server bind address and port");
   57         -
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          58  +
//! let listener = TcpListener::bind(bind).await
          59  +
//!     .expect("failed to bind TCP listener");
          60  +
//! serve(listener, app.into_make_service()).await.unwrap();
   58     61   
//! # }
   59     62   
//! ```
   60     63   
//!
   61     64   
//! ### Running on Lambda
   62     65   
//!
   63     66   
//! ```rust,ignore
   64     67   
//! use naming_test_ops::server::routing::LambdaHandler;
   65     68   
//! use naming_test_ops::Config;
   66     69   
//!
   67     70   
//! # async fn dummy() {
   68     71   
//! # let app = Config::builder(
   69     72   
//! #     ConfigConfig::builder()
   70     73   
//! #         .build()
   71     74   
//! # ).build_unchecked();
   72     75   
//! let handler = LambdaHandler::new(app);
   73     76   
//! lambda_http::run(handler).await.unwrap();
   74     77   
//! # }
   75     78   
//! ```
   76     79   
//!
   77     80   
//! # Building the Config
   78     81   
//!
   79     82   
//! To construct [`Config`] we use [`ConfigBuilder`] returned by [`Config::builder`].
   80     83   
//!
   81     84   
//! ## Plugins
   82     85   
//!
   83     86   
//! The [`Config::builder`] method, returning [`ConfigBuilder`],
   84     87   
//! accepts a config object on which plugins can be registered.
   85     88   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
   86     89   
//!
   87     90   
//! ```rust,no_run
   88     91   
//! # use naming_test_ops::server::plugin::IdentityPlugin as LoggingPlugin;
   89     92   
//! # use naming_test_ops::server::plugin::IdentityPlugin as MetricsPlugin;
   90         -
//! # use ::hyper::Body;
          93  +
//! # use ::hyper::body::Incoming;
   91     94   
//! use naming_test_ops::server::plugin::HttpPlugins;
   92     95   
//! use naming_test_ops::{Config, ConfigConfig, ConfigBuilder};
   93     96   
//!
   94     97   
//! let http_plugins = HttpPlugins::new()
   95     98   
//!         .push(LoggingPlugin)
   96     99   
//!         .push(MetricsPlugin);
   97    100   
//! let config = ConfigConfig::builder().build();
   98         -
//! let builder: ConfigBuilder<Body, _, _, _> = Config::builder(config);
         101  +
//! let builder: ConfigBuilder<::hyper::body::Incoming, _, _, _> = Config::builder(config);
   99    102   
//! ```
  100    103   
//!
  101    104   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  102    105   
//!
  103    106   
//! ## Handlers
  104    107   
//!
  105    108   
//! [`ConfigBuilder`] provides a setter method for each operation in your Smithy model. The setter methods expect an async function as input, matching the signature for the corresponding operation in your Smithy model.
  106    109   
//! We call these async functions **handlers**. This is where your application business logic lives.
  107    110   
//!
  108    111   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -135,138 +258,265 @@
  155    158   
//! [`ConfigBuilder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
  156    159   
//!
  157    160   
//! [`ConfigBuilder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
  158    161   
//! [`ConfigBuilder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
  159    162   
//!
  160    163   
//! # Example
  161    164   
//!
  162    165   
//! ```rust,no_run
  163    166   
//! # use std::net::SocketAddr;
  164    167   
//! use naming_test_ops::{Config, ConfigConfig};
         168  +
//! use naming_test_ops::serve;
         169  +
//! use ::tokio::net::TcpListener;
  165    170   
//!
  166    171   
//! #[::tokio::main]
  167    172   
//! pub async fn main() {
  168    173   
//!    let config = ConfigConfig::builder().build();
  169    174   
//!    let app = Config::builder(config)
  170    175   
//!        .err_collisions(err_collisions)
  171    176   
//!        .r#match(r#match)
  172    177   
//!        .option(option)
  173    178   
//!        .reserved_words_as_members(reserved_words_as_members)
  174    179   
//!        .result(result)
  175    180   
//!        .rpc_echo(rpc_echo)
  176    181   
//!        .structure_name_punning(structure_name_punning)
  177    182   
//!        .build()
  178    183   
//!        .expect("failed to build an instance of Config");
  179    184   
//!
  180    185   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  181    186   
//!        .expect("unable to parse the server bind address and port");
  182         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         187  +
//!    let listener = TcpListener::bind(bind).await
         188  +
//!        .expect("failed to bind TCP listener");
  183    189   
//!    # let server = async { Ok::<_, ()>(()) };
  184    190   
//!
  185    191   
//!    // Run your service!
  186         -
//!    if let Err(err) = server.await {
         192  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  187    193   
//!        eprintln!("server error: {:?}", err);
  188    194   
//!    }
  189    195   
//! }
  190    196   
//!
  191    197   
//! use naming_test_ops::{input, output, error};
  192    198   
//!
  193    199   
//! async fn err_collisions(input: input::ErrCollisionsInput) -> Result<output::ErrCollisionsOutput, error::ErrCollisionsError> {
  194    200   
//!     todo!()
  195    201   
//! }
  196    202   
//!
  197    203   
//! async fn r#match(input: input::MatchInput) -> Result<output::MatchOutput, error::MatchError> {
  198    204   
//!     todo!()
  199    205   
//! }
  200    206   
//!
  201    207   
//! async fn option(input: input::OptionInput) -> output::OptionOutput {
  202    208   
//!     todo!()
  203    209   
//! }
  204    210   
//!
  205    211   
//! async fn reserved_words_as_members(input: input::ReservedWordsAsMembersInput) -> Result<output::ReservedWordsAsMembersOutput, error::ReservedWordsAsMembersError> {
  206    212   
//!     todo!()
  207    213   
//! }
  208    214   
//!
  209    215   
//! async fn result(input: input::ResultInput) -> output::ResultOutput {
  210    216   
//!     todo!()
  211    217   
//! }
  212    218   
//!
  213    219   
//! async fn rpc_echo(input: input::RpcEchoInput) -> Result<output::RpcEchoOutput, error::RPCEchoError> {
  214    220   
//!     todo!()
  215    221   
//! }
  216    222   
//!
  217    223   
//! async fn structure_name_punning(input: input::StructureNamePunningInput) -> output::StructureNamePunningOutput {
  218    224   
//!     todo!()
  219    225   
//! }
  220    226   
//!
  221    227   
//! ```
  222    228   
//!
  223         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         229  +
//! [`serve`]: crate::serve
         230  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  224    231   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  225    232   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  226    233   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  227         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  228    234   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         235  +
pub use crate::server::serve::serve;
  229    236   
pub use crate::service::{
  230    237   
    Config, ConfigBuilder, ConfigConfig, ConfigConfigBuilder, MissingOperationsError,
  231    238   
};
  232    239   
  233    240   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  234    241   
pub mod server {
  235    242   
    // Re-export all types from the `aws-smithy-http-server` crate.
  236    243   
    pub use ::aws_smithy_http_server::*;
  237    244   
}
  238    245   

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/operation.rs

@@ -11,11 +71,71 @@
   31     31   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35     35   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   36     36   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   37     37   
{
   38     38   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
   39     39   
    type Future = RpcEchoInputFuture;
   40     40   
   41         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          41  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
   42     42   
        let fut = async move {
   43     43   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   44     44   
                request.headers(),
   45     45   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
   46     46   
            ) {
   47     47   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
   48     48   
            }
   49     49   
            crate::protocol_serde::shape_rpc_echo::de_rpc_echo_http_request(request).await
   50     50   
        };
   51     51   
        use ::futures_util::future::TryFutureExt;
@@ -120,120 +180,180 @@
  140    140   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  141    141   
    B: 'static,
  142    142   
  143    143   
    B::Data: Send,
  144    144   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  145    145   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  146    146   
{
  147    147   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  148    148   
    type Future = MatchInputFuture;
  149    149   
  150         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         150  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  151    151   
        let fut = async move {
  152    152   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  153    153   
                request.headers(),
  154    154   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  155    155   
            ) {
  156    156   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  157    157   
            }
  158    158   
            crate::protocol_serde::shape_match::de_match_http_request(request).await
  159    159   
        };
  160    160   
        use ::futures_util::future::TryFutureExt;
@@ -229,229 +289,289 @@
  249    249   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  250    250   
    B: 'static,
  251    251   
  252    252   
    B::Data: Send,
  253    253   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  254    254   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  255    255   
{
  256    256   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  257    257   
    type Future = OptionInputFuture;
  258    258   
  259         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         259  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  260    260   
        let fut = async move {
  261    261   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  262    262   
                request.headers(),
  263    263   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  264    264   
            ) {
  265    265   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  266    266   
            }
  267    267   
            crate::protocol_serde::shape_option::de_option_http_request(request).await
  268    268   
        };
  269    269   
        use ::futures_util::future::TryFutureExt;
@@ -312,312 +372,372 @@
  332    332   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  333    333   
    B: 'static,
  334    334   
  335    335   
    B::Data: Send,
  336    336   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  337    337   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  338    338   
{
  339    339   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  340    340   
    type Future = ResultInputFuture;
  341    341   
  342         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         342  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  343    343   
        let fut = async move {
  344    344   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  345    345   
                request.headers(),
  346    346   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  347    347   
            ) {
  348    348   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  349    349   
            }
  350    350   
            crate::protocol_serde::shape_result::de_result_http_request(request).await
  351    351   
        };
  352    352   
        use ::futures_util::future::TryFutureExt;
@@ -395,395 +455,455 @@
  415    415   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  416    416   
    B: 'static,
  417    417   
  418    418   
    B::Data: Send,
  419    419   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  420    420   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  421    421   
{
  422    422   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  423    423   
    type Future = ErrCollisionsInputFuture;
  424    424   
  425         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         425  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  426    426   
        let fut = async move {
  427    427   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  428    428   
                request.headers(),
  429    429   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  430    430   
            ) {
  431    431   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  432    432   
            }
  433    433   
            crate::protocol_serde::shape_err_collisions::de_err_collisions_http_request(request)
  434    434   
                .await
  435    435   
        };
@@ -505,505 +628,633 @@
  525    525   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  526    526   
    B: 'static,
  527    527   
  528    528   
    B::Data: Send,
  529    529   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  530    530   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  531    531   
{
  532    532   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  533    533   
    type Future = StructureNamePunningInputFuture;
  534    534   
  535         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         535  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  536    536   
        let fut = async move {
  537    537   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  538    538   
                request.headers(),
  539    539   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  540    540   
            ) {
  541    541   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  542    542   
            }
  543    543   
            crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning_http_request(request)
  544    544   
                            .await
  545    545   
        };
  546    546   
        use ::futures_util::future::TryFutureExt;
  547    547   
        let fut = fut.map_err(
  548    548   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  549    549   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  550    550   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  551    551   
            },
  552    552   
        );
  553    553   
        StructureNamePunningInputFuture {
  554    554   
            inner: Box::pin(fut),
  555    555   
        }
  556    556   
    }
  557    557   
}
  558    558   
impl
  559    559   
    ::aws_smithy_http_server::response::IntoResponse<
  560    560   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  561    561   
    > for crate::output::StructureNamePunningOutput
  562    562   
{
  563    563   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  564    564   
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
  565    565   
                        Ok(response) => response,
  566    566   
                        Err(e) => {
  567    567   
                            ::tracing::error!(error = %e, "failed to serialize response");
  568    568   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  569    569   
                        }
  570    570   
                    }
  571    571   
    }
  572    572   
}
  573    573   
  574    574   
#[allow(unreachable_code, unused_variables)]
  575    575   
#[cfg(test)]
  576    576   
mod structure_name_punning_test {
  577    577   
  578    578   
    /// Test ID: structure_punning
  579    579   
    #[::tokio::test]
  580    580   
    #[::tracing_test::traced_test]
  581    581   
    async fn structure_punning_request() {
  582    582   
        #[allow(unused_mut)]
  583         -
        let mut http_request = http::Request::builder()
         583  +
        let mut http_request = ::http_1x::Request::builder()
  584    584   
            .uri("/")
  585    585   
            .method("POST")
  586    586   
            .header("Content-Type", "application/x-amz-json-1.1")
  587    587   
            .header("X-Amz-Target", "Config.StructureNamePunning")
  588         -
            .body(::aws_smithy_http_server::body::Body::from(
  589         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  590         -
                    "{\"regular_string\": \"hello!\"}".as_bytes(),
  591         -
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
         588  +
            .body(::aws_smithy_http_server::body::boxed(
         589  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         590  +
                    &::aws_smithy_protocol_test::decode_body_data(
         591  +
                        "{\"regular_string\": \"hello!\"}".as_bytes(),
         592  +
                        ::aws_smithy_protocol_test::MediaType::from("application/json"),
         593  +
                    ),
  592    594   
                )),
  593    595   
            ))
  594    596   
            .unwrap();
  595    597   
        #[allow(unused_mut)]
  596    598   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  597    599   
        let config = crate::service::ConfigConfig::builder().build();
  598         -
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
         600  +
        let service =
         601  +
            crate::service::Config::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         602  +
                config,
         603  +
            )
  599    604   
            .structure_name_punning(move |input: crate::input::StructureNamePunningInput| {
  600    605   
                let sender = sender.clone();
  601    606   
                async move {
  602    607   
                    let result = {
  603    608   
                        let expected = crate::input::StructureNamePunningInput {
  604    609   
                            regular_string: ::std::option::Option::Some("hello!".to_owned()),
  605    610   
                            punned_vec: ::std::option::Option::None,
  606    611   
                        };
  607    612   
                        ::pretty_assertions::assert_eq!(input, expected);
  608    613   
                        let output = crate::output::StructureNamePunningOutput {};
@@ -635,640 +695,700 @@
  655    660   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  656    661   
    B: 'static,
  657    662   
  658    663   
    B::Data: Send,
  659    664   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
  660    665   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  661    666   
{
  662    667   
    type Rejection = ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError;
  663    668   
    type Future = ReservedWordsAsMembersInputFuture;
  664    669   
  665         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         670  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  666    671   
        let fut = async move {
  667    672   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  668    673   
                request.headers(),
  669    674   
                &crate::mimes::CONTENT_TYPE_APPLICATION_X_AMZ_JSON_1_1,
  670    675   
            ) {
  671    676   
                return Err(::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection::NotAcceptable);
  672    677   
            }
  673    678   
            crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members_http_request(request)
  674    679   
                            .await
  675    680   
        };
@@ -701,706 +776,786 @@
  721    726   
  722    727   
#[allow(unreachable_code, unused_variables)]
  723    728   
#[cfg(test)]
  724    729   
mod reserved_words_as_members_test {
  725    730   
  726    731   
    /// Test ID: reserved_words
  727    732   
    #[::tokio::test]
  728    733   
    #[::tracing_test::traced_test]
  729    734   
    async fn reserved_words_request() {
  730    735   
        #[allow(unused_mut)]
  731         -
        let mut http_request = http::Request::builder()
         736  +
        let mut http_request = ::http_1x::Request::builder()
  732    737   
            .uri("/")
  733    738   
            .method("POST")
  734    739   
            .header("Content-Type", "application/x-amz-json-1.1")
  735    740   
            .header("X-Amz-Target", "Config.ReservedWordsAsMembers")
  736         -
            .body(::aws_smithy_http_server::body::Body::from(
  737         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  738         -
                    "{\"as\": 5, \"async\": true}".as_bytes(),
  739         -
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
         741  +
            .body(::aws_smithy_http_server::body::boxed(
         742  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         743  +
                    &::aws_smithy_protocol_test::decode_body_data(
         744  +
                        "{\"as\": 5, \"async\": true}".as_bytes(),
         745  +
                        ::aws_smithy_protocol_test::MediaType::from("application/json"),
         746  +
                    ),
  740    747   
                )),
  741    748   
            ))
  742    749   
            .unwrap();
  743    750   
        #[allow(unused_mut)]
  744    751   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  745    752   
        let config = crate::service::ConfigConfig::builder().build();
  746         -
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
         753  +
        let service =
         754  +
            crate::service::Config::builder::<::aws_smithy_http_server::body::BoxBody, _, _, _>(
         755  +
                config,
         756  +
            )
  747    757   
            .reserved_words_as_members(move |input: crate::input::ReservedWordsAsMembersInput| {
  748    758   
                let sender = sender.clone();
  749    759   
                async move {
  750    760   
                    let result = {
  751    761   
                        let expected = crate::input::ReservedWordsAsMembersInput {
  752    762   
                            r#as: ::std::option::Option::Some(5),
  753    763   
                            r#async: ::std::option::Option::Some(true),
  754    764   
                            r#enum: ::std::option::Option::None,
  755    765   
                            self_: ::std::option::Option::None,
  756    766   
                            crate_: ::std::option::Option::None,

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_err_collisions.rs

@@ -1,1 +107,107 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_err_collisions_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ErrCollisionsInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::err_collisions_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_err_collisions_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::ErrCollisionsOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.1",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload = "";
   44     44   
        let content_length = payload.len();
   45     45   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47         -
            ::http::header::CONTENT_LENGTH,
          47  +
            ::http_1x::header::CONTENT_LENGTH,
   48     48   
            content_length,
   49     49   
        );
   50     50   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   51     51   
        builder.body(body)?
   52     52   
    })
   53     53   
}
   54     54   
   55     55   
#[allow(clippy::unnecessary_wraps)]
   56     56   
pub fn ser_err_collisions_http_error(
   57     57   
    error: &crate::error::ErrCollisionsError,
   58     58   
) -> std::result::Result<
   59     59   
    ::aws_smithy_http_server::response::Response,
   60     60   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   61     61   
> {
   62     62   
    Ok({
   63     63   
        match error {
   64     64   
            crate::error::ErrCollisionsError::CollidingError(output) => {
   65     65   
                let payload =
   66     66   
                    crate::protocol_serde::shape_colliding_error::ser_colliding_error_error(
   67     67   
                        output,
   68     68   
                    )?;
   69     69   
                #[allow(unused_mut)]
   70         -
                let mut builder = ::http::Response::builder();
          70  +
                let mut builder = ::http_1x::Response::builder();
   71     71   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   72     72   
                    builder,
   73         -
                    ::http::header::CONTENT_TYPE,
          73  +
                    ::http_1x::header::CONTENT_TYPE,
   74     74   
                    "application/x-amz-json-1.1",
   75     75   
                );
   76     76   
                let content_length = payload.len();
   77     77   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78     78   
                    builder,
   79         -
                    ::http::header::CONTENT_LENGTH,
          79  +
                    ::http_1x::header::CONTENT_LENGTH,
   80     80   
                    content_length,
   81     81   
                );
   82     82   
                builder
   83     83   
                    .status(400)
   84     84   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   85     85   
            }
   86     86   
            crate::error::ErrCollisionsError::CollidingException(output) => {
   87     87   
                let payload = crate::protocol_serde::shape_colliding_exception::ser_colliding_exception_error(output)?;
   88     88   
                #[allow(unused_mut)]
   89         -
                let mut builder = ::http::Response::builder();
          89  +
                let mut builder = ::http_1x::Response::builder();
   90     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     91   
                    builder,
   92         -
                    ::http::header::CONTENT_TYPE,
          92  +
                    ::http_1x::header::CONTENT_TYPE,
   93     93   
                    "application/x-amz-json-1.1",
   94     94   
                );
   95     95   
                let content_length = payload.len();
   96     96   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98         -
                    ::http::header::CONTENT_LENGTH,
          98  +
                    ::http_1x::header::CONTENT_LENGTH,
   99     99   
                    content_length,
  100    100   
                );
  101    101   
                builder
  102    102   
                    .status(400)
  103    103   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  104    104   
            }
  105    105   
        }
  106    106   
    })
  107    107   
}

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_match.rs

@@ -1,1 +114,117 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_match_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MatchInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::match_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.1"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_match::de_match(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()?
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_match_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::MatchOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.1",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload = "";
   52     55   
        let content_length = payload.len();
   53     56   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     57   
            builder,
   55         -
            ::http::header::CONTENT_LENGTH,
          58  +
            ::http_1x::header::CONTENT_LENGTH,
   56     59   
            content_length,
   57     60   
        );
   58     61   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   59     62   
        builder.body(body)?
   60     63   
    })
   61     64   
}
   62     65   
   63     66   
#[allow(clippy::unnecessary_wraps)]
   64     67   
pub fn ser_match_http_error(
   65     68   
    error: &crate::error::MatchError,
   66     69   
) -> std::result::Result<
   67     70   
    ::aws_smithy_http_server::response::Response,
   68     71   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69     72   
> {
   70     73   
    Ok({
   71     74   
        match error {
   72     75   
            crate::error::MatchError::ValidationException(output) => {
   73     76   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   74     77   
                #[allow(unused_mut)]
   75         -
                let mut builder = ::http::Response::builder();
          78  +
                let mut builder = ::http_1x::Response::builder();
   76     79   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77     80   
                    builder,
   78         -
                    ::http::header::CONTENT_TYPE,
          81  +
                    ::http_1x::header::CONTENT_TYPE,
   79     82   
                    "application/x-amz-json-1.1",
   80     83   
                );
   81     84   
                let content_length = payload.len();
   82     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83     86   
                    builder,
   84         -
                    ::http::header::CONTENT_LENGTH,
          87  +
                    ::http_1x::header::CONTENT_LENGTH,
   85     88   
                    content_length,
   86     89   
                );
   87     90   
                builder
   88     91   
                    .status(400)
   89     92   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90     93   
            }
   91     94   
        }
   92     95   
    })
   93     96   
}
   94     97   

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_option.rs

@@ -1,1 +86,89 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_option_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OptionInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::option_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.1"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_option::de_option(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_option_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::OptionOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.1",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload =
   52     55   
            crate::protocol_serde::shape_option_output::ser_option_output_output_output(&output)?;
   53     56   
        let content_length = payload.len();
   54     57   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   55     58   
            builder,
   56         -
            ::http::header::CONTENT_LENGTH,
          59  +
            ::http_1x::header::CONTENT_LENGTH,
   57     60   
            content_length,
   58     61   
        );
   59     62   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   60     63   
        builder.body(body)?
   61     64   
    })
   62     65   
}
   63     66   
   64     67   
pub(crate) fn de_option(
   65     68   
    value: &[u8],
   66     69   
    mut builder: crate::input::option_input::Builder,

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_reserved_words_as_members.rs

@@ -1,1 +114,117 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_reserved_words_as_members_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ReservedWordsAsMembersInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::reserved_words_as_members_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.1"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_reserved_words_as_members::de_reserved_words_as_members(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()?
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_reserved_words_as_members_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::ReservedWordsAsMembersOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.1",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload = "";
   52     55   
        let content_length = payload.len();
   53     56   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     57   
            builder,
   55         -
            ::http::header::CONTENT_LENGTH,
          58  +
            ::http_1x::header::CONTENT_LENGTH,
   56     59   
            content_length,
   57     60   
        );
   58     61   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   59     62   
        builder.body(body)?
   60     63   
    })
   61     64   
}
   62     65   
   63     66   
#[allow(clippy::unnecessary_wraps)]
   64     67   
pub fn ser_reserved_words_as_members_http_error(
   65     68   
    error: &crate::error::ReservedWordsAsMembersError,
   66     69   
) -> std::result::Result<
   67     70   
    ::aws_smithy_http_server::response::Response,
   68     71   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69     72   
> {
   70     73   
    Ok({
   71     74   
        match error {
   72     75   
            crate::error::ReservedWordsAsMembersError::ValidationException(output) => {
   73     76   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   74     77   
                #[allow(unused_mut)]
   75         -
                let mut builder = ::http::Response::builder();
          78  +
                let mut builder = ::http_1x::Response::builder();
   76     79   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77     80   
                    builder,
   78         -
                    ::http::header::CONTENT_TYPE,
          81  +
                    ::http_1x::header::CONTENT_TYPE,
   79     82   
                    "application/x-amz-json-1.1",
   80     83   
                );
   81     84   
                let content_length = payload.len();
   82     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83     86   
                    builder,
   84         -
                    ::http::header::CONTENT_LENGTH,
          87  +
                    ::http_1x::header::CONTENT_LENGTH,
   85     88   
                    content_length,
   86     89   
                );
   87     90   
                builder
   88     91   
                    .status(400)
   89     92   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90     93   
            }
   91     94   
        }
   92     95   
    })
   93     96   
}
   94     97   

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_result.rs

@@ -1,1 +86,89 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_result_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ResultInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::result_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.1"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_result::de_result(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_result_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::ResultOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.1",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload =
   52     55   
            crate::protocol_serde::shape_result_output::ser_result_output_output_output(&output)?;
   53     56   
        let content_length = payload.len();
   54     57   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   55     58   
            builder,
   56         -
            ::http::header::CONTENT_LENGTH,
          59  +
            ::http_1x::header::CONTENT_LENGTH,
   57     60   
            content_length,
   58     61   
        );
   59     62   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   60     63   
        builder.body(body)?
   61     64   
    })
   62     65   
}
   63     66   
   64     67   
pub(crate) fn de_result(
   65     68   
    value: &[u8],
   66     69   
    mut builder: crate::input::result_input::Builder,

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_rpc_echo.rs

@@ -1,1 +114,117 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_rpc_echo_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::RpcEchoInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::rpc_echo_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.1"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_rpc_echo::de_rpc_echo(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()?
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_rpc_echo_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::RpcEchoOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.1",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload = "";
   52     55   
        let content_length = payload.len();
   53     56   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     57   
            builder,
   55         -
            ::http::header::CONTENT_LENGTH,
          58  +
            ::http_1x::header::CONTENT_LENGTH,
   56     59   
            content_length,
   57     60   
        );
   58     61   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   59     62   
        builder.body(body)?
   60     63   
    })
   61     64   
}
   62     65   
   63     66   
#[allow(clippy::unnecessary_wraps)]
   64     67   
pub fn ser_rpc_echo_http_error(
   65     68   
    error: &crate::error::RPCEchoError,
   66     69   
) -> std::result::Result<
   67     70   
    ::aws_smithy_http_server::response::Response,
   68     71   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69     72   
> {
   70     73   
    Ok({
   71     74   
        match error {
   72     75   
            crate::error::RPCEchoError::ValidationException(output) => {
   73     76   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   74     77   
                #[allow(unused_mut)]
   75         -
                let mut builder = ::http::Response::builder();
          78  +
                let mut builder = ::http_1x::Response::builder();
   76     79   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77     80   
                    builder,
   78         -
                    ::http::header::CONTENT_TYPE,
          81  +
                    ::http_1x::header::CONTENT_TYPE,
   79     82   
                    "application/x-amz-json-1.1",
   80     83   
                );
   81     84   
                let content_length = payload.len();
   82     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83     86   
                    builder,
   84         -
                    ::http::header::CONTENT_LENGTH,
          87  +
                    ::http_1x::header::CONTENT_LENGTH,
   85     88   
                    content_length,
   86     89   
                );
   87     90   
                builder
   88     91   
                    .status(400)
   89     92   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90     93   
            }
   91     94   
        }
   92     95   
    })
   93     96   
}
   94     97   

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/protocol_serde/shape_structure_name_punning.rs

@@ -1,1 +88,91 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_structure_name_punning_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::StructureNamePunningInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::structure_name_punning_input::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.1"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_structure_name_punning::de_structure_name_punning(
   29     32   
                bytes.as_ref(),
   30     33   
                input,
   31     34   
            )?;
   32     35   
        }
   33     36   
        input.build()
   34     37   
    })
   35     38   
}
   36     39   
   37     40   
#[allow(clippy::unnecessary_wraps)]
   38     41   
pub fn ser_structure_name_punning_http_response(
   39     42   
    #[allow(unused_variables)] output: crate::output::StructureNamePunningOutput,
   40     43   
) -> std::result::Result<
   41     44   
    ::aws_smithy_http_server::response::Response,
   42     45   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   43     46   
> {
   44     47   
    Ok({
   45     48   
        #[allow(unused_mut)]
   46         -
        let mut builder = ::http::Response::builder();
          49  +
        let mut builder = ::http_1x::Response::builder();
   47     50   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     51   
            builder,
   49         -
            ::http::header::CONTENT_TYPE,
          52  +
            ::http_1x::header::CONTENT_TYPE,
   50     53   
            "application/x-amz-json-1.1",
   51     54   
        );
   52     55   
        let http_status: u16 = 200;
   53     56   
        builder = builder.status(http_status);
   54     57   
        let payload = "";
   55     58   
        let content_length = payload.len();
   56     59   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     60   
            builder,
   58         -
            ::http::header::CONTENT_LENGTH,
          61  +
            ::http_1x::header::CONTENT_LENGTH,
   59     62   
            content_length,
   60     63   
        );
   61     64   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   62     65   
        builder.body(body)?
   63     66   
    })
   64     67   
}
   65     68   
   66     69   
pub(crate) fn de_structure_name_punning(
   67     70   
    value: &[u8],
   68     71   
    mut builder: crate::input::structure_name_punning_input::Builder,

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/service.rs

@@ -41,41 +102,102 @@
   61     61   
                            <
   62     62   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   63     63   
                                as ::aws_smithy_http_server::plugin::Plugin<
   64     64   
                                    Config<L>,
   65     65   
                                    crate::operation_shape::ErrCollisions,
   66     66   
                                    ModelPl::Output
   67     67   
                                >
   68     68   
                            >::Output
   69     69   
                        >,
   70     70   
   71         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   72         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          71  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
          72  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
   73     73   
   74     74   
                    {
   75     75   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   76     76   
        use ::aws_smithy_http_server::plugin::Plugin;
   77     77   
        let svc = crate::operation_shape::ErrCollisions::from_handler(handler);
   78     78   
        let svc = self.model_plugin.apply(svc);
   79     79   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   80     80   
            .apply(svc);
   81     81   
        let svc = self.http_plugin.apply(svc);
   82     82   
        self.err_collisions_custom(svc)
@@ -108,108 +188,188 @@
  128    128   
                            <
  129    129   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  130    130   
                                as ::aws_smithy_http_server::plugin::Plugin<
  131    131   
                                    Config<L>,
  132    132   
                                    crate::operation_shape::ErrCollisions,
  133    133   
                                    ModelPl::Output
  134    134   
                                >
  135    135   
                            >::Output
  136    136   
                        >,
  137    137   
  138         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  139         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         138  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         139  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  140    140   
  141    141   
                    {
  142    142   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  143    143   
        use ::aws_smithy_http_server::plugin::Plugin;
  144    144   
        let svc = crate::operation_shape::ErrCollisions::from_service(service);
  145    145   
        let svc = self.model_plugin.apply(svc);
  146    146   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  147    147   
            .apply(svc);
  148    148   
        let svc = self.http_plugin.apply(svc);
  149    149   
        self.err_collisions_custom(svc)
  150    150   
    }
  151    151   
  152    152   
    /// Sets the [`ErrCollisions`](crate::operation_shape::ErrCollisions) to a custom [`Service`](tower::Service).
  153    153   
    /// not constrained by the Smithy contract.
  154    154   
    fn err_collisions_custom<S>(mut self, svc: S) -> Self
  155    155   
    where
  156    156   
        S: ::tower::Service<
  157         -
                ::http::Request<Body>,
  158         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         157  +
                ::http_1x::Request<Body>,
         158  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  159    159   
                Error = ::std::convert::Infallible,
  160    160   
            > + Clone
  161    161   
            + Send
  162    162   
            + 'static,
  163    163   
        S::Future: Send + 'static,
  164    164   
    {
  165    165   
        self.err_collisions = Some(::aws_smithy_http_server::routing::Route::new(svc));
  166    166   
        self
  167    167   
    }
  168    168   
@@ -191,191 +252,252 @@
  211    211   
                            <
  212    212   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  213    213   
                                as ::aws_smithy_http_server::plugin::Plugin<
  214    214   
                                    Config<L>,
  215    215   
                                    crate::operation_shape::Match,
  216    216   
                                    ModelPl::Output
  217    217   
                                >
  218    218   
                            >::Output
  219    219   
                        >,
  220    220   
  221         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  222         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         221  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         222  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  223    223   
  224    224   
                    {
  225    225   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  226    226   
        use ::aws_smithy_http_server::plugin::Plugin;
  227    227   
        let svc = crate::operation_shape::Match::from_handler(handler);
  228    228   
        let svc = self.model_plugin.apply(svc);
  229    229   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  230    230   
            .apply(svc);
  231    231   
        let svc = self.http_plugin.apply(svc);
  232    232   
        self.r#match_custom(svc)
@@ -258,258 +338,338 @@
  278    278   
                            <
  279    279   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  280    280   
                                as ::aws_smithy_http_server::plugin::Plugin<
  281    281   
                                    Config<L>,
  282    282   
                                    crate::operation_shape::Match,
  283    283   
                                    ModelPl::Output
  284    284   
                                >
  285    285   
                            >::Output
  286    286   
                        >,
  287    287   
  288         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  289         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         288  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         289  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  290    290   
  291    291   
                    {
  292    292   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  293    293   
        use ::aws_smithy_http_server::plugin::Plugin;
  294    294   
        let svc = crate::operation_shape::Match::from_service(service);
  295    295   
        let svc = self.model_plugin.apply(svc);
  296    296   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  297    297   
            .apply(svc);
  298    298   
        let svc = self.http_plugin.apply(svc);
  299    299   
        self.r#match_custom(svc)
  300    300   
    }
  301    301   
  302    302   
    /// Sets the [`Match`](crate::operation_shape::Match) to a custom [`Service`](tower::Service).
  303    303   
    /// not constrained by the Smithy contract.
  304    304   
    fn r#match_custom<S>(mut self, svc: S) -> Self
  305    305   
    where
  306    306   
        S: ::tower::Service<
  307         -
                ::http::Request<Body>,
  308         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         307  +
                ::http_1x::Request<Body>,
         308  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  309    309   
                Error = ::std::convert::Infallible,
  310    310   
            > + Clone
  311    311   
            + Send
  312    312   
            + 'static,
  313    313   
        S::Future: Send + 'static,
  314    314   
    {
  315    315   
        self.r#match = Some(::aws_smithy_http_server::routing::Route::new(svc));
  316    316   
        self
  317    317   
    }
  318    318   
@@ -341,341 +402,402 @@
  361    361   
                            <
  362    362   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  363    363   
                                as ::aws_smithy_http_server::plugin::Plugin<
  364    364   
                                    Config<L>,
  365    365   
                                    crate::operation_shape::Option,
  366    366   
                                    ModelPl::Output
  367    367   
                                >
  368    368   
                            >::Output
  369    369   
                        >,
  370    370   
  371         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  372         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         371  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         372  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  373    373   
  374    374   
                    {
  375    375   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  376    376   
        use ::aws_smithy_http_server::plugin::Plugin;
  377    377   
        let svc = crate::operation_shape::Option::from_handler(handler);
  378    378   
        let svc = self.model_plugin.apply(svc);
  379    379   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  380    380   
            .apply(svc);
  381    381   
        let svc = self.http_plugin.apply(svc);
  382    382   
        self.option_custom(svc)
@@ -408,408 +488,488 @@
  428    428   
                            <
  429    429   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  430    430   
                                as ::aws_smithy_http_server::plugin::Plugin<
  431    431   
                                    Config<L>,
  432    432   
                                    crate::operation_shape::Option,
  433    433   
                                    ModelPl::Output
  434    434   
                                >
  435    435   
                            >::Output
  436    436   
                        >,
  437    437   
  438         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  439         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         438  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         439  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  440    440   
  441    441   
                    {
  442    442   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  443    443   
        use ::aws_smithy_http_server::plugin::Plugin;
  444    444   
        let svc = crate::operation_shape::Option::from_service(service);
  445    445   
        let svc = self.model_plugin.apply(svc);
  446    446   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  447    447   
            .apply(svc);
  448    448   
        let svc = self.http_plugin.apply(svc);
  449    449   
        self.option_custom(svc)
  450    450   
    }
  451    451   
  452    452   
    /// Sets the [`Option`](crate::operation_shape::Option) to a custom [`Service`](tower::Service).
  453    453   
    /// not constrained by the Smithy contract.
  454    454   
    fn option_custom<S>(mut self, svc: S) -> Self
  455    455   
    where
  456    456   
        S: ::tower::Service<
  457         -
                ::http::Request<Body>,
  458         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         457  +
                ::http_1x::Request<Body>,
         458  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  459    459   
                Error = ::std::convert::Infallible,
  460    460   
            > + Clone
  461    461   
            + Send
  462    462   
            + 'static,
  463    463   
        S::Future: Send + 'static,
  464    464   
    {
  465    465   
        self.option = Some(::aws_smithy_http_server::routing::Route::new(svc));
  466    466   
        self
  467    467   
    }
  468    468   
@@ -491,491 +552,552 @@
  511    511   
                            <
  512    512   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  513    513   
                                as ::aws_smithy_http_server::plugin::Plugin<
  514    514   
                                    Config<L>,
  515    515   
                                    crate::operation_shape::ReservedWordsAsMembers,
  516    516   
                                    ModelPl::Output
  517    517   
                                >
  518    518   
                            >::Output
  519    519   
                        >,
  520    520   
  521         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  522         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         521  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         522  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  523    523   
  524    524   
                    {
  525    525   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  526    526   
        use ::aws_smithy_http_server::plugin::Plugin;
  527    527   
        let svc = crate::operation_shape::ReservedWordsAsMembers::from_handler(handler);
  528    528   
        let svc = self.model_plugin.apply(svc);
  529    529   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  530    530   
            .apply(svc);
  531    531   
        let svc = self.http_plugin.apply(svc);
  532    532   
        self.reserved_words_as_members_custom(svc)
@@ -558,558 +638,638 @@
  578    578   
                            <
  579    579   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  580    580   
                                as ::aws_smithy_http_server::plugin::Plugin<
  581    581   
                                    Config<L>,
  582    582   
                                    crate::operation_shape::ReservedWordsAsMembers,
  583    583   
                                    ModelPl::Output
  584    584   
                                >
  585    585   
                            >::Output
  586    586   
                        >,
  587    587   
  588         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  589         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         588  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         589  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  590    590   
  591    591   
                    {
  592    592   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  593    593   
        use ::aws_smithy_http_server::plugin::Plugin;
  594    594   
        let svc = crate::operation_shape::ReservedWordsAsMembers::from_service(service);
  595    595   
        let svc = self.model_plugin.apply(svc);
  596    596   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  597    597   
            .apply(svc);
  598    598   
        let svc = self.http_plugin.apply(svc);
  599    599   
        self.reserved_words_as_members_custom(svc)
  600    600   
    }
  601    601   
  602    602   
    /// Sets the [`ReservedWordsAsMembers`](crate::operation_shape::ReservedWordsAsMembers) to a custom [`Service`](tower::Service).
  603    603   
    /// not constrained by the Smithy contract.
  604    604   
    fn reserved_words_as_members_custom<S>(mut self, svc: S) -> Self
  605    605   
    where
  606    606   
        S: ::tower::Service<
  607         -
                ::http::Request<Body>,
  608         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         607  +
                ::http_1x::Request<Body>,
         608  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  609    609   
                Error = ::std::convert::Infallible,
  610    610   
            > + Clone
  611    611   
            + Send
  612    612   
            + 'static,
  613    613   
        S::Future: Send + 'static,
  614    614   
    {
  615    615   
        self.reserved_words_as_members = Some(::aws_smithy_http_server::routing::Route::new(svc));
  616    616   
        self
  617    617   
    }
  618    618   
@@ -641,641 +702,702 @@
  661    661   
                            <
  662    662   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  663    663   
                                as ::aws_smithy_http_server::plugin::Plugin<
  664    664   
                                    Config<L>,
  665    665   
                                    crate::operation_shape::Result,
  666    666   
                                    ModelPl::Output
  667    667   
                                >
  668    668   
                            >::Output
  669    669   
                        >,
  670    670   
  671         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  672         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         671  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         672  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  673    673   
  674    674   
                    {
  675    675   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  676    676   
        use ::aws_smithy_http_server::plugin::Plugin;
  677    677   
        let svc = crate::operation_shape::Result::from_handler(handler);
  678    678   
        let svc = self.model_plugin.apply(svc);
  679    679   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  680    680   
            .apply(svc);
  681    681   
        let svc = self.http_plugin.apply(svc);
  682    682   
        self.result_custom(svc)
@@ -708,708 +788,788 @@
  728    728   
                            <
  729    729   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  730    730   
                                as ::aws_smithy_http_server::plugin::Plugin<
  731    731   
                                    Config<L>,
  732    732   
                                    crate::operation_shape::Result,
  733    733   
                                    ModelPl::Output
  734    734   
                                >
  735    735   
                            >::Output
  736    736   
                        >,
  737    737   
  738         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  739         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         738  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         739  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  740    740   
  741    741   
                    {
  742    742   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  743    743   
        use ::aws_smithy_http_server::plugin::Plugin;
  744    744   
        let svc = crate::operation_shape::Result::from_service(service);
  745    745   
        let svc = self.model_plugin.apply(svc);
  746    746   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  747    747   
            .apply(svc);
  748    748   
        let svc = self.http_plugin.apply(svc);
  749    749   
        self.result_custom(svc)
  750    750   
    }
  751    751   
  752    752   
    /// Sets the [`Result`](crate::operation_shape::Result) to a custom [`Service`](tower::Service).
  753    753   
    /// not constrained by the Smithy contract.
  754    754   
    fn result_custom<S>(mut self, svc: S) -> Self
  755    755   
    where
  756    756   
        S: ::tower::Service<
  757         -
                ::http::Request<Body>,
  758         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         757  +
                ::http_1x::Request<Body>,
         758  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  759    759   
                Error = ::std::convert::Infallible,
  760    760   
            > + Clone
  761    761   
            + Send
  762    762   
            + 'static,
  763    763   
        S::Future: Send + 'static,
  764    764   
    {
  765    765   
        self.result = Some(::aws_smithy_http_server::routing::Route::new(svc));
  766    766   
        self
  767    767   
    }
  768    768   
@@ -791,791 +852,852 @@
  811    811   
                            <
  812    812   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  813    813   
                                as ::aws_smithy_http_server::plugin::Plugin<
  814    814   
                                    Config<L>,
  815    815   
                                    crate::operation_shape::RpcEcho,
  816    816   
                                    ModelPl::Output
  817    817   
                                >
  818    818   
                            >::Output
  819    819   
                        >,
  820    820   
  821         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  822         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         821  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         822  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  823    823   
  824    824   
                    {
  825    825   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  826    826   
        use ::aws_smithy_http_server::plugin::Plugin;
  827    827   
        let svc = crate::operation_shape::RpcEcho::from_handler(handler);
  828    828   
        let svc = self.model_plugin.apply(svc);
  829    829   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  830    830   
            .apply(svc);
  831    831   
        let svc = self.http_plugin.apply(svc);
  832    832   
        self.rpc_echo_custom(svc)
@@ -858,858 +938,938 @@
  878    878   
                            <
  879    879   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  880    880   
                                as ::aws_smithy_http_server::plugin::Plugin<
  881    881   
                                    Config<L>,
  882    882   
                                    crate::operation_shape::RpcEcho,
  883    883   
                                    ModelPl::Output
  884    884   
                                >
  885    885   
                            >::Output
  886    886   
                        >,
  887    887   
  888         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  889         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         888  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         889  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  890    890   
  891    891   
                    {
  892    892   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  893    893   
        use ::aws_smithy_http_server::plugin::Plugin;
  894    894   
        let svc = crate::operation_shape::RpcEcho::from_service(service);
  895    895   
        let svc = self.model_plugin.apply(svc);
  896    896   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  897    897   
            .apply(svc);
  898    898   
        let svc = self.http_plugin.apply(svc);
  899    899   
        self.rpc_echo_custom(svc)
  900    900   
    }
  901    901   
  902    902   
    /// Sets the [`RpcEcho`](crate::operation_shape::RpcEcho) to a custom [`Service`](tower::Service).
  903    903   
    /// not constrained by the Smithy contract.
  904    904   
    fn rpc_echo_custom<S>(mut self, svc: S) -> Self
  905    905   
    where
  906    906   
        S: ::tower::Service<
  907         -
                ::http::Request<Body>,
  908         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         907  +
                ::http_1x::Request<Body>,
         908  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  909    909   
                Error = ::std::convert::Infallible,
  910    910   
            > + Clone
  911    911   
            + Send
  912    912   
            + 'static,
  913    913   
        S::Future: Send + 'static,
  914    914   
    {
  915    915   
        self.rpc_echo = Some(::aws_smithy_http_server::routing::Route::new(svc));
  916    916   
        self
  917    917   
    }
  918    918   
@@ -941,941 +1002,1002 @@
  961    961   
                            <
  962    962   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  963    963   
                                as ::aws_smithy_http_server::plugin::Plugin<
  964    964   
                                    Config<L>,
  965    965   
                                    crate::operation_shape::StructureNamePunning,
  966    966   
                                    ModelPl::Output
  967    967   
                                >
  968    968   
                            >::Output
  969    969   
                        >,
  970    970   
  971         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  972         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         971  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
         972  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  973    973   
  974    974   
                    {
  975    975   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  976    976   
        use ::aws_smithy_http_server::plugin::Plugin;
  977    977   
        let svc = crate::operation_shape::StructureNamePunning::from_handler(handler);
  978    978   
        let svc = self.model_plugin.apply(svc);
  979    979   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  980    980   
            .apply(svc);
  981    981   
        let svc = self.http_plugin.apply(svc);
  982    982   
        self.structure_name_punning_custom(svc)
@@ -1008,1008 +1088,1088 @@
 1028   1028   
                            <
 1029   1029   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
 1030   1030   
                                as ::aws_smithy_http_server::plugin::Plugin<
 1031   1031   
                                    Config<L>,
 1032   1032   
                                    crate::operation_shape::StructureNamePunning,
 1033   1033   
                                    ModelPl::Output
 1034   1034   
                                >
 1035   1035   
                            >::Output
 1036   1036   
                        >,
 1037   1037   
 1038         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
 1039         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
        1038  +
                        HttpPl::Output: ::tower::Service<::http_1x::Request<Body>, Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
        1039  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
 1040   1040   
 1041   1041   
                    {
 1042   1042   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
 1043   1043   
        use ::aws_smithy_http_server::plugin::Plugin;
 1044   1044   
        let svc = crate::operation_shape::StructureNamePunning::from_service(service);
 1045   1045   
        let svc = self.model_plugin.apply(svc);
 1046   1046   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
 1047   1047   
            .apply(svc);
 1048   1048   
        let svc = self.http_plugin.apply(svc);
 1049   1049   
        self.structure_name_punning_custom(svc)
 1050   1050   
    }
 1051   1051   
 1052   1052   
    /// Sets the [`StructureNamePunning`](crate::operation_shape::StructureNamePunning) to a custom [`Service`](tower::Service).
 1053   1053   
    /// not constrained by the Smithy contract.
 1054   1054   
    fn structure_name_punning_custom<S>(mut self, svc: S) -> Self
 1055   1055   
    where
 1056   1056   
        S: ::tower::Service<
 1057         -
                ::http::Request<Body>,
 1058         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
        1057  +
                ::http_1x::Request<Body>,
        1058  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
 1059   1059   
                Error = ::std::convert::Infallible,
 1060   1060   
            > + Clone
 1061   1061   
            + Send
 1062   1062   
            + 'static,
 1063   1063   
        S::Future: Send + 'static,
 1064   1064   
    {
 1065   1065   
        self.structure_name_punning = Some(::aws_smithy_http_server::routing::Route::new(svc));
 1066   1066   
        self
 1067   1067   
    }
 1068   1068   
}
@@ -1440,1440 +1501,1501 @@
 1460   1460   
    ) -> Config<
 1461   1461   
        ::aws_smithy_http_server::routing::RoutingService<
 1462   1462   
            ::aws_smithy_http_server::protocol::aws_json::router::AwsJsonRouter<
 1463   1463   
                ::aws_smithy_http_server::routing::Route<B>,
 1464   1464   
            >,
 1465   1465   
            ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
 1466   1466   
        >,
 1467   1467   
    >
 1468   1468   
    where
 1469   1469   
        S: ::tower::Service<
 1470         -
            ::http::Request<B>,
 1471         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
        1470  +
            ::http_1x::Request<B>,
        1471  +
            Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
 1472   1472   
            Error = std::convert::Infallible,
 1473   1473   
        >,
 1474   1474   
        S: Clone + Send + 'static,
 1475   1475   
        S::Future: Send + 'static,
 1476   1476   
    {
 1477   1477   
        self.layer(&::tower::layer::layer_fn(
 1478   1478   
            ::aws_smithy_http_server::routing::Route::new,
 1479   1479   
        ))
 1480   1480   
    }
 1481   1481   
}

tmp-codegen-diff/codegen-server-test/naming_test_structs-http0x/rust-server-codegen/Cargo.toml

@@ -0,1 +0,46 @@
           1  +
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
[package]
           3  +
name = "naming_test_structs-http0x"
           4  +
version = "0.0.1"
           5  +
authors = ["protocoltest@example.com"]
           6  +
description = "test"
           7  +
edition = "2021"
           8  +
           9  +
[package.metadata.smithy]
          10  +
codegen-version = "ci"
          11  +
protocol = "aws.protocols#awsJson1_1"
          12  +
[dependencies.aws-smithy-json]
          13  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-json"
          14  +
[dependencies.aws-smithy-legacy-http]
          15  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http"
          16  +
[dependencies.aws-smithy-legacy-http-server]
          17  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http-server"
          18  +
[dependencies.aws-smithy-runtime-api]
          19  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          20  +
features = ["http-02x"]
          21  +
[dependencies.aws-smithy-types]
          22  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          23  +
features = ["http-body-0-4-x"]
          24  +
[dependencies.futures-util]
          25  +
version = "0.3"
          26  +
[dependencies.http]
          27  +
version = "0.2.9"
          28  +
[dependencies.hyper]
          29  +
version = "0.14.26"
          30  +
[dependencies.mime]
          31  +
version = "0.3"
          32  +
[dependencies.pin-project-lite]
          33  +
version = "0.2"
          34  +
[dependencies.tower]
          35  +
version = "0.4"
          36  +
[dependencies.tracing]
          37  +
version = "0.1"
          38  +
[dev-dependencies.tokio]
          39  +
version = "1.23.1"
          40  +
[features]
          41  +
rt-tokio = ["aws-smithy-types/rt-tokio"]
          42  +
aws-lambda = ["aws-smithy-legacy-http-server/aws-lambda"]
          43  +
request-id = ["aws-smithy-legacy-http-server/request-id"]
          44  +
default = ["rt-tokio", "request-id"]
          45  +
          46  +

tmp-codegen-diff/codegen-server-test/naming_test_structs-http0x/rust-server-codegen/src/constrained.rs

@@ -0,1 +0,16 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/*
           3  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           4  +
 * SPDX-License-Identifier: Apache-2.0
           5  +
 */
           6  +
           7  +
pub(crate) trait Constrained {
           8  +
    type Unconstrained;
           9  +
}
          10  +
          11  +
#[derive(Debug, Clone)]
          12  +
#[allow(dead_code)]
          13  +
pub(crate) enum MaybeConstrained<T: Constrained> {
          14  +
    Constrained(T),
          15  +
    Unconstrained(T::Unconstrained),
          16  +
}

tmp-codegen-diff/codegen-server-test/naming_test_structs-http0x/rust-server-codegen/src/error.rs

@@ -0,1 +0,1 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

tmp-codegen-diff/codegen-server-test/naming_test_structs-http0x/rust-server-codegen/src/input.rs

@@ -0,1 +0,155 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[derive(
           4  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
           5  +
)]
           6  +
pub struct StructsInput {
           7  +
    #[allow(missing_docs)] // documentation missing in model
           8  +
    pub result: ::std::option::Option<crate::model::Result>,
           9  +
    #[allow(missing_docs)] // documentation missing in model
          10  +
    pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          11  +
    #[allow(missing_docs)] // documentation missing in model
          12  +
    pub option: ::std::option::Option<crate::model::Option>,
          13  +
    #[allow(missing_docs)] // documentation missing in model
          14  +
    pub option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          15  +
    #[allow(missing_docs)] // documentation missing in model
          16  +
    pub something_else: ::std::option::Option<crate::model::SomethingElse>,
          17  +
}
          18  +
impl StructsInput {
          19  +
    #[allow(missing_docs)] // documentation missing in model
          20  +
    pub fn result(&self) -> ::std::option::Option<&crate::model::Result> {
          21  +
        self.result.as_ref()
          22  +
    }
          23  +
    #[allow(missing_docs)] // documentation missing in model
          24  +
    pub fn result_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          25  +
        self.result_list.as_deref()
          26  +
    }
          27  +
    #[allow(missing_docs)] // documentation missing in model
          28  +
    pub fn option(&self) -> ::std::option::Option<&crate::model::Option> {
          29  +
        self.option.as_ref()
          30  +
    }
          31  +
    #[allow(missing_docs)] // documentation missing in model
          32  +
    pub fn option_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
          33  +
        self.option_list.as_deref()
          34  +
    }
          35  +
    #[allow(missing_docs)] // documentation missing in model
          36  +
    pub fn something_else(&self) -> ::std::option::Option<&crate::model::SomethingElse> {
          37  +
        self.something_else.as_ref()
          38  +
    }
          39  +
}
          40  +
impl StructsInput {
          41  +
    /// Creates a new builder-style object to manufacture [`StructsInput`](crate::input::StructsInput).
          42  +
    pub fn builder() -> crate::input::structs_input::Builder {
          43  +
        crate::input::structs_input::Builder::default()
          44  +
    }
          45  +
}
          46  +
impl crate::constrained::Constrained for crate::input::StructsInput {
          47  +
    type Unconstrained = crate::input::structs_input::Builder;
          48  +
}
          49  +
/// See [`StructsInput`](crate::input::StructsInput).
          50  +
pub mod structs_input {
          51  +
          52  +
    impl ::std::convert::From<Builder> for crate::input::StructsInput {
          53  +
        fn from(builder: Builder) -> Self {
          54  +
            builder.build()
          55  +
        }
          56  +
    }
          57  +
    /// A builder for [`StructsInput`](crate::input::StructsInput).
          58  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          59  +
    pub struct Builder {
          60  +
        pub(crate) result: ::std::option::Option<crate::model::Result>,
          61  +
        pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          62  +
        pub(crate) option: ::std::option::Option<crate::model::Option>,
          63  +
        pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          64  +
        pub(crate) something_else: ::std::option::Option<crate::model::SomethingElse>,
          65  +
    }
          66  +
    impl Builder {
          67  +
        #[allow(missing_docs)] // documentation missing in model
          68  +
        pub fn result(mut self, input: ::std::option::Option<crate::model::Result>) -> Self {
          69  +
            self.result = input;
          70  +
            self
          71  +
        }
          72  +
        #[allow(missing_docs)] // documentation missing in model
          73  +
        pub(crate) fn set_result(
          74  +
            mut self,
          75  +
            input: Option<impl ::std::convert::Into<crate::model::Result>>,
          76  +
        ) -> Self {
          77  +
            self.result = input.map(|v| v.into());
          78  +
            self
          79  +
        }
          80  +
        #[allow(missing_docs)] // documentation missing in model
          81  +
        pub fn result_list(
          82  +
            mut self,
          83  +
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
          84  +
        ) -> Self {
          85  +
            self.result_list = input;
          86  +
            self
          87  +
        }
          88  +
        #[allow(missing_docs)] // documentation missing in model
          89  +
        pub(crate) fn set_result_list(
          90  +
            mut self,
          91  +
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
          92  +
        ) -> Self {
          93  +
            self.result_list = input.map(|v| v.into());
          94  +
            self
          95  +
        }
          96  +
        #[allow(missing_docs)] // documentation missing in model
          97  +
        pub fn option(mut self, input: ::std::option::Option<crate::model::Option>) -> Self {
          98  +
            self.option = input;
          99  +
            self
         100  +
        }
         101  +
        #[allow(missing_docs)] // documentation missing in model
         102  +
        pub(crate) fn set_option(
         103  +
            mut self,
         104  +
            input: Option<impl ::std::convert::Into<crate::model::Option>>,
         105  +
        ) -> Self {
         106  +
            self.option = input.map(|v| v.into());
         107  +
            self
         108  +
        }
         109  +
        #[allow(missing_docs)] // documentation missing in model
         110  +
        pub fn option_list(
         111  +
            mut self,
         112  +
            input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
         113  +
        ) -> Self {
         114  +
            self.option_list = input;
         115  +
            self
         116  +
        }
         117  +
        #[allow(missing_docs)] // documentation missing in model
         118  +
        pub(crate) fn set_option_list(
         119  +
            mut self,
         120  +
            input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
         121  +
        ) -> Self {
         122  +
            self.option_list = input.map(|v| v.into());
         123  +
            self
         124  +
        }
         125  +
        #[allow(missing_docs)] // documentation missing in model
         126  +
        pub fn something_else(
         127  +
            mut self,
         128  +
            input: ::std::option::Option<crate::model::SomethingElse>,
         129  +
        ) -> Self {
         130  +
            self.something_else = input;
         131  +
            self
         132  +
        }
         133  +
        #[allow(missing_docs)] // documentation missing in model
         134  +
        pub(crate) fn set_something_else(
         135  +
            mut self,
         136  +
            input: Option<impl ::std::convert::Into<crate::model::SomethingElse>>,
         137  +
        ) -> Self {
         138  +
            self.something_else = input.map(|v| v.into());
         139  +
            self
         140  +
        }
         141  +
        /// Consumes the builder and constructs a [`StructsInput`](crate::input::StructsInput).
         142  +
        pub fn build(self) -> crate::input::StructsInput {
         143  +
            self.build_enforcing_all_constraints()
         144  +
        }
         145  +
        fn build_enforcing_all_constraints(self) -> crate::input::StructsInput {
         146  +
            crate::input::StructsInput {
         147  +
                result: self.result,
         148  +
                result_list: self.result_list,
         149  +
                option: self.option,
         150  +
                option_list: self.option_list,
         151  +
                something_else: self.something_else,
         152  +
            }
         153  +
        }
         154  +
    }
         155  +
}