Server Test

Server Test

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb

Files changed:

tmp-codegen-diff/codegen-server-test/misc-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/misc-http0x/rust-server-codegen/src/unconstrained.rs

@@ -0,1 +0,22 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
pub(crate) mod header_set_unconstrained {
           4  +
           5  +
    #[derive(Debug, Clone)]
           6  +
    pub(crate) struct HeaderSetUnconstrained(pub(crate) std::vec::Vec<::std::string::String>);
           7  +
           8  +
    impl From<HeaderSetUnconstrained>
           9  +
        for crate::constrained::MaybeConstrained<crate::model::HeaderSet>
          10  +
    {
          11  +
        fn from(value: HeaderSetUnconstrained) -> Self {
          12  +
            Self::Unconstrained(value)
          13  +
        }
          14  +
    }
          15  +
    impl std::convert::TryFrom<HeaderSetUnconstrained> for crate::model::HeaderSet {
          16  +
        type Error = crate::model::header_set::ConstraintViolation;
          17  +
        fn try_from(value: HeaderSetUnconstrained) -> std::result::Result<Self, Self::Error> {
          18  +
            let inner = value.0;
          19  +
            Self::try_from(inner)
          20  +
        }
          21  +
    }
          22  +
}

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

@@ -1,1 +54,57 @@
   10     10   
codegen-version = "ci"
   11     11   
protocol = "aws.protocols#restJson1"
   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"
   38     41   
[dev-dependencies.hyper]
   39         -
version = "0.14.12"
          42  +
version = "1"
   40     43   
[dev-dependencies.pretty_assertions]
   41     44   
version = "1.3.0"
   42     45   
[dev-dependencies.tokio]
   43     46   
version = "1.23.1"
   44     47   
features = ["macros", "test-util", "rt-multi-thread"]
   45     48   
[dev-dependencies.tracing-test]
   46     49   
version = "0.2.5"
   47     50   
features = ["no-env-filter"]
   48     51   
[features]
   49     52   
rt-tokio = ["aws-smithy-types/rt-tokio"]

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

@@ -21,21 +130,133 @@
   41     41   
)]
   42     42   
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
   43     43   
//! modules provide the types used in each operation.
   44     44   
//!
   45     45   
//! ### Running on Hyper
   46     46   
//!
   47     47   
//! ```rust,no_run
   48     48   
//! # use std::net::SocketAddr;
   49     49   
//! # async fn dummy() {
   50     50   
//! use misc::{MiscService, MiscServiceConfig};
          51  +
//! use misc::serve;
          52  +
//! use ::tokio::net::TcpListener;
   51     53   
//!
   52     54   
//! # let app = MiscService::builder(
   53     55   
//! #     MiscServiceConfig::builder()
   54     56   
//! #         .build()
   55     57   
//! # ).build_unchecked();
   56         -
//! let server = app.into_make_service();
   57     58   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   58     59   
//!     .expect("unable to parse the server bind address and port");
   59         -
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          60  +
//! let listener = TcpListener::bind(bind).await
          61  +
//!     .expect("failed to bind TCP listener");
          62  +
//! serve(listener, app.into_make_service()).await.unwrap();
   60     63   
//! # }
   61     64   
//! ```
   62     65   
//!
   63     66   
//! ### Running on Lambda
   64     67   
//!
   65     68   
//! ```rust,ignore
   66     69   
//! use misc::server::routing::LambdaHandler;
   67     70   
//! use misc::MiscService;
   68     71   
//!
   69     72   
//! # async fn dummy() {
   70     73   
//! # let app = MiscService::builder(
   71     74   
//! #     MiscServiceConfig::builder()
   72     75   
//! #         .build()
   73     76   
//! # ).build_unchecked();
   74     77   
//! let handler = LambdaHandler::new(app);
   75     78   
//! lambda_http::run(handler).await.unwrap();
   76     79   
//! # }
   77     80   
//! ```
   78     81   
//!
   79     82   
//! # Building the MiscService
   80     83   
//!
   81     84   
//! To construct [`MiscService`] we use [`MiscServiceBuilder`] returned by [`MiscService::builder`].
   82     85   
//!
   83     86   
//! ## Plugins
   84     87   
//!
   85     88   
//! The [`MiscService::builder`] method, returning [`MiscServiceBuilder`],
   86     89   
//! accepts a config object on which plugins can be registered.
   87     90   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
   88     91   
//!
   89     92   
//! ```rust,no_run
   90     93   
//! # use misc::server::plugin::IdentityPlugin as LoggingPlugin;
   91     94   
//! # use misc::server::plugin::IdentityPlugin as MetricsPlugin;
   92         -
//! # use ::hyper::Body;
          95  +
//! # use ::hyper::body::Incoming;
   93     96   
//! use misc::server::plugin::HttpPlugins;
   94     97   
//! use misc::{MiscService, MiscServiceConfig, MiscServiceBuilder};
   95     98   
//!
   96     99   
//! let http_plugins = HttpPlugins::new()
   97    100   
//!         .push(LoggingPlugin)
   98    101   
//!         .push(MetricsPlugin);
   99    102   
//! let config = MiscServiceConfig::builder().build();
  100         -
//! let builder: MiscServiceBuilder<Body, _, _, _> = MiscService::builder(config);
         103  +
//! let builder: MiscServiceBuilder<::hyper::body::Incoming, _, _, _> = MiscService::builder(config);
  101    104   
//! ```
  102    105   
//!
  103    106   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  104    107   
//!
  105    108   
//! ## Handlers
  106    109   
//!
  107    110   
//! [`MiscServiceBuilder`] 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.
  108    111   
//! We call these async functions **handlers**. This is where your application business logic lives.
  109    112   
//!
  110    113   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -137,140 +255,262 @@
  157    160   
//! [`MiscServiceBuilder::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.
  158    161   
//!
  159    162   
//! [`MiscServiceBuilder::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.
  160    163   
//! [`MiscServiceBuilder::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!).
  161    164   
//!
  162    165   
//! # Example
  163    166   
//!
  164    167   
//! ```rust,no_run
  165    168   
//! # use std::net::SocketAddr;
  166    169   
//! use misc::{MiscService, MiscServiceConfig};
         170  +
//! use misc::serve;
         171  +
//! use ::tokio::net::TcpListener;
  167    172   
//!
  168    173   
//! #[::tokio::main]
  169    174   
//! pub async fn main() {
  170    175   
//!    let config = MiscServiceConfig::builder().build();
  171    176   
//!    let app = MiscService::builder(config)
  172    177   
//!        .required_header_collection_operation(required_header_collection_operation)
  173    178   
//!        .required_inner_shape_operation(required_inner_shape_operation)
  174    179   
//!        .response_code_default_operation(response_code_default_operation)
  175    180   
//!        .response_code_http_fallback_operation(response_code_http_fallback_operation)
  176    181   
//!        .response_code_required_operation(response_code_required_operation)
  177    182   
//!        .type_complexity_operation(type_complexity_operation)
  178    183   
//!        .build()
  179    184   
//!        .expect("failed to build an instance of MiscService");
  180    185   
//!
  181    186   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  182    187   
//!        .expect("unable to parse the server bind address and port");
  183         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         188  +
//!    let listener = TcpListener::bind(bind).await
         189  +
//!        .expect("failed to bind TCP listener");
  184    190   
//!    # let server = async { Ok::<_, ()>(()) };
  185    191   
//!
  186    192   
//!    // Run your service!
  187         -
//!    if let Err(err) = server.await {
         193  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  188    194   
//!        eprintln!("server error: {:?}", err);
  189    195   
//!    }
  190    196   
//! }
  191    197   
//!
  192    198   
//! use misc::{input, output, error};
  193    199   
//!
  194    200   
//! async fn required_header_collection_operation(input: input::RequiredHeaderCollectionOperationInput) -> Result<output::RequiredHeaderCollectionOperationOutput, error::RequiredHeaderCollectionOperationError> {
  195    201   
//!     todo!()
  196    202   
//! }
  197    203   
//!
  198    204   
//! async fn required_inner_shape_operation(input: input::RequiredInnerShapeOperationInput) -> Result<output::RequiredInnerShapeOperationOutput, error::RequiredInnerShapeOperationError> {
  199    205   
//!     todo!()
  200    206   
//! }
  201    207   
//!
  202    208   
//! async fn response_code_default_operation(input: input::ResponseCodeDefaultOperationInput) -> output::ResponseCodeDefaultOperationOutput {
  203    209   
//!     todo!()
  204    210   
//! }
  205    211   
//!
  206    212   
//! async fn response_code_http_fallback_operation(input: input::ResponseCodeHttpFallbackOperationInput) -> output::ResponseCodeHttpFallbackOperationOutput {
  207    213   
//!     todo!()
  208    214   
//! }
  209    215   
//!
  210    216   
//! async fn response_code_required_operation(input: input::ResponseCodeRequiredOperationInput) -> output::ResponseCodeRequiredOperationOutput {
  211    217   
//!     todo!()
  212    218   
//! }
  213    219   
//!
  214    220   
//! async fn type_complexity_operation(input: input::TypeComplexityOperationInput) -> output::TypeComplexityOperationOutput {
  215    221   
//!     todo!()
  216    222   
//! }
  217    223   
//!
  218    224   
//! ```
  219    225   
//!
  220         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         226  +
//! [`serve`]: crate::serve
         227  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  221    228   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  222    229   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  223    230   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  224         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  225    231   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         232  +
pub use crate::server::serve::serve;
  226    233   
pub use crate::service::{
  227    234   
    MiscService, MiscServiceBuilder, MiscServiceConfig, MiscServiceConfigBuilder,
  228    235   
    MissingOperationsError,
  229    236   
};
  230    237   
  231    238   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  232    239   
pub mod server {
  233    240   
    // Re-export all types from the `aws-smithy-http-server` crate.
  234    241   
    pub use ::aws_smithy_http_server::*;
  235    242   
}

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

@@ -11,11 +375,375 @@
   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::rest_json_1::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::rest_json_1::runtime_error::RuntimeError;
   39     39   
    type Future = ResponseCodeDefaultOperationInputFuture;
   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_JSON,
   46     46   
            ) {
   47     47   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   48     48   
            }
   49     49   
            crate::protocol_serde::shape_response_code_default_operation::de_response_code_default_operation_http_request(request)
   50     50   
                            .await
   51     51   
        };
   52     52   
        use ::futures_util::future::TryFutureExt;
   53     53   
        let fut = fut.map_err(
   54     54   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   55     55   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   56     56   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   57     57   
                    e,
   58     58   
                )
   59     59   
            },
   60     60   
        );
   61     61   
        ResponseCodeDefaultOperationInputFuture {
   62     62   
            inner: Box::pin(fut),
   63     63   
        }
   64     64   
    }
   65     65   
}
   66     66   
impl
   67     67   
    ::aws_smithy_http_server::response::IntoResponse<
   68     68   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   69     69   
    > for crate::output::ResponseCodeDefaultOperationOutput
   70     70   
{
   71     71   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   72     72   
        match crate::protocol_serde::shape_response_code_default_operation::ser_response_code_default_operation_http_response(self) {
   73     73   
                        Ok(response) => response,
   74     74   
                        Err(e) => {
   75     75   
                            ::tracing::error!(error = %e, "failed to serialize response");
   76     76   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
   77     77   
                        }
   78     78   
                    }
   79     79   
    }
   80     80   
}
   81     81   
   82     82   
#[allow(unreachable_code, unused_variables)]
   83     83   
#[cfg(test)]
   84     84   
mod response_code_default_operation_test {
   85     85   
   86     86   
    /// Test ID: ResponseCodeDefaultOperation
   87     87   
    #[::tokio::test]
   88     88   
    #[::tracing_test::traced_test]
   89     89   
    async fn response_code_default_operation_response() {
   90     90   
        let output = crate::output::ResponseCodeDefaultOperationOutput {};
   91     91   
        use ::aws_smithy_http_server::response::IntoResponse;
   92     92   
        let http_response = output.into_response();
   93     93   
        ::pretty_assertions::assert_eq!(
   94         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
          94  +
            ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
   95     95   
            http_response.status()
   96     96   
        );
   97     97   
    }
   98     98   
}
   99     99   
  100    100   
::pin_project_lite::pin_project! {
  101    101   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  102    102   
    /// [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput) using modelled bindings.
  103    103   
    pub struct ResponseCodeHttpFallbackOperationInputFuture {
  104    104   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeHttpFallbackOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  105    105   
    }
  106    106   
}
  107    107   
  108    108   
impl std::future::Future for ResponseCodeHttpFallbackOperationInputFuture {
  109    109   
    type Output = Result<
  110    110   
        crate::input::ResponseCodeHttpFallbackOperationInput,
  111    111   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  112    112   
    >;
  113    113   
  114    114   
    fn poll(
  115    115   
        self: std::pin::Pin<&mut Self>,
  116    116   
        cx: &mut std::task::Context<'_>,
  117    117   
    ) -> std::task::Poll<Self::Output> {
  118    118   
        let this = self.project();
  119    119   
        this.inner.as_mut().poll(cx)
  120    120   
    }
  121    121   
}
  122    122   
  123    123   
impl<B>
  124    124   
    ::aws_smithy_http_server::request::FromRequest<
  125    125   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  126    126   
        B,
  127    127   
    > for crate::input::ResponseCodeHttpFallbackOperationInput
  128    128   
where
  129    129   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  130    130   
    B: 'static,
  131    131   
  132    132   
    B::Data: Send,
  133    133   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  134    134   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  135    135   
{
  136    136   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  137    137   
    type Future = ResponseCodeHttpFallbackOperationInputFuture;
  138    138   
  139         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         139  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  140    140   
        let fut = async move {
  141    141   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  142    142   
                request.headers(),
  143    143   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  144    144   
            ) {
  145    145   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  146    146   
            }
  147    147   
            crate::protocol_serde::shape_response_code_http_fallback_operation::de_response_code_http_fallback_operation_http_request(request)
  148    148   
                            .await
  149    149   
        };
  150    150   
        use ::futures_util::future::TryFutureExt;
  151    151   
        let fut = fut.map_err(
  152    152   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  153    153   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  154    154   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  155    155   
                    e,
  156    156   
                )
  157    157   
            },
  158    158   
        );
  159    159   
        ResponseCodeHttpFallbackOperationInputFuture {
  160    160   
            inner: Box::pin(fut),
  161    161   
        }
  162    162   
    }
  163    163   
}
  164    164   
impl
  165    165   
    ::aws_smithy_http_server::response::IntoResponse<
  166    166   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  167    167   
    > for crate::output::ResponseCodeHttpFallbackOperationOutput
  168    168   
{
  169    169   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  170    170   
        match crate::protocol_serde::shape_response_code_http_fallback_operation::ser_response_code_http_fallback_operation_http_response(self) {
  171    171   
                        Ok(response) => response,
  172    172   
                        Err(e) => {
  173    173   
                            ::tracing::error!(error = %e, "failed to serialize response");
  174    174   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  175    175   
                        }
  176    176   
                    }
  177    177   
    }
  178    178   
}
  179    179   
  180    180   
#[allow(unreachable_code, unused_variables)]
  181    181   
#[cfg(test)]
  182    182   
mod response_code_http_fallback_operation_test {
  183    183   
  184    184   
    /// Test ID: ResponseCodeHttpFallbackOperation
  185    185   
    #[::tokio::test]
  186    186   
    #[::tracing_test::traced_test]
  187    187   
    async fn response_code_http_fallback_operation_response() {
  188    188   
        let output = crate::output::ResponseCodeHttpFallbackOperationOutput {};
  189    189   
        use ::aws_smithy_http_server::response::IntoResponse;
  190    190   
        let http_response = output.into_response();
  191    191   
        ::pretty_assertions::assert_eq!(
  192         -
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
         192  +
            ::http_1x::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
  193    193   
            http_response.status()
  194    194   
        );
  195    195   
        let expected_headers = [("Content-Length", "2")];
  196    196   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  197    197   
            http_response.headers(),
  198    198   
            expected_headers,
  199    199   
        ));
  200    200   
    }
  201    201   
}
  202    202   
  203    203   
::pin_project_lite::pin_project! {
  204    204   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  205    205   
    /// [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput) using modelled bindings.
  206    206   
    pub struct ResponseCodeRequiredOperationInputFuture {
  207    207   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeRequiredOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  208    208   
    }
  209    209   
}
  210    210   
  211    211   
impl std::future::Future for ResponseCodeRequiredOperationInputFuture {
  212    212   
    type Output = Result<
  213    213   
        crate::input::ResponseCodeRequiredOperationInput,
  214    214   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  215    215   
    >;
  216    216   
  217    217   
    fn poll(
  218    218   
        self: std::pin::Pin<&mut Self>,
  219    219   
        cx: &mut std::task::Context<'_>,
  220    220   
    ) -> std::task::Poll<Self::Output> {
  221    221   
        let this = self.project();
  222    222   
        this.inner.as_mut().poll(cx)
  223    223   
    }
  224    224   
}
  225    225   
  226    226   
impl<B>
  227    227   
    ::aws_smithy_http_server::request::FromRequest<
  228    228   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  229    229   
        B,
  230    230   
    > for crate::input::ResponseCodeRequiredOperationInput
  231    231   
where
  232    232   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  233    233   
    B: 'static,
  234    234   
  235    235   
    B::Data: Send,
  236    236   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  237    237   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  238    238   
{
  239    239   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  240    240   
    type Future = ResponseCodeRequiredOperationInputFuture;
  241    241   
  242         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         242  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  243    243   
        let fut = async move {
  244    244   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  245    245   
                request.headers(),
  246    246   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  247    247   
            ) {
  248    248   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  249    249   
            }
  250    250   
            crate::protocol_serde::shape_response_code_required_operation::de_response_code_required_operation_http_request(request)
  251    251   
                            .await
  252    252   
        };
  253    253   
        use ::futures_util::future::TryFutureExt;
  254    254   
        let fut = fut.map_err(
  255    255   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  256    256   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  257    257   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  258    258   
                    e,
  259    259   
                )
  260    260   
            },
  261    261   
        );
  262    262   
        ResponseCodeRequiredOperationInputFuture {
  263    263   
            inner: Box::pin(fut),
  264    264   
        }
  265    265   
    }
  266    266   
}
  267    267   
impl
  268    268   
    ::aws_smithy_http_server::response::IntoResponse<
  269    269   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  270    270   
    > for crate::output::ResponseCodeRequiredOperationOutput
  271    271   
{
  272    272   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  273    273   
        match crate::protocol_serde::shape_response_code_required_operation::ser_response_code_required_operation_http_response(self) {
  274    274   
                        Ok(response) => response,
  275    275   
                        Err(e) => {
  276    276   
                            ::tracing::error!(error = %e, "failed to serialize response");
  277    277   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  278    278   
                        }
  279    279   
                    }
  280    280   
    }
  281    281   
}
  282    282   
  283    283   
#[allow(unreachable_code, unused_variables)]
  284    284   
#[cfg(test)]
  285    285   
mod response_code_required_operation_test {
  286    286   
  287    287   
    /// Test ID: ResponseCodeRequiredOperation
  288    288   
    #[::tokio::test]
  289    289   
    #[::tracing_test::traced_test]
  290    290   
    async fn response_code_required_operation_response() {
  291    291   
        let output = crate::output::ResponseCodeRequiredOperationOutput { response_code: 201 };
  292    292   
        use ::aws_smithy_http_server::response::IntoResponse;
  293    293   
        let http_response = output.into_response();
  294    294   
        ::pretty_assertions::assert_eq!(
  295         -
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
         295  +
            ::http_1x::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
  296    296   
            http_response.status()
  297    297   
        );
  298    298   
        let expected_headers = [("Content-Length", "2")];
  299    299   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  300    300   
            http_response.headers(),
  301    301   
            expected_headers,
  302    302   
        ));
  303    303   
    }
  304    304   
}
  305    305   
  306    306   
::pin_project_lite::pin_project! {
  307    307   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  308    308   
    /// [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput) using modelled bindings.
  309    309   
    pub struct RequiredHeaderCollectionOperationInputFuture {
  310    310   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredHeaderCollectionOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  311    311   
    }
  312    312   
}
  313    313   
  314    314   
impl std::future::Future for RequiredHeaderCollectionOperationInputFuture {
  315    315   
    type Output = Result<
  316    316   
        crate::input::RequiredHeaderCollectionOperationInput,
  317    317   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  318    318   
    >;
  319    319   
  320    320   
    fn poll(
  321    321   
        self: std::pin::Pin<&mut Self>,
  322    322   
        cx: &mut std::task::Context<'_>,
  323    323   
    ) -> std::task::Poll<Self::Output> {
  324    324   
        let this = self.project();
  325    325   
        this.inner.as_mut().poll(cx)
  326    326   
    }
  327    327   
}
  328    328   
  329    329   
impl<B>
  330    330   
    ::aws_smithy_http_server::request::FromRequest<
  331    331   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  332    332   
        B,
  333    333   
    > for crate::input::RequiredHeaderCollectionOperationInput
  334    334   
where
  335    335   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  336    336   
    B: 'static,
  337    337   
  338    338   
    B::Data: Send,
  339    339   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  340    340   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  341    341   
{
  342    342   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  343    343   
    type Future = RequiredHeaderCollectionOperationInputFuture;
  344    344   
  345         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         345  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  346    346   
        let fut = async move {
  347    347   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  348    348   
                request.headers(),
  349    349   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  350    350   
            ) {
  351    351   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  352    352   
            }
  353    353   
            crate::protocol_serde::shape_required_header_collection_operation::de_required_header_collection_operation_http_request(request)
  354    354   
                            .await
  355    355   
        };
@@ -413,413 +473,473 @@
  433    433   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  434    434   
    B: 'static,
  435    435   
  436    436   
    B::Data: Send,
  437    437   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  438    438   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  439    439   
{
  440    440   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  441    441   
    type Future = RequiredInnerShapeOperationInputFuture;
  442    442   
  443         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         443  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  444    444   
        let fut = async move {
  445    445   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  446    446   
                request.headers(),
  447    447   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  448    448   
            ) {
  449    449   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  450    450   
            }
  451    451   
            crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation_http_request(request)
  452    452   
                            .await
  453    453   
        };
@@ -511,511 +571,571 @@
  531    531   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  532    532   
    B: 'static,
  533    533   
  534    534   
    B::Data: Send,
  535    535   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  536    536   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  537    537   
{
  538    538   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  539    539   
    type Future = TypeComplexityOperationInputFuture;
  540    540   
  541         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         541  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  542    542   
        let fut = async move {
  543    543   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  544    544   
                request.headers(),
  545    545   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  546    546   
            ) {
  547    547   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  548    548   
            }
  549    549   
            crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation_http_request(request)
  550    550   
                            .await
  551    551   
        };

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_required_header_collection_operation.rs

@@ -1,1 +140,142 @@
    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_required_header_collection_operation_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::RequiredHeaderCollectionOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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 =
   18     18   
            crate::input::required_header_collection_operation_input::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) = crate::protocol_serde::shape_required_header_collection_operation_input::de_required_header_list_header(&headers)? {
   24     24   
                                input = input.set_required_header_list(value)
   25     25   
                            }
   26     26   
        if let Some(value) = crate::protocol_serde::shape_required_header_collection_operation_input::de_required_header_set_header(&headers)? {
   27     27   
                                input = input.set_required_header_set(value)
   28     28   
                            }
   29     29   
        input.build()?
   30     30   
    })
   31     31   
}
   32     32   
   33     33   
#[allow(clippy::unnecessary_wraps)]
   34     34   
pub fn ser_required_header_collection_operation_http_response(
   35     35   
    #[allow(unused_variables)] output: crate::output::RequiredHeaderCollectionOperationOutput,
   36     36   
) -> std::result::Result<
   37     37   
    ::aws_smithy_http_server::response::Response,
   38     38   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   39     39   
> {
   40     40   
    Ok({
   41     41   
        #[allow(unused_mut)]
   42         -
        let mut builder = ::http::Response::builder();
          42  +
        let mut builder = ::http_1x::Response::builder();
   43     43   
        builder = crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_headers(&output, builder)?;
   44     44   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     45   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          46  +
            ::http_1x::header::CONTENT_TYPE,
   47     47   
            "application/json",
   48     48   
        );
   49     49   
        let http_status: u16 = 200;
   50     50   
        builder = builder.status(http_status);
   51     51   
        let payload =
   52     52   
            crate::protocol_serde::shape_required_header_collection_operation_output::ser_required_header_collection_operation_output_output_output(&output)?
   53     53   
        ;
   54     54   
        let content_length = payload.len();
   55     55   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     56   
            builder,
   57         -
            ::http::header::CONTENT_LENGTH,
          57  +
            ::http_1x::header::CONTENT_LENGTH,
   58     58   
            content_length,
   59     59   
        );
   60     60   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   61     61   
        builder.body(body)?
   62     62   
    })
   63     63   
}
   64     64   
   65     65   
#[allow(clippy::unnecessary_wraps)]
   66     66   
pub fn ser_required_header_collection_operation_http_error(
   67     67   
    error: &crate::error::RequiredHeaderCollectionOperationError,
   68     68   
) -> std::result::Result<
   69     69   
    ::aws_smithy_http_server::response::Response,
   70     70   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71     71   
> {
   72     72   
    Ok({
   73     73   
        match error {
   74     74   
            crate::error::RequiredHeaderCollectionOperationError::ValidationException(output) => {
   75     75   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   76     76   
                #[allow(unused_mut)]
   77         -
                let mut builder = ::http::Response::builder();
          77  +
                let mut builder = ::http_1x::Response::builder();
   78     78   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79     79   
                    builder,
   80         -
                    ::http::header::CONTENT_TYPE,
          80  +
                    ::http_1x::header::CONTENT_TYPE,
   81     81   
                    "application/json",
   82     82   
                );
   83     83   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          85  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   86     86   
                    "ValidationException",
   87     87   
                );
   88     88   
                let content_length = payload.len();
   89     89   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90     90   
                    builder,
   91         -
                    ::http::header::CONTENT_LENGTH,
          91  +
                    ::http_1x::header::CONTENT_LENGTH,
   92     92   
                    content_length,
   93     93   
                );
   94     94   
                builder
   95     95   
                    .status(400)
   96     96   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   97     97   
            }
   98     98   
        }
   99     99   
    })
  100    100   
}
  101    101   
  102    102   
pub fn ser_required_header_collection_operation_headers(
  103    103   
    input: &crate::output::RequiredHeaderCollectionOperationOutput,
  104         -
    mut builder: ::http::response::Builder,
  105         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  106         -
{
         104  +
    mut builder: ::http_1x::response::Builder,
         105  +
) -> std::result::Result<
         106  +
    ::http_1x::response::Builder,
         107  +
    ::aws_smithy_types::error::operation::BuildError,
         108  +
> {
  107    109   
    for inner_1 in &input.required_header_list {
  108    110   
        let formatted_2 = ::aws_smithy_http::header::quote_header_value(inner_1.as_str());
  109    111   
        if !formatted_2.is_empty() {
  110    112   
            let header_value = formatted_2;
  111         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         113  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  112    114   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  113    115   
                    "required_header_list",
  114    116   
                    format!(
  115    117   
                        "`{}` cannot be used as a header value: {}",
  116    118   
                        &header_value, err
  117    119   
                    ),
  118    120   
                )
  119    121   
            })?;
  120    122   
            builder = builder.header("X-Required-List", header_value);
  121    123   
        }
  122    124   
    }
  123    125   
    for inner_3 in &input.required_header_set.0 {
  124    126   
        let formatted_4 = ::aws_smithy_http::header::quote_header_value(inner_3.as_str());
  125    127   
        if !formatted_4.is_empty() {
  126    128   
            let header_value = formatted_4;
  127         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         129  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  128    130   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  129    131   
                    "required_header_set",
  130    132   
                    format!(
  131    133   
                        "`{}` cannot be used as a header value: {}",
  132    134   
                        &header_value, err
  133    135   
                    ),
  134    136   
                )
  135    137   
            })?;
  136    138   
            builder = builder.header("X-Required-Set", header_value);
  137    139   
        }

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_required_inner_shape_operation.rs

@@ -1,1 +121,124 @@
    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_required_inner_shape_operation_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::RequiredInnerShapeOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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::required_inner_shape_operation_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/json"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation(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_required_inner_shape_operation_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::RequiredInnerShapeOperationOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::rest_json_1::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/json",
   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_required_inner_shape_operation_output::ser_required_inner_shape_operation_output_output_output(&output)?
   53     56   
        ;
   54     57   
        let content_length = payload.len();
   55     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     59   
            builder,
   57         -
            ::http::header::CONTENT_LENGTH,
          60  +
            ::http_1x::header::CONTENT_LENGTH,
   58     61   
            content_length,
   59     62   
        );
   60     63   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   61     64   
        builder.body(body)?
   62     65   
    })
   63     66   
}
   64     67   
   65     68   
#[allow(clippy::unnecessary_wraps)]
   66     69   
pub fn ser_required_inner_shape_operation_http_error(
   67     70   
    error: &crate::error::RequiredInnerShapeOperationError,
   68     71   
) -> std::result::Result<
   69     72   
    ::aws_smithy_http_server::response::Response,
   70     73   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71     74   
> {
   72     75   
    Ok({
   73     76   
        match error {
   74     77   
            crate::error::RequiredInnerShapeOperationError::ValidationException(output) => {
   75     78   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   76     79   
                #[allow(unused_mut)]
   77         -
                let mut builder = ::http::Response::builder();
          80  +
                let mut builder = ::http_1x::Response::builder();
   78     81   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79     82   
                    builder,
   80         -
                    ::http::header::CONTENT_TYPE,
          83  +
                    ::http_1x::header::CONTENT_TYPE,
   81     84   
                    "application/json",
   82     85   
                );
   83     86   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84     87   
                    builder,
   85         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          88  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   86     89   
                    "ValidationException",
   87     90   
                );
   88     91   
                let content_length = payload.len();
   89     92   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90     93   
                    builder,
   91         -
                    ::http::header::CONTENT_LENGTH,
          94  +
                    ::http_1x::header::CONTENT_LENGTH,
   92     95   
                    content_length,
   93     96   
                );
   94     97   
                builder
   95     98   
                    .status(400)
   96     99   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   97    100   
            }
   98    101   
        }
   99    102   
    })
  100    103   
}
  101    104   

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_default_operation.rs

@@ -1,1 +55,55 @@
    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_response_code_default_operation_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::ResponseCodeDefaultOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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::response_code_default_operation_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_response_code_default_operation_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::ResponseCodeDefaultOperationOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::rest_json_1::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/json",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload =
   44     44   
            crate::protocol_serde::shape_response_code_default_operation_output::ser_response_code_default_operation_output_output_output(&output)?
   45     45   
        ;
   46     46   
        let content_length = payload.len();
   47     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49         -
            ::http::header::CONTENT_LENGTH,
          49  +
            ::http_1x::header::CONTENT_LENGTH,
   50     50   
            content_length,
   51     51   
        );
   52     52   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   53     53   
        builder.body(body)?
   54     54   
    })
   55     55   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_http_fallback_operation.rs

@@ -1,1 +56,56 @@
    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_response_code_http_fallback_operation_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::ResponseCodeHttpFallbackOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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 =
   18     18   
            crate::input::response_code_http_fallback_operation_input::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_response_code_http_fallback_operation_http_response(
   29     29   
    #[allow(unused_variables)] output: crate::output::ResponseCodeHttpFallbackOperationOutput,
   30     30   
) -> std::result::Result<
   31     31   
    ::aws_smithy_http_server::response::Response,
   32     32   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     33   
> {
   34     34   
    Ok({
   35     35   
        #[allow(unused_mut)]
   36         -
        let mut builder = ::http::Response::builder();
          36  +
        let mut builder = ::http_1x::Response::builder();
   37     37   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     38   
            builder,
   39         -
            ::http::header::CONTENT_TYPE,
          39  +
            ::http_1x::header::CONTENT_TYPE,
   40     40   
            "application/json",
   41     41   
        );
   42     42   
        let http_status: u16 = 201;
   43     43   
        builder = builder.status(http_status);
   44     44   
        let payload =
   45     45   
            crate::protocol_serde::shape_response_code_http_fallback_operation_output::ser_response_code_http_fallback_operation_output_output_output(&output)?
   46     46   
        ;
   47     47   
        let content_length = payload.len();
   48     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50         -
            ::http::header::CONTENT_LENGTH,
          50  +
            ::http_1x::header::CONTENT_LENGTH,
   51     51   
            content_length,
   52     52   
        );
   53     53   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   54     54   
        builder.body(body)?
   55     55   
    })
   56     56   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_response_code_required_operation.rs

@@ -1,1 +56,56 @@
    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_response_code_required_operation_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::ResponseCodeRequiredOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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::response_code_required_operation_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_response_code_required_operation_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::ResponseCodeRequiredOperationOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::rest_json_1::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/json",
   40     40   
        );
   41     41   
        let status = output.response_code;
   42     42   
        let http_status: u16 = status.try_into().map_err(::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
   43     43   
        builder = builder.status(http_status);
   44     44   
        let payload =
   45     45   
            crate::protocol_serde::shape_response_code_required_operation_output::ser_response_code_required_operation_output_output_output(&output)?
   46     46   
        ;
   47     47   
        let content_length = payload.len();
   48     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50         -
            ::http::header::CONTENT_LENGTH,
          50  +
            ::http_1x::header::CONTENT_LENGTH,
   51     51   
            content_length,
   52     52   
        );
   53     53   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   54     54   
        builder.body(body)?
   55     55   
    })
   56     56   
}

tmp-codegen-diff/codegen-server-test/misc/rust-server-codegen/src/protocol_serde/shape_type_complexity_operation.rs

@@ -1,1 +87,90 @@
    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_type_complexity_operation_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::TypeComplexityOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::rest_json_1::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::rest_json_1::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::type_complexity_operation_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/json"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_type_complexity_operation::de_type_complexity_operation(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_type_complexity_operation_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::TypeComplexityOperationOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::rest_json_1::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/json",
   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_type_complexity_operation_output::ser_type_complexity_operation_output_output_output(&output)?
   53     56   
        ;
   54     57   
        let content_length = payload.len();
   55     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     59   
            builder,
   57         -
            ::http::header::CONTENT_LENGTH,
          60  +
            ::http_1x::header::CONTENT_LENGTH,
   58     61   
            content_length,
   59     62   
        );
   60     63   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   61     64   
        builder.body(body)?
   62     65   
    })
   63     66   
}
   64     67   
   65     68   
pub(crate) fn de_type_complexity_operation(
   66     69   
    value: &[u8],
   67     70   
    mut builder: crate::input::type_complexity_operation_input::Builder,

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

@@ -40,40 +101,101 @@
   60     60   
                            <
   61     61   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
   62     62   
                                as ::aws_smithy_http_server::plugin::Plugin<
   63     63   
                                    MiscService<L>,
   64     64   
                                    crate::operation_shape::RequiredHeaderCollectionOperation,
   65     65   
                                    ModelPl::Output
   66     66   
                                >
   67     67   
                            >::Output
   68     68   
                        >,
   69     69   
   70         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
   71         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
          70  +
                        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,
          71  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
   72     72   
   73     73   
                    {
   74     74   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
   75     75   
        use ::aws_smithy_http_server::plugin::Plugin;
   76     76   
        let svc = crate::operation_shape::RequiredHeaderCollectionOperation::from_handler(handler);
   77     77   
        let svc = self.model_plugin.apply(svc);
   78     78   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
   79     79   
            .apply(svc);
   80     80   
        let svc = self.http_plugin.apply(svc);
   81     81   
        self.required_header_collection_operation_custom(svc)
@@ -107,107 +187,187 @@
  127    127   
                            <
  128    128   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  129    129   
                                as ::aws_smithy_http_server::plugin::Plugin<
  130    130   
                                    MiscService<L>,
  131    131   
                                    crate::operation_shape::RequiredHeaderCollectionOperation,
  132    132   
                                    ModelPl::Output
  133    133   
                                >
  134    134   
                            >::Output
  135    135   
                        >,
  136    136   
  137         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  138         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         137  +
                        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,
         138  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  139    139   
  140    140   
                    {
  141    141   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  142    142   
        use ::aws_smithy_http_server::plugin::Plugin;
  143    143   
        let svc = crate::operation_shape::RequiredHeaderCollectionOperation::from_service(service);
  144    144   
        let svc = self.model_plugin.apply(svc);
  145    145   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  146    146   
            .apply(svc);
  147    147   
        let svc = self.http_plugin.apply(svc);
  148    148   
        self.required_header_collection_operation_custom(svc)
  149    149   
    }
  150    150   
  151    151   
    /// Sets the [`RequiredHeaderCollectionOperation`](crate::operation_shape::RequiredHeaderCollectionOperation) to a custom [`Service`](tower::Service).
  152    152   
    /// not constrained by the Smithy contract.
  153    153   
    fn required_header_collection_operation_custom<S>(mut self, svc: S) -> Self
  154    154   
    where
  155    155   
        S: ::tower::Service<
  156         -
                ::http::Request<Body>,
  157         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         156  +
                ::http_1x::Request<Body>,
         157  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  158    158   
                Error = ::std::convert::Infallible,
  159    159   
            > + Clone
  160    160   
            + Send
  161    161   
            + 'static,
  162    162   
        S::Future: Send + 'static,
  163    163   
    {
  164    164   
        self.required_header_collection_operation =
  165    165   
            Some(::aws_smithy_http_server::routing::Route::new(svc));
  166    166   
        self
  167    167   
    }
@@ -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   
                                    MiscService<L>,
  215    215   
                                    crate::operation_shape::RequiredInnerShapeOperation,
  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::RequiredInnerShapeOperation::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.required_inner_shape_operation_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   
                                    MiscService<L>,
  282    282   
                                    crate::operation_shape::RequiredInnerShapeOperation,
  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::RequiredInnerShapeOperation::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.required_inner_shape_operation_custom(svc)
  300    300   
    }
  301    301   
  302    302   
    /// Sets the [`RequiredInnerShapeOperation`](crate::operation_shape::RequiredInnerShapeOperation) to a custom [`Service`](tower::Service).
  303    303   
    /// not constrained by the Smithy contract.
  304    304   
    fn required_inner_shape_operation_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.required_inner_shape_operation =
  316    316   
            Some(::aws_smithy_http_server::routing::Route::new(svc));
  317    317   
        self
  318    318   
    }
@@ -342,342 +403,403 @@
  362    362   
                            <
  363    363   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  364    364   
                                as ::aws_smithy_http_server::plugin::Plugin<
  365    365   
                                    MiscService<L>,
  366    366   
                                    crate::operation_shape::ResponseCodeDefaultOperation,
  367    367   
                                    ModelPl::Output
  368    368   
                                >
  369    369   
                            >::Output
  370    370   
                        >,
  371    371   
  372         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  373         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         372  +
                        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,
         373  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  374    374   
  375    375   
                    {
  376    376   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  377    377   
        use ::aws_smithy_http_server::plugin::Plugin;
  378    378   
        let svc = crate::operation_shape::ResponseCodeDefaultOperation::from_handler(handler);
  379    379   
        let svc = self.model_plugin.apply(svc);
  380    380   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  381    381   
            .apply(svc);
  382    382   
        let svc = self.http_plugin.apply(svc);
  383    383   
        self.response_code_default_operation_custom(svc)
@@ -409,409 +489,489 @@
  429    429   
                            <
  430    430   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  431    431   
                                as ::aws_smithy_http_server::plugin::Plugin<
  432    432   
                                    MiscService<L>,
  433    433   
                                    crate::operation_shape::ResponseCodeDefaultOperation,
  434    434   
                                    ModelPl::Output
  435    435   
                                >
  436    436   
                            >::Output
  437    437   
                        >,
  438    438   
  439         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  440         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         439  +
                        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,
         440  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  441    441   
  442    442   
                    {
  443    443   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  444    444   
        use ::aws_smithy_http_server::plugin::Plugin;
  445    445   
        let svc = crate::operation_shape::ResponseCodeDefaultOperation::from_service(service);
  446    446   
        let svc = self.model_plugin.apply(svc);
  447    447   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  448    448   
            .apply(svc);
  449    449   
        let svc = self.http_plugin.apply(svc);
  450    450   
        self.response_code_default_operation_custom(svc)
  451    451   
    }
  452    452   
  453    453   
    /// Sets the [`ResponseCodeDefaultOperation`](crate::operation_shape::ResponseCodeDefaultOperation) to a custom [`Service`](tower::Service).
  454    454   
    /// not constrained by the Smithy contract.
  455    455   
    fn response_code_default_operation_custom<S>(mut self, svc: S) -> Self
  456    456   
    where
  457    457   
        S: ::tower::Service<
  458         -
                ::http::Request<Body>,
  459         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         458  +
                ::http_1x::Request<Body>,
         459  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  460    460   
                Error = ::std::convert::Infallible,
  461    461   
            > + Clone
  462    462   
            + Send
  463    463   
            + 'static,
  464    464   
        S::Future: Send + 'static,
  465    465   
    {
  466    466   
        self.response_code_default_operation =
  467    467   
            Some(::aws_smithy_http_server::routing::Route::new(svc));
  468    468   
        self
  469    469   
    }
@@ -493,493 +554,554 @@
  513    513   
                            <
  514    514   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  515    515   
                                as ::aws_smithy_http_server::plugin::Plugin<
  516    516   
                                    MiscService<L>,
  517    517   
                                    crate::operation_shape::ResponseCodeHttpFallbackOperation,
  518    518   
                                    ModelPl::Output
  519    519   
                                >
  520    520   
                            >::Output
  521    521   
                        >,
  522    522   
  523         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  524         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         523  +
                        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,
         524  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  525    525   
  526    526   
                    {
  527    527   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  528    528   
        use ::aws_smithy_http_server::plugin::Plugin;
  529    529   
        let svc = crate::operation_shape::ResponseCodeHttpFallbackOperation::from_handler(handler);
  530    530   
        let svc = self.model_plugin.apply(svc);
  531    531   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  532    532   
            .apply(svc);
  533    533   
        let svc = self.http_plugin.apply(svc);
  534    534   
        self.response_code_http_fallback_operation_custom(svc)
@@ -560,560 +640,640 @@
  580    580   
                            <
  581    581   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  582    582   
                                as ::aws_smithy_http_server::plugin::Plugin<
  583    583   
                                    MiscService<L>,
  584    584   
                                    crate::operation_shape::ResponseCodeHttpFallbackOperation,
  585    585   
                                    ModelPl::Output
  586    586   
                                >
  587    587   
                            >::Output
  588    588   
                        >,
  589    589   
  590         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  591         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         590  +
                        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,
         591  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  592    592   
  593    593   
                    {
  594    594   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  595    595   
        use ::aws_smithy_http_server::plugin::Plugin;
  596    596   
        let svc = crate::operation_shape::ResponseCodeHttpFallbackOperation::from_service(service);
  597    597   
        let svc = self.model_plugin.apply(svc);
  598    598   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  599    599   
            .apply(svc);
  600    600   
        let svc = self.http_plugin.apply(svc);
  601    601   
        self.response_code_http_fallback_operation_custom(svc)
  602    602   
    }
  603    603   
  604    604   
    /// Sets the [`ResponseCodeHttpFallbackOperation`](crate::operation_shape::ResponseCodeHttpFallbackOperation) to a custom [`Service`](tower::Service).
  605    605   
    /// not constrained by the Smithy contract.
  606    606   
    fn response_code_http_fallback_operation_custom<S>(mut self, svc: S) -> Self
  607    607   
    where
  608    608   
        S: ::tower::Service<
  609         -
                ::http::Request<Body>,
  610         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         609  +
                ::http_1x::Request<Body>,
         610  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  611    611   
                Error = ::std::convert::Infallible,
  612    612   
            > + Clone
  613    613   
            + Send
  614    614   
            + 'static,
  615    615   
        S::Future: Send + 'static,
  616    616   
    {
  617    617   
        self.response_code_http_fallback_operation =
  618    618   
            Some(::aws_smithy_http_server::routing::Route::new(svc));
  619    619   
        self
  620    620   
    }
@@ -644,644 +705,705 @@
  664    664   
                            <
  665    665   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  666    666   
                                as ::aws_smithy_http_server::plugin::Plugin<
  667    667   
                                    MiscService<L>,
  668    668   
                                    crate::operation_shape::ResponseCodeRequiredOperation,
  669    669   
                                    ModelPl::Output
  670    670   
                                >
  671    671   
                            >::Output
  672    672   
                        >,
  673    673   
  674         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  675         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         674  +
                        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,
         675  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  676    676   
  677    677   
                    {
  678    678   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  679    679   
        use ::aws_smithy_http_server::plugin::Plugin;
  680    680   
        let svc = crate::operation_shape::ResponseCodeRequiredOperation::from_handler(handler);
  681    681   
        let svc = self.model_plugin.apply(svc);
  682    682   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  683    683   
            .apply(svc);
  684    684   
        let svc = self.http_plugin.apply(svc);
  685    685   
        self.response_code_required_operation_custom(svc)
@@ -711,711 +791,791 @@
  731    731   
                            <
  732    732   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  733    733   
                                as ::aws_smithy_http_server::plugin::Plugin<
  734    734   
                                    MiscService<L>,
  735    735   
                                    crate::operation_shape::ResponseCodeRequiredOperation,
  736    736   
                                    ModelPl::Output
  737    737   
                                >
  738    738   
                            >::Output
  739    739   
                        >,
  740    740   
  741         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  742         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         741  +
                        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,
         742  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  743    743   
  744    744   
                    {
  745    745   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  746    746   
        use ::aws_smithy_http_server::plugin::Plugin;
  747    747   
        let svc = crate::operation_shape::ResponseCodeRequiredOperation::from_service(service);
  748    748   
        let svc = self.model_plugin.apply(svc);
  749    749   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  750    750   
            .apply(svc);
  751    751   
        let svc = self.http_plugin.apply(svc);
  752    752   
        self.response_code_required_operation_custom(svc)
  753    753   
    }
  754    754   
  755    755   
    /// Sets the [`ResponseCodeRequiredOperation`](crate::operation_shape::ResponseCodeRequiredOperation) to a custom [`Service`](tower::Service).
  756    756   
    /// not constrained by the Smithy contract.
  757    757   
    fn response_code_required_operation_custom<S>(mut self, svc: S) -> Self
  758    758   
    where
  759    759   
        S: ::tower::Service<
  760         -
                ::http::Request<Body>,
  761         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         760  +
                ::http_1x::Request<Body>,
         761  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  762    762   
                Error = ::std::convert::Infallible,
  763    763   
            > + Clone
  764    764   
            + Send
  765    765   
            + 'static,
  766    766   
        S::Future: Send + 'static,
  767    767   
    {
  768    768   
        self.response_code_required_operation =
  769    769   
            Some(::aws_smithy_http_server::routing::Route::new(svc));
  770    770   
        self
  771    771   
    }
@@ -795,795 +856,856 @@
  815    815   
                            <
  816    816   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  817    817   
                                as ::aws_smithy_http_server::plugin::Plugin<
  818    818   
                                    MiscService<L>,
  819    819   
                                    crate::operation_shape::TypeComplexityOperation,
  820    820   
                                    ModelPl::Output
  821    821   
                                >
  822    822   
                            >::Output
  823    823   
                        >,
  824    824   
  825         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  826         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         825  +
                        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,
         826  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  827    827   
  828    828   
                    {
  829    829   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  830    830   
        use ::aws_smithy_http_server::plugin::Plugin;
  831    831   
        let svc = crate::operation_shape::TypeComplexityOperation::from_handler(handler);
  832    832   
        let svc = self.model_plugin.apply(svc);
  833    833   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  834    834   
            .apply(svc);
  835    835   
        let svc = self.http_plugin.apply(svc);
  836    836   
        self.type_complexity_operation_custom(svc)
@@ -862,862 +942,942 @@
  882    882   
                            <
  883    883   
                                ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>
  884    884   
                                as ::aws_smithy_http_server::plugin::Plugin<
  885    885   
                                    MiscService<L>,
  886    886   
                                    crate::operation_shape::TypeComplexityOperation,
  887    887   
                                    ModelPl::Output
  888    888   
                                >
  889    889   
                            >::Output
  890    890   
                        >,
  891    891   
  892         -
                        HttpPl::Output: ::tower::Service<::http::Request<Body>, Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>, Error = ::std::convert::Infallible> + Clone + Send + 'static,
  893         -
                        <HttpPl::Output as ::tower::Service<::http::Request<Body>>>::Future: Send + 'static,
         892  +
                        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,
         893  +
                        <HttpPl::Output as ::tower::Service<::http_1x::Request<Body>>>::Future: Send + 'static,
  894    894   
  895    895   
                    {
  896    896   
        use ::aws_smithy_http_server::operation::OperationShapeExt;
  897    897   
        use ::aws_smithy_http_server::plugin::Plugin;
  898    898   
        let svc = crate::operation_shape::TypeComplexityOperation::from_service(service);
  899    899   
        let svc = self.model_plugin.apply(svc);
  900    900   
        let svc = ::aws_smithy_http_server::operation::UpgradePlugin::<UpgradeExtractors>::new()
  901    901   
            .apply(svc);
  902    902   
        let svc = self.http_plugin.apply(svc);
  903    903   
        self.type_complexity_operation_custom(svc)
  904    904   
    }
  905    905   
  906    906   
    /// Sets the [`TypeComplexityOperation`](crate::operation_shape::TypeComplexityOperation) to a custom [`Service`](tower::Service).
  907    907   
    /// not constrained by the Smithy contract.
  908    908   
    fn type_complexity_operation_custom<S>(mut self, svc: S) -> Self
  909    909   
    where
  910    910   
        S: ::tower::Service<
  911         -
                ::http::Request<Body>,
  912         -
                Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
         911  +
                ::http_1x::Request<Body>,
         912  +
                Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
  913    913   
                Error = ::std::convert::Infallible,
  914    914   
            > + Clone
  915    915   
            + Send
  916    916   
            + 'static,
  917    917   
        S::Future: Send + 'static,
  918    918   
    {
  919    919   
        self.type_complexity_operation = Some(::aws_smithy_http_server::routing::Route::new(svc));
  920    920   
        self
  921    921   
    }
  922    922   
}
@@ -1118,1118 +1253,1253 @@
 1138   1138   
        Ok(())
 1139   1139   
    }
 1140   1140   
}
 1141   1141   
 1142   1142   
impl std::error::Error for MissingOperationsError {}
 1143   1143   
 1144   1144   
mod request_specs {
 1145   1145   
    pub(super) fn required_header_collection_operation(
 1146   1146   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1147   1147   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1148         -
                    ::http::Method::GET,
        1148  +
                    ::http_1x::Method::GET,
 1149   1149   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1150   1150   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1151   1151   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1152   1152   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("required-header-collection-operation")),
 1153   1153   
]),
 1154   1154   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1155   1155   
])
 1156   1156   
                        )
 1157   1157   
                    ),
 1158   1158   
                )
 1159   1159   
    }
 1160   1160   
    pub(super) fn required_inner_shape_operation(
 1161   1161   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1162   1162   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1163         -
                    ::http::Method::POST,
        1163  +
                    ::http_1x::Method::POST,
 1164   1164   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1165   1165   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1166   1166   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1167   1167   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("requiredInnerShapeOperation")),
 1168   1168   
]),
 1169   1169   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1170   1170   
])
 1171   1171   
                        )
 1172   1172   
                    ),
 1173   1173   
                )
 1174   1174   
    }
 1175   1175   
    pub(super) fn response_code_default_operation(
 1176   1176   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1177   1177   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1178         -
                    ::http::Method::GET,
        1178  +
                    ::http_1x::Method::GET,
 1179   1179   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1180   1180   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1181   1181   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1182   1182   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeDefaultOperation")),
 1183   1183   
]),
 1184   1184   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1185   1185   
])
 1186   1186   
                        )
 1187   1187   
                    ),
 1188   1188   
                )
 1189   1189   
    }
 1190   1190   
    pub(super) fn response_code_http_fallback_operation(
 1191   1191   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1192   1192   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1193         -
                    ::http::Method::GET,
        1193  +
                    ::http_1x::Method::GET,
 1194   1194   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1195   1195   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1196   1196   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1197   1197   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeHttpFallbackOperation")),
 1198   1198   
]),
 1199   1199   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1200   1200   
])
 1201   1201   
                        )
 1202   1202   
                    ),
 1203   1203   
                )
 1204   1204   
    }
 1205   1205   
    pub(super) fn response_code_required_operation(
 1206   1206   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1207   1207   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1208         -
                    ::http::Method::GET,
        1208  +
                    ::http_1x::Method::GET,
 1209   1209   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1210   1210   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1211   1211   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1212   1212   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("responseCodeRequiredOperation")),
 1213   1213   
]),
 1214   1214   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1215   1215   
])
 1216   1216   
                        )
 1217   1217   
                    ),
 1218   1218   
                )
 1219   1219   
    }
 1220   1220   
    pub(super) fn type_complexity_operation(
 1221   1221   
    ) -> ::aws_smithy_http_server::routing::request_spec::RequestSpec {
 1222   1222   
        ::aws_smithy_http_server::routing::request_spec::RequestSpec::new(
 1223         -
                    ::http::Method::POST,
        1223  +
                    ::http_1x::Method::POST,
 1224   1224   
                    ::aws_smithy_http_server::routing::request_spec::UriSpec::new(
 1225   1225   
                        ::aws_smithy_http_server::routing::request_spec::PathAndQuerySpec::new(
 1226   1226   
                            ::aws_smithy_http_server::routing::request_spec::PathSpec::from_vector_unchecked(vec![
 1227   1227   
    ::aws_smithy_http_server::routing::request_spec::PathSegment::Literal(String::from("typeComplexityOperation")),
 1228   1228   
]),
 1229   1229   
                            ::aws_smithy_http_server::routing::request_spec::QuerySpec::from_vector_unchecked(vec![
 1230   1230   
])
 1231   1231   
                        )
 1232   1232   
                    ),
 1233   1233   
                )
@@ -1360,1360 +1421,1421 @@
 1380   1380   
    ) -> MiscService<
 1381   1381   
        ::aws_smithy_http_server::routing::RoutingService<
 1382   1382   
            ::aws_smithy_http_server::protocol::rest::router::RestRouter<
 1383   1383   
                ::aws_smithy_http_server::routing::Route<B>,
 1384   1384   
            >,
 1385   1385   
            ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1386   1386   
        >,
 1387   1387   
    >
 1388   1388   
    where
 1389   1389   
        S: ::tower::Service<
 1390         -
            ::http::Request<B>,
 1391         -
            Response = ::http::Response<::aws_smithy_http_server::body::BoxBody>,
        1390  +
            ::http_1x::Request<B>,
        1391  +
            Response = ::http_1x::Response<::aws_smithy_http_server::body::BoxBody>,
 1392   1392   
            Error = std::convert::Infallible,
 1393   1393   
        >,
 1394   1394   
        S: Clone + Send + 'static,
 1395   1395   
        S::Future: Send + 'static,
 1396   1396   
    {
 1397   1397   
        self.layer(&::tower::layer::layer_fn(
 1398   1398   
            ::aws_smithy_http_server::routing::Route::new,
 1399   1399   
        ))
 1400   1400   
    }
 1401   1401   
}

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

@@ -0,1 +0,44 @@
           1  +
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
[package]
           3  +
name = "naming_test_casing-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-legacy-http]
          13  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http"
          14  +
[dependencies.aws-smithy-legacy-http-server]
          15  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-legacy-http-server"
          16  +
[dependencies.aws-smithy-runtime-api]
          17  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-runtime-api"
          18  +
features = ["http-02x"]
          19  +
[dependencies.aws-smithy-types]
          20  +
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
          21  +
features = ["http-body-0-4-x"]
          22  +
[dependencies.futures-util]
          23  +
version = "0.3"
          24  +
[dependencies.http]
          25  +
version = "0.2.9"
          26  +
[dependencies.mime]
          27  +
version = "0.3"
          28  +
[dependencies.pin-project-lite]
          29  +
version = "0.2"
          30  +
[dependencies.tower]
          31  +
version = "0.4"
          32  +
[dependencies.tracing]
          33  +
version = "0.1"
          34  +
[dev-dependencies.hyper]
          35  +
version = "0.14.26"
          36  +
[dev-dependencies.tokio]
          37  +
version = "1.23.1"
          38  +
[features]
          39  +
rt-tokio = ["aws-smithy-types/rt-tokio"]
          40  +
aws-lambda = ["aws-smithy-legacy-http-server/aws-lambda"]
          41  +
request-id = ["aws-smithy-legacy-http-server/request-id"]
          42  +
default = ["rt-tokio", "request-id"]
          43  +
          44  +

tmp-codegen-diff/codegen-server-test/naming_test_casing-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_casing-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_casing-http0x/rust-server-codegen/src/input.rs

@@ -0,1 +0,36 @@
           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 DoNothingInput {}
           7  +
impl DoNothingInput {
           8  +
    /// Creates a new builder-style object to manufacture [`DoNothingInput`](crate::input::DoNothingInput).
           9  +
    pub fn builder() -> crate::input::do_nothing_input::Builder {
          10  +
        crate::input::do_nothing_input::Builder::default()
          11  +
    }
          12  +
}
          13  +
impl crate::constrained::Constrained for crate::input::DoNothingInput {
          14  +
    type Unconstrained = crate::input::do_nothing_input::Builder;
          15  +
}
          16  +
/// See [`DoNothingInput`](crate::input::DoNothingInput).
          17  +
pub mod do_nothing_input {
          18  +
          19  +
    impl ::std::convert::From<Builder> for crate::input::DoNothingInput {
          20  +
        fn from(builder: Builder) -> Self {
          21  +
            builder.build()
          22  +
        }
          23  +
    }
          24  +
    /// A builder for [`DoNothingInput`](crate::input::DoNothingInput).
          25  +
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
          26  +
    pub struct Builder {}
          27  +
    impl Builder {
          28  +
        /// Consumes the builder and constructs a [`DoNothingInput`](crate::input::DoNothingInput).
          29  +
        pub fn build(self) -> crate::input::DoNothingInput {
          30  +
            self.build_enforcing_all_constraints()
          31  +
        }
          32  +
        fn build_enforcing_all_constraints(self) -> crate::input::DoNothingInput {
          33  +
            crate::input::DoNothingInput {}
          34  +
        }
          35  +
    }
          36  +
}