Server Test

Server Test

rev. 03e6e47f15dfd569240d570d98975ebba692c405 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,40 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
pub(crate) mod map_with_enum_key_unconstrained {
           4  +
           5  +
    #[derive(Debug, Clone)]
           6  +
    pub(crate) struct MapWithEnumKeyUnconstrained(
           7  +
        pub(crate) std::collections::HashMap<::std::string::String, ::std::string::String>,
           8  +
    );
           9  +
          10  +
    impl From<MapWithEnumKeyUnconstrained>
          11  +
        for crate::constrained::MaybeConstrained<
          12  +
            crate::constrained::map_with_enum_key_constrained::MapWithEnumKeyConstrained,
          13  +
        >
          14  +
    {
          15  +
        fn from(value: MapWithEnumKeyUnconstrained) -> Self {
          16  +
            Self::Unconstrained(value)
          17  +
        }
          18  +
    }
          19  +
    impl std::convert::TryFrom<MapWithEnumKeyUnconstrained>
          20  +
        for crate::constrained::map_with_enum_key_constrained::MapWithEnumKeyConstrained
          21  +
    {
          22  +
        type Error = crate::model::map_with_enum_key::ConstraintViolation;
          23  +
        fn try_from(value: MapWithEnumKeyUnconstrained) -> std::result::Result<Self, Self::Error> {
          24  +
            let res: ::std::result::Result<
          25  +
                ::std::collections::HashMap<crate::model::StringEnum, ::std::string::String>,
          26  +
                Self::Error,
          27  +
            > = value
          28  +
                .0
          29  +
                .into_iter()
          30  +
                .map(|(k, v)| {
          31  +
                    let k: crate::model::StringEnum = k.try_into().map_err(Self::Error::Key)?;
          32  +
          33  +
                    Ok((k, v))
          34  +
                })
          35  +
                .collect();
          36  +
            let hm = res?;
          37  +
            Ok(Self(hm))
          38  +
        }
          39  +
    }
          40  +
}

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

@@ -1,1 +62,66 @@
   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.form_urlencoded]
   23     25   
version = "1"
   24     26   
[dependencies.futures-util]
   25     27   
version = "0.3"
   26         -
[dependencies.http]
   27         -
version = "0.2.9"
   28         -
[dependencies.hyper]
   29         -
version = "0.14.26"
          28  +
[dependencies.http-1x]
          29  +
version = "1"
          30  +
package = "http"
          31  +
[dependencies.http-body-util]
          32  +
version = "0.1.3"
   30     33   
[dependencies.mime]
   31     34   
version = "0.3"
   32     35   
[dependencies.nom]
   33     36   
version = "7"
   34     37   
[dependencies.percent-encoding]
   35     38   
version = "2.0.0"
   36     39   
[dependencies.pin-project-lite]
   37     40   
version = "0.2"
   38     41   
[dependencies.tower]
   39     42   
version = "0.4"
   40     43   
[dependencies.tracing]
   41     44   
version = "0.1"
   42     45   
[dev-dependencies.aws-smithy-protocol-test]
   43     46   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
          47  +
features = ["http-1x"]
   44     48   
[dev-dependencies.bytes]
   45     49   
version = "1.4.0"
   46     50   
[dev-dependencies.hyper]
   47         -
version = "0.14.12"
          51  +
version = "1"
   48     52   
[dev-dependencies.pretty_assertions]
   49     53   
version = "1.3.0"
   50     54   
[dev-dependencies.tokio]
   51     55   
version = "1.23.1"
   52     56   
features = ["macros", "test-util", "rt-multi-thread"]
   53     57   
[dev-dependencies.tracing-test]
   54     58   
version = "0.2.5"
   55     59   
features = ["no-env-filter"]
   56     60   
[features]
   57     61   
rt-tokio = ["aws-smithy-types/rt-tokio"]

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

@@ -19,19 +128,131 @@
   39     39   
)]
   40     40   
//! The [`crate::input`], [`crate::output`], and [`crate::error`]
   41     41   
//! modules provide the types used in each operation.
   42     42   
//!
   43     43   
//! ### Running on Hyper
   44     44   
//!
   45     45   
//! ```rust,no_run
   46     46   
//! # use std::net::SocketAddr;
   47     47   
//! # async fn dummy() {
   48     48   
//! use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
          49  +
//! use rest_json_extras::serve;
          50  +
//! use ::tokio::net::TcpListener;
   49     51   
//!
   50     52   
//! # let app = RestJsonExtras::builder(
   51     53   
//! #     RestJsonExtrasConfig::builder()
   52     54   
//! #         .build()
   53     55   
//! # ).build_unchecked();
   54         -
//! let server = app.into_make_service();
   55     56   
//! let bind: SocketAddr = "127.0.0.1:6969".parse()
   56     57   
//!     .expect("unable to parse the server bind address and port");
   57         -
//! ::hyper::Server::bind(&bind).serve(server).await.unwrap();
          58  +
//! let listener = TcpListener::bind(bind).await
          59  +
//!     .expect("failed to bind TCP listener");
          60  +
//! serve(listener, app.into_make_service()).await.unwrap();
   58     61   
//! # }
   59     62   
//! ```
   60     63   
//!
   61     64   
//! ### Running on Lambda
   62     65   
//!
   63     66   
//! ```rust,ignore
   64     67   
//! use rest_json_extras::server::routing::LambdaHandler;
   65     68   
//! use rest_json_extras::RestJsonExtras;
   66     69   
//!
   67     70   
//! # async fn dummy() {
   68     71   
//! # let app = RestJsonExtras::builder(
   69     72   
//! #     RestJsonExtrasConfig::builder()
   70     73   
//! #         .build()
   71     74   
//! # ).build_unchecked();
   72     75   
//! let handler = LambdaHandler::new(app);
   73     76   
//! lambda_http::run(handler).await.unwrap();
   74     77   
//! # }
   75     78   
//! ```
   76     79   
//!
   77     80   
//! # Building the RestJsonExtras
   78     81   
//!
   79     82   
//! To construct [`RestJsonExtras`] we use [`RestJsonExtrasBuilder`] returned by [`RestJsonExtras::builder`].
   80     83   
//!
   81     84   
//! ## Plugins
   82     85   
//!
   83     86   
//! The [`RestJsonExtras::builder`] method, returning [`RestJsonExtrasBuilder`],
   84     87   
//! accepts a config object on which plugins can be registered.
   85     88   
//! Plugins allow you to build middleware which is aware of the operation it is being applied to.
   86     89   
//!
   87     90   
//! ```rust,no_run
   88     91   
//! # use rest_json_extras::server::plugin::IdentityPlugin as LoggingPlugin;
   89     92   
//! # use rest_json_extras::server::plugin::IdentityPlugin as MetricsPlugin;
   90         -
//! # use ::hyper::Body;
          93  +
//! # use ::hyper::body::Incoming;
   91     94   
//! use rest_json_extras::server::plugin::HttpPlugins;
   92     95   
//! use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig, RestJsonExtrasBuilder};
   93     96   
//!
   94     97   
//! let http_plugins = HttpPlugins::new()
   95     98   
//!         .push(LoggingPlugin)
   96     99   
//!         .push(MetricsPlugin);
   97    100   
//! let config = RestJsonExtrasConfig::builder().build();
   98         -
//! let builder: RestJsonExtrasBuilder<Body, _, _, _> = RestJsonExtras::builder(config);
         101  +
//! let builder: RestJsonExtrasBuilder<::hyper::body::Incoming, _, _, _> = RestJsonExtras::builder(config);
   99    102   
//! ```
  100    103   
//!
  101    104   
//! Check out [`crate::server::plugin`] to learn more about plugins.
  102    105   
//!
  103    106   
//! ## Handlers
  104    107   
//!
  105    108   
//! [`RestJsonExtrasBuilder`] provides a setter method for each operation in your Smithy model. The setter methods expect an async function as input, matching the signature for the corresponding operation in your Smithy model.
  106    109   
//! We call these async functions **handlers**. This is where your application business logic lives.
  107    110   
//!
  108    111   
//! Every handler must take an `Input`, and optional [`extractor arguments`](crate::server::request), while returning:
@@ -135,138 +283,290 @@
  155    158   
//! [`RestJsonExtrasBuilder::build`] requires you to provide a handler for every single operation in your Smithy model. It will return an error if that is not the case.
  156    159   
//!
  157    160   
//! [`RestJsonExtrasBuilder::build_unchecked`], instead, does not require exhaustiveness. The server will automatically return 500 Internal Server Error to all requests for operations that do not have a registered handler.
  158    161   
//! [`RestJsonExtrasBuilder::build_unchecked`] is particularly useful if you are deploying your Smithy service as a collection of Lambda functions, where each Lambda is only responsible for a subset of the operations in the Smithy service (or even a single one!).
  159    162   
//!
  160    163   
//! # Example
  161    164   
//!
  162    165   
//! ```rust,no_run
  163    166   
//! # use std::net::SocketAddr;
  164    167   
//! use rest_json_extras::{RestJsonExtras, RestJsonExtrasConfig};
         168  +
//! use rest_json_extras::serve;
         169  +
//! use ::tokio::net::TcpListener;
  165    170   
//!
  166    171   
//! #[::tokio::main]
  167    172   
//! pub async fn main() {
  168    173   
//!    let config = RestJsonExtrasConfig::builder().build();
  169    174   
//!    let app = RestJsonExtras::builder(config)
  170    175   
//!        .case_insensitive_error_operation(case_insensitive_error_operation)
  171    176   
//!        .empty_struct_with_content_on_wire_op(empty_struct_with_content_on_wire_op)
  172    177   
//!        .enum_query(enum_query)
  173    178   
//!        .escaped_string_values(escaped_string_values)
  174    179   
//!        .http_query_params_only_operation(http_query_params_only_operation)
  175    180   
//!        .map_with_enum_key_op(map_with_enum_key_op)
  176    181   
//!        .null_in_non_sparse(null_in_non_sparse)
  177    182   
//!        .primitive_int_header(primitive_int_header)
  178    183   
//!        .primitive_int_op(primitive_int_op)
  179    184   
//!        .query_precedence(query_precedence)
  180    185   
//!        .status_response(status_response)
  181    186   
//!        .string_payload(string_payload)
  182    187   
//!        .build()
  183    188   
//!        .expect("failed to build an instance of RestJsonExtras");
  184    189   
//!
  185    190   
//!    let bind: SocketAddr = "127.0.0.1:6969".parse()
  186    191   
//!        .expect("unable to parse the server bind address and port");
  187         -
//!    let server = ::hyper::Server::bind(&bind).serve(app.into_make_service());
         192  +
//!    let listener = TcpListener::bind(bind).await
         193  +
//!        .expect("failed to bind TCP listener");
  188    194   
//!    # let server = async { Ok::<_, ()>(()) };
  189    195   
//!
  190    196   
//!    // Run your service!
  191         -
//!    if let Err(err) = server.await {
         197  +
//!    if let Err(err) = serve(listener, app.into_make_service()).await {
  192    198   
//!        eprintln!("server error: {:?}", err);
  193    199   
//!    }
  194    200   
//! }
  195    201   
//!
  196    202   
//! use rest_json_extras::{input, output, error};
  197    203   
//!
  198    204   
//! async fn case_insensitive_error_operation(input: input::CaseInsensitiveErrorOperationInput) -> Result<output::CaseInsensitiveErrorOperationOutput, error::CaseInsensitiveErrorOperationError> {
  199    205   
//!     todo!()
  200    206   
//! }
  201    207   
//!
  202    208   
//! async fn empty_struct_with_content_on_wire_op(input: input::EmptyStructWithContentOnWireOpInput) -> Result<output::EmptyStructWithContentOnWireOpOutput, error::EmptyStructWithContentOnWireOpError> {
  203    209   
//!     todo!()
  204    210   
//! }
  205    211   
//!
  206    212   
//! async fn enum_query(input: input::EnumQueryInput) -> Result<output::EnumQueryOutput, error::EnumQueryError> {
  207    213   
//!     todo!()
  208    214   
//! }
  209    215   
//!
  210    216   
//! async fn escaped_string_values(input: input::EscapedStringValuesInput) -> Result<output::EscapedStringValuesOutput, error::EscapedStringValuesError> {
  211    217   
//!     todo!()
  212    218   
//! }
  213    219   
//!
  214    220   
//! async fn http_query_params_only_operation(input: input::HttpQueryParamsOnlyOperationInput) -> Result<output::HttpQueryParamsOnlyOperationOutput, error::HttpQueryParamsOnlyOperationError> {
  215    221   
//!     todo!()
  216    222   
//! }
  217    223   
//!
  218    224   
//! async fn map_with_enum_key_op(input: input::MapWithEnumKeyOpInput) -> Result<output::MapWithEnumKeyOpOutput, error::MapWithEnumKeyOpError> {
  219    225   
//!     todo!()
  220    226   
//! }
  221    227   
//!
  222    228   
//! async fn null_in_non_sparse(input: input::NullInNonSparseInput) -> Result<output::NullInNonSparseOutput, error::NullInNonSparseError> {
  223    229   
//!     todo!()
  224    230   
//! }
  225    231   
//!
  226    232   
//! async fn primitive_int_header(input: input::PrimitiveIntHeaderInput) -> Result<output::PrimitiveIntHeaderOutput, error::PrimitiveIntHeaderError> {
  227    233   
//!     todo!()
  228    234   
//! }
  229    235   
//!
  230    236   
//! async fn primitive_int_op(input: input::PrimitiveIntOpInput) -> Result<output::PrimitiveIntOpOutput, error::PrimitiveIntOpError> {
  231    237   
//!     todo!()
  232    238   
//! }
  233    239   
//!
  234    240   
//! async fn query_precedence(input: input::QueryPrecedenceInput) -> Result<output::QueryPrecedenceOutput, error::QueryPrecedenceError> {
  235    241   
//!     todo!()
  236    242   
//! }
  237    243   
//!
  238    244   
//! async fn status_response(input: input::StatusResponseInput) -> Result<output::StatusResponseOutput, error::StatusResponseError> {
  239    245   
//!     todo!()
  240    246   
//! }
  241    247   
//!
  242    248   
//! async fn string_payload(input: input::StringPayloadInput) -> Result<output::StringPayloadOutput, error::StringPayloadError> {
  243    249   
//!     todo!()
  244    250   
//! }
  245    251   
//!
  246    252   
//! ```
  247    253   
//!
  248         -
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
         254  +
//! [`serve`]: crate::serve
         255  +
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  249    256   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  250    257   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  251    258   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  252         -
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  253    259   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         260  +
pub use crate::server::serve::serve;
  254    261   
pub use crate::service::{
  255    262   
    MissingOperationsError, RestJsonExtras, RestJsonExtrasBuilder, RestJsonExtrasConfig,
  256    263   
    RestJsonExtrasConfigBuilder,
  257    264   
};
  258    265   
  259    266   
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  260    267   
pub mod server {
  261    268   
    // Re-export all types from the `aws-smithy-http-server` crate.
  262    269   
    pub use ::aws_smithy_http_server::*;
  263    270   
}

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

@@ -11,11 +71,71 @@
   31     31   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   32     32   
    B: 'static,
   33     33   
   34     34   
    B::Data: Send,
   35     35   
    ::aws_smithy_http_server::protocol::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 = HttpQueryParamsOnlyOperationInputFuture;
   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_http_query_params_only_operation::de_http_query_params_only_operation_http_request(request)
   50     50   
                            .await
   51     51   
        };
@@ -84,84 +202,206 @@
  104    104   
    /// Upper case error modeled lower case.
  105    105   
    /// Test ID: ServiceLevelErrorServer
  106    106   
    #[::tokio::test]
  107    107   
    #[::tracing_test::traced_test]
  108    108   
    async fn service_level_error_server_response() {
  109    109   
        let output = crate::error::ExtraError {};
  110    110   
        let output = crate::error::HttpQueryParamsOnlyOperationError::ExtraError(output);
  111    111   
        use ::aws_smithy_http_server::response::IntoResponse;
  112    112   
        let http_response = output.into_response();
  113    113   
        ::pretty_assertions::assert_eq!(
  114         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
         114  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
  115    115   
            http_response.status()
  116    116   
        );
  117    117   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
  118    118   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  119    119   
            http_response.headers(),
  120    120   
            expected_headers,
  121    121   
        ));
  122         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         122  +
        use ::http_body_util::BodyExt;
         123  +
        let body = http_response
         124  +
            .into_body()
         125  +
            .collect()
  123    126   
            .await
  124         -
            .expect("unable to extract body to bytes");
         127  +
            .expect("unable to collect body")
         128  +
            .to_bytes();
  125    129   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  126    130   
            &body,
  127    131   
            "{}",
  128    132   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  129    133   
        ));
  130    134   
    }
  131    135   
}
  132    136   
  133    137   
::pin_project_lite::pin_project! {
  134    138   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  135    139   
    /// [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput) using modelled bindings.
  136    140   
    pub struct QueryPrecedenceInputFuture {
  137    141   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::QueryPrecedenceInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  138    142   
    }
  139    143   
}
  140    144   
  141    145   
impl std::future::Future for QueryPrecedenceInputFuture {
  142    146   
    type Output = Result<
  143    147   
        crate::input::QueryPrecedenceInput,
  144    148   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  145    149   
    >;
  146    150   
  147    151   
    fn poll(
  148    152   
        self: std::pin::Pin<&mut Self>,
  149    153   
        cx: &mut std::task::Context<'_>,
  150    154   
    ) -> std::task::Poll<Self::Output> {
  151    155   
        let this = self.project();
  152    156   
        this.inner.as_mut().poll(cx)
  153    157   
    }
  154    158   
}
  155    159   
  156    160   
impl<B>
  157    161   
    ::aws_smithy_http_server::request::FromRequest<
  158    162   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  159    163   
        B,
  160    164   
    > for crate::input::QueryPrecedenceInput
  161    165   
where
  162    166   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  163    167   
    B: 'static,
  164    168   
  165    169   
    B::Data: Send,
  166    170   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  167    171   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  168    172   
{
  169    173   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  170    174   
    type Future = QueryPrecedenceInputFuture;
  171    175   
  172         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         176  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  173    177   
        let fut = async move {
  174    178   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  175    179   
                request.headers(),
  176    180   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  177    181   
            ) {
  178    182   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  179    183   
            }
  180    184   
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_request(request)
  181    185   
                .await
  182    186   
        };
@@ -216,220 +391,405 @@
  236    240   
#[allow(unreachable_code, unused_variables)]
  237    241   
#[cfg(test)]
  238    242   
mod query_precedence_test {
  239    243   
  240    244   
    /// Servers put all query params in map
  241    245   
    /// Test ID: RestJsonServersPutAllQueryParamsInMap
  242    246   
    #[::tokio::test]
  243    247   
    #[::tracing_test::traced_test]
  244    248   
    async fn rest_json_servers_put_all_query_params_in_map_request() {
  245    249   
        #[allow(unused_mut)]
  246         -
        let mut http_request = http::Request::builder()
         250  +
        let mut http_request = ::http_1x::Request::builder()
  247    251   
            .uri("/Precedence")
  248    252   
            .method("POST")
  249         -
            .body(::aws_smithy_http_server::body::Body::from(
  250         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
         253  +
            .body(::aws_smithy_http_server::body::boxed(
         254  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         255  +
                    &::aws_smithy_protocol_test::decode_body_data(
  251    256   
                        "".as_bytes(),
  252    257   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         258  +
                    ),
  253    259   
                )),
  254    260   
            ))
  255    261   
            .unwrap();
  256    262   
        *http_request.uri_mut() = "/Precedence?bar=named&qux=fromMap".parse().unwrap();
  257    263   
        #[allow(unused_mut)]
  258    264   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  259    265   
        let config = crate::service::RestJsonExtrasConfig::builder().build();
  260         -
        let service =
  261         -
            crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
         266  +
        let service = crate::service::RestJsonExtras::builder::<
         267  +
            ::aws_smithy_http_server::body::BoxBody,
         268  +
            _,
         269  +
            _,
         270  +
            _,
         271  +
        >(config)
  262    272   
        .query_precedence(move |input: crate::input::QueryPrecedenceInput| {
  263    273   
            let sender = sender.clone();
  264    274   
            async move {
  265    275   
                let result = {
  266    276   
                    let expected = crate::input::QueryPrecedenceInput {
  267    277   
                        foo: ::std::option::Option::Some("named".to_owned()),
  268    278   
                        baz: ::std::option::Option::Some({
  269    279   
                            let mut ret = ::std::collections::HashMap::new();
  270    280   
                            ret.insert("bar".to_owned(), "named".to_owned());
  271    281   
                            ret.insert("qux".to_owned(), "fromMap".to_owned());
  272    282   
                            ret
  273    283   
                        }),
  274    284   
                    };
  275    285   
                    ::pretty_assertions::assert_eq!(input, expected);
  276    286   
                    let output = crate::output::QueryPrecedenceOutput {};
  277    287   
                    Ok(output)
  278    288   
                };
  279    289   
                sender.send(()).await.expect("receiver dropped early");
  280    290   
                result
  281    291   
            }
  282    292   
        })
  283    293   
        .build_unchecked();
  284    294   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  285    295   
            .await
  286    296   
            .expect("unable to make an HTTP request");
  287    297   
        assert!(
  288    298   
            receiver.recv().await.is_some(),
  289    299   
            "we expected operation handler to be invoked but it was not entered"
  290    300   
        );
  291    301   
    }
  292    302   
  293    303   
    /// Upper case error modeled lower case.
  294    304   
    /// Test ID: ServiceLevelErrorServer
  295    305   
    #[::tokio::test]
  296    306   
    #[::tracing_test::traced_test]
  297    307   
    async fn service_level_error_server_response() {
  298    308   
        let output = crate::error::ExtraError {};
  299    309   
        let output = crate::error::QueryPrecedenceError::ExtraError(output);
  300    310   
        use ::aws_smithy_http_server::response::IntoResponse;
  301    311   
        let http_response = output.into_response();
  302    312   
        ::pretty_assertions::assert_eq!(
  303         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
         313  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
  304    314   
            http_response.status()
  305    315   
        );
  306    316   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
  307    317   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  308    318   
            http_response.headers(),
  309    319   
            expected_headers,
  310    320   
        ));
  311         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         321  +
        use ::http_body_util::BodyExt;
         322  +
        let body = http_response
         323  +
            .into_body()
         324  +
            .collect()
  312    325   
            .await
  313         -
            .expect("unable to extract body to bytes");
         326  +
            .expect("unable to collect body")
         327  +
            .to_bytes();
  314    328   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  315    329   
            &body,
  316    330   
            "{}",
  317    331   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  318    332   
        ));
  319    333   
    }
  320    334   
}
  321    335   
  322    336   
::pin_project_lite::pin_project! {
  323    337   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  324    338   
    /// [`EmptyStructWithContentOnWireOpInput`](crate::input::EmptyStructWithContentOnWireOpInput) using modelled bindings.
  325    339   
    pub struct EmptyStructWithContentOnWireOpInputFuture {
  326    340   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EmptyStructWithContentOnWireOpInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  327    341   
    }
  328    342   
}
  329    343   
  330    344   
impl std::future::Future for EmptyStructWithContentOnWireOpInputFuture {
  331    345   
    type Output = Result<
  332    346   
        crate::input::EmptyStructWithContentOnWireOpInput,
  333    347   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  334    348   
    >;
  335    349   
  336    350   
    fn poll(
  337    351   
        self: std::pin::Pin<&mut Self>,
  338    352   
        cx: &mut std::task::Context<'_>,
  339    353   
    ) -> std::task::Poll<Self::Output> {
  340    354   
        let this = self.project();
  341    355   
        this.inner.as_mut().poll(cx)
  342    356   
    }
  343    357   
}
  344    358   
  345    359   
impl<B>
  346    360   
    ::aws_smithy_http_server::request::FromRequest<
  347    361   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  348    362   
        B,
  349    363   
    > for crate::input::EmptyStructWithContentOnWireOpInput
  350    364   
where
  351    365   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  352    366   
    B: 'static,
  353    367   
  354    368   
    B::Data: Send,
  355    369   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  356    370   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  357    371   
{
  358    372   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  359    373   
    type Future = EmptyStructWithContentOnWireOpInputFuture;
  360    374   
  361         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         375  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  362    376   
        let fut = async move {
  363    377   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  364    378   
                request.headers(),
  365    379   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  366    380   
            ) {
  367    381   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  368    382   
            }
  369    383   
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op_http_request(request)
  370    384   
                            .await
  371    385   
        };
@@ -404,418 +522,540 @@
  424    438   
    /// Upper case error modeled lower case.
  425    439   
    /// Test ID: ServiceLevelErrorServer
  426    440   
    #[::tokio::test]
  427    441   
    #[::tracing_test::traced_test]
  428    442   
    async fn service_level_error_server_response() {
  429    443   
        let output = crate::error::ExtraError {};
  430    444   
        let output = crate::error::EmptyStructWithContentOnWireOpError::ExtraError(output);
  431    445   
        use ::aws_smithy_http_server::response::IntoResponse;
  432    446   
        let http_response = output.into_response();
  433    447   
        ::pretty_assertions::assert_eq!(
  434         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
         448  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
  435    449   
            http_response.status()
  436    450   
        );
  437    451   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
  438    452   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  439    453   
            http_response.headers(),
  440    454   
            expected_headers,
  441    455   
        ));
  442         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         456  +
        use ::http_body_util::BodyExt;
         457  +
        let body = http_response
         458  +
            .into_body()
         459  +
            .collect()
  443    460   
            .await
  444         -
            .expect("unable to extract body to bytes");
         461  +
            .expect("unable to collect body")
         462  +
            .to_bytes();
  445    463   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  446    464   
            &body,
  447    465   
            "{}",
  448    466   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  449    467   
        ));
  450    468   
    }
  451    469   
}
  452    470   
  453    471   
::pin_project_lite::pin_project! {
  454    472   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  455    473   
    /// [`CaseInsensitiveErrorOperationInput`](crate::input::CaseInsensitiveErrorOperationInput) using modelled bindings.
  456    474   
    pub struct CaseInsensitiveErrorOperationInputFuture {
  457    475   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::CaseInsensitiveErrorOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  458    476   
    }
  459    477   
}
  460    478   
  461    479   
impl std::future::Future for CaseInsensitiveErrorOperationInputFuture {
  462    480   
    type Output = Result<
  463    481   
        crate::input::CaseInsensitiveErrorOperationInput,
  464    482   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  465    483   
    >;
  466    484   
  467    485   
    fn poll(
  468    486   
        self: std::pin::Pin<&mut Self>,
  469    487   
        cx: &mut std::task::Context<'_>,
  470    488   
    ) -> std::task::Poll<Self::Output> {
  471    489   
        let this = self.project();
  472    490   
        this.inner.as_mut().poll(cx)
  473    491   
    }
  474    492   
}
  475    493   
  476    494   
impl<B>
  477    495   
    ::aws_smithy_http_server::request::FromRequest<
  478    496   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  479    497   
        B,
  480    498   
    > for crate::input::CaseInsensitiveErrorOperationInput
  481    499   
where
  482    500   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  483    501   
    B: 'static,
  484    502   
  485    503   
    B::Data: Send,
  486    504   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  487    505   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  488    506   
{
  489    507   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  490    508   
    type Future = CaseInsensitiveErrorOperationInputFuture;
  491    509   
  492         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         510  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  493    511   
        let fut = async move {
  494    512   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  495    513   
                request.headers(),
  496    514   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  497    515   
            ) {
  498    516   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  499    517   
            }
  500    518   
            crate::protocol_serde::shape_case_insensitive_error_operation::de_case_insensitive_error_operation_http_request(request)
  501    519   
                            .await
  502    520   
        };
@@ -535,553 +653,675 @@
  555    573   
    /// Upper case error modeled lower case.
  556    574   
    /// Test ID: ServiceLevelErrorServer
  557    575   
    #[::tokio::test]
  558    576   
    #[::tracing_test::traced_test]
  559    577   
    async fn service_level_error_server_response() {
  560    578   
        let output = crate::error::ExtraError {};
  561    579   
        let output = crate::error::CaseInsensitiveErrorOperationError::ExtraError(output);
  562    580   
        use ::aws_smithy_http_server::response::IntoResponse;
  563    581   
        let http_response = output.into_response();
  564    582   
        ::pretty_assertions::assert_eq!(
  565         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
         583  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
  566    584   
            http_response.status()
  567    585   
        );
  568    586   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
  569    587   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  570    588   
            http_response.headers(),
  571    589   
            expected_headers,
  572    590   
        ));
  573         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         591  +
        use ::http_body_util::BodyExt;
         592  +
        let body = http_response
         593  +
            .into_body()
         594  +
            .collect()
  574    595   
            .await
  575         -
            .expect("unable to extract body to bytes");
         596  +
            .expect("unable to collect body")
         597  +
            .to_bytes();
  576    598   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  577    599   
            &body,
  578    600   
            "{}",
  579    601   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  580    602   
        ));
  581    603   
    }
  582    604   
}
  583    605   
  584    606   
::pin_project_lite::pin_project! {
  585    607   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  586    608   
    /// [`NullInNonSparseInput`](crate::input::NullInNonSparseInput) using modelled bindings.
  587    609   
    pub struct NullInNonSparseInputFuture {
  588    610   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::NullInNonSparseInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  589    611   
    }
  590    612   
}
  591    613   
  592    614   
impl std::future::Future for NullInNonSparseInputFuture {
  593    615   
    type Output = Result<
  594    616   
        crate::input::NullInNonSparseInput,
  595    617   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  596    618   
    >;
  597    619   
  598    620   
    fn poll(
  599    621   
        self: std::pin::Pin<&mut Self>,
  600    622   
        cx: &mut std::task::Context<'_>,
  601    623   
    ) -> std::task::Poll<Self::Output> {
  602    624   
        let this = self.project();
  603    625   
        this.inner.as_mut().poll(cx)
  604    626   
    }
  605    627   
}
  606    628   
  607    629   
impl<B>
  608    630   
    ::aws_smithy_http_server::request::FromRequest<
  609    631   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  610    632   
        B,
  611    633   
    > for crate::input::NullInNonSparseInput
  612    634   
where
  613    635   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  614    636   
    B: 'static,
  615    637   
  616    638   
    B::Data: Send,
  617    639   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  618    640   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  619    641   
{
  620    642   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  621    643   
    type Future = NullInNonSparseInputFuture;
  622    644   
  623         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         645  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  624    646   
        let fut = async move {
  625    647   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  626    648   
                request.headers(),
  627    649   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  628    650   
            ) {
  629    651   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  630    652   
            }
  631    653   
            crate::protocol_serde::shape_null_in_non_sparse::de_null_in_non_sparse_http_request(
  632    654   
                request,
  633    655   
            )
@@ -674,696 +792,818 @@
  694    716   
    /// Upper case error modeled lower case.
  695    717   
    /// Test ID: ServiceLevelErrorServer
  696    718   
    #[::tokio::test]
  697    719   
    #[::tracing_test::traced_test]
  698    720   
    async fn service_level_error_server_response() {
  699    721   
        let output = crate::error::ExtraError {};
  700    722   
        let output = crate::error::NullInNonSparseError::ExtraError(output);
  701    723   
        use ::aws_smithy_http_server::response::IntoResponse;
  702    724   
        let http_response = output.into_response();
  703    725   
        ::pretty_assertions::assert_eq!(
  704         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
         726  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
  705    727   
            http_response.status()
  706    728   
        );
  707    729   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
  708    730   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  709    731   
            http_response.headers(),
  710    732   
            expected_headers,
  711    733   
        ));
  712         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         734  +
        use ::http_body_util::BodyExt;
         735  +
        let body = http_response
         736  +
            .into_body()
         737  +
            .collect()
  713    738   
            .await
  714         -
            .expect("unable to extract body to bytes");
         739  +
            .expect("unable to collect body")
         740  +
            .to_bytes();
  715    741   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  716    742   
            &body,
  717    743   
            "{}",
  718    744   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  719    745   
        ));
  720    746   
    }
  721    747   
}
  722    748   
  723    749   
::pin_project_lite::pin_project! {
  724    750   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  725    751   
    /// [`EscapedStringValuesInput`](crate::input::EscapedStringValuesInput) using modelled bindings.
  726    752   
    pub struct EscapedStringValuesInputFuture {
  727    753   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EscapedStringValuesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  728    754   
    }
  729    755   
}
  730    756   
  731    757   
impl std::future::Future for EscapedStringValuesInputFuture {
  732    758   
    type Output = Result<
  733    759   
        crate::input::EscapedStringValuesInput,
  734    760   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  735    761   
    >;
  736    762   
  737    763   
    fn poll(
  738    764   
        self: std::pin::Pin<&mut Self>,
  739    765   
        cx: &mut std::task::Context<'_>,
  740    766   
    ) -> std::task::Poll<Self::Output> {
  741    767   
        let this = self.project();
  742    768   
        this.inner.as_mut().poll(cx)
  743    769   
    }
  744    770   
}
  745    771   
  746    772   
impl<B>
  747    773   
    ::aws_smithy_http_server::request::FromRequest<
  748    774   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  749    775   
        B,
  750    776   
    > for crate::input::EscapedStringValuesInput
  751    777   
where
  752    778   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  753    779   
    B: 'static,
  754    780   
  755    781   
    B::Data: Send,
  756    782   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  757    783   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  758    784   
{
  759    785   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  760    786   
    type Future = EscapedStringValuesInputFuture;
  761    787   
  762         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         788  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  763    789   
        let fut = async move {
  764    790   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  765    791   
                request.headers(),
  766    792   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  767    793   
            ) {
  768    794   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  769    795   
            }
  770    796   
            crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values_http_request(request)
  771    797   
                            .await
  772    798   
        };
@@ -800,826 +1004,1045 @@
  820    846   
  821    847   
#[allow(unreachable_code, unused_variables)]
  822    848   
#[cfg(test)]
  823    849   
mod escaped_string_values_test {
  824    850   
  825    851   
    /// Test ID: EscapedStringValuesRequest
  826    852   
    #[::tokio::test]
  827    853   
    #[::tracing_test::traced_test]
  828    854   
    async fn escaped_string_values_request_request() {
  829    855   
        #[allow(unused_mut)]
  830         -
        let mut http_request = http::Request::builder()
         856  +
        let mut http_request = ::http_1x::Request::builder()
  831    857   
            .uri("/escaped-string-values")
  832    858   
            .method("POST")
  833    859   
            .header("Content-Type", "application/json")
  834         -
            .body(::aws_smithy_http_server::body::Body::from(
  835         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  836         -
                    "{\"enum\":\"has\\\"quotes\",\"also\\\"has\\\"quotes\":\"test\"}".as_bytes(),
         860  +
            .body(::aws_smithy_http_server::body::boxed(
         861  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
         862  +
                    &::aws_smithy_protocol_test::decode_body_data(
         863  +
                        "{\"enum\":\"has\\\"quotes\",\"also\\\"has\\\"quotes\":\"test\"}"
         864  +
                            .as_bytes(),
  837    865   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
         866  +
                    ),
  838    867   
                )),
  839    868   
            ))
  840    869   
            .unwrap();
  841    870   
        #[allow(unused_mut)]
  842    871   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  843    872   
        let config = crate::service::RestJsonExtrasConfig::builder().build();
  844         -
        let service =
  845         -
            crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
         873  +
        let service = crate::service::RestJsonExtras::builder::<
         874  +
            ::aws_smithy_http_server::body::BoxBody,
         875  +
            _,
         876  +
            _,
         877  +
            _,
         878  +
        >(config)
  846    879   
        .escaped_string_values(move |input: crate::input::EscapedStringValuesInput| {
  847    880   
            let sender = sender.clone();
  848    881   
            async move {
  849    882   
                let result = {
  850    883   
                    let expected = crate::input::EscapedStringValuesInput {
  851    884   
                        r#enum: ::std::option::Option::Some(
  852    885   
                            "has\"quotes"
  853    886   
                                .parse::<crate::model::EnumWithEscapedChars>()
  854    887   
                                .expect("static value validated to member"),
  855    888   
                        ),
  856    889   
                        some_string: ::std::option::Option::Some("test".to_owned()),
  857    890   
                    };
  858    891   
                    ::pretty_assertions::assert_eq!(input, expected);
  859    892   
                    let output = crate::output::EscapedStringValuesOutput {
  860    893   
                        r#enum: ::std::option::Option::None,
  861    894   
                        some_string: ::std::option::Option::None,
  862    895   
                    };
  863    896   
                    Ok(output)
  864    897   
                };
  865    898   
                sender.send(()).await.expect("receiver dropped early");
  866    899   
                result
  867    900   
            }
  868    901   
        })
  869    902   
        .build_unchecked();
  870    903   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  871    904   
            .await
  872    905   
            .expect("unable to make an HTTP request");
  873    906   
        assert!(
  874    907   
            receiver.recv().await.is_some(),
  875    908   
            "we expected operation handler to be invoked but it was not entered"
  876    909   
        );
  877    910   
    }
  878    911   
    /// Test ID: EscapedStringValuesResponse
  879    912   
    #[::tokio::test]
  880    913   
    #[::tracing_test::traced_test]
  881    914   
    async fn escaped_string_values_response_response() {
  882    915   
        let output = crate::output::EscapedStringValuesOutput {
  883    916   
            r#enum: ::std::option::Option::Some(
  884    917   
                "has\"quotes"
  885    918   
                    .parse::<crate::model::EnumWithEscapedChars>()
  886    919   
                    .expect("static value validated to member"),
  887    920   
            ),
  888    921   
            some_string: ::std::option::Option::Some("test".to_owned()),
  889    922   
        };
  890    923   
        use ::aws_smithy_http_server::response::IntoResponse;
  891    924   
        let http_response = output.into_response();
  892    925   
        ::pretty_assertions::assert_eq!(
  893         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
         926  +
            ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
  894    927   
            http_response.status()
  895    928   
        );
  896         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         929  +
        use ::http_body_util::BodyExt;
         930  +
        let body = http_response
         931  +
            .into_body()
         932  +
            .collect()
  897    933   
            .await
  898         -
            .expect("unable to extract body to bytes");
         934  +
            .expect("unable to collect body")
         935  +
            .to_bytes();
  899    936   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  900    937   
            &body,
  901    938   
            "{\"enum\":\"has\\\"quotes\",\"also\\\"has\\\"quotes\":\"test\"}",
  902    939   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  903    940   
        ));
  904    941   
    }
  905    942   
  906    943   
    /// Upper case error modeled lower case.
  907    944   
    /// Test ID: ServiceLevelErrorServer
  908    945   
    #[::tokio::test]
  909    946   
    #[::tracing_test::traced_test]
  910    947   
    async fn service_level_error_server_response() {
  911    948   
        let output = crate::error::ExtraError {};
  912    949   
        let output = crate::error::EscapedStringValuesError::ExtraError(output);
  913    950   
        use ::aws_smithy_http_server::response::IntoResponse;
  914    951   
        let http_response = output.into_response();
  915    952   
        ::pretty_assertions::assert_eq!(
  916         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
         953  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
  917    954   
            http_response.status()
  918    955   
        );
  919    956   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
  920    957   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  921    958   
            http_response.headers(),
  922    959   
            expected_headers,
  923    960   
        ));
  924         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
         961  +
        use ::http_body_util::BodyExt;
         962  +
        let body = http_response
         963  +
            .into_body()
         964  +
            .collect()
  925    965   
            .await
  926         -
            .expect("unable to extract body to bytes");
         966  +
            .expect("unable to collect body")
         967  +
            .to_bytes();
  927    968   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  928    969   
            &body,
  929    970   
            "{}",
  930    971   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  931    972   
        ));
  932    973   
    }
  933    974   
}
  934    975   
  935    976   
::pin_project_lite::pin_project! {
  936    977   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  937    978   
    /// [`PrimitiveIntOpInput`](crate::input::PrimitiveIntOpInput) using modelled bindings.
  938    979   
    pub struct PrimitiveIntOpInputFuture {
  939    980   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PrimitiveIntOpInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  940    981   
    }
  941    982   
}
  942    983   
  943    984   
impl std::future::Future for PrimitiveIntOpInputFuture {
  944    985   
    type Output = Result<
  945    986   
        crate::input::PrimitiveIntOpInput,
  946    987   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
  947    988   
    >;
  948    989   
  949    990   
    fn poll(
  950    991   
        self: std::pin::Pin<&mut Self>,
  951    992   
        cx: &mut std::task::Context<'_>,
  952    993   
    ) -> std::task::Poll<Self::Output> {
  953    994   
        let this = self.project();
  954    995   
        this.inner.as_mut().poll(cx)
  955    996   
    }
  956    997   
}
  957    998   
  958    999   
impl<B>
  959   1000   
    ::aws_smithy_http_server::request::FromRequest<
  960   1001   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  961   1002   
        B,
  962   1003   
    > for crate::input::PrimitiveIntOpInput
  963   1004   
where
  964   1005   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
  965   1006   
    B: 'static,
  966   1007   
  967   1008   
    B::Data: Send,
  968   1009   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
  969   1010   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
  970   1011   
{
  971   1012   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
  972   1013   
    type Future = PrimitiveIntOpInputFuture;
  973   1014   
  974         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1015  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
  975   1016   
        let fut = async move {
  976   1017   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  977   1018   
                request.headers(),
  978   1019   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
  979   1020   
            ) {
  980   1021   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  981   1022   
            }
  982   1023   
            crate::protocol_serde::shape_primitive_int_op::de_primitive_int_op_http_request(request)
  983   1024   
                .await
  984   1025   
        };
@@ -1022,1063 +1140,1185 @@
 1042   1083   
    /// Upper case error modeled lower case.
 1043   1084   
    /// Test ID: ServiceLevelErrorServer
 1044   1085   
    #[::tokio::test]
 1045   1086   
    #[::tracing_test::traced_test]
 1046   1087   
    async fn service_level_error_server_response() {
 1047   1088   
        let output = crate::error::ExtraError {};
 1048   1089   
        let output = crate::error::PrimitiveIntOpError::ExtraError(output);
 1049   1090   
        use ::aws_smithy_http_server::response::IntoResponse;
 1050   1091   
        let http_response = output.into_response();
 1051   1092   
        ::pretty_assertions::assert_eq!(
 1052         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
        1093  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
 1053   1094   
            http_response.status()
 1054   1095   
        );
 1055   1096   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
 1056   1097   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1057   1098   
            http_response.headers(),
 1058   1099   
            expected_headers,
 1059   1100   
        ));
 1060         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1101  +
        use ::http_body_util::BodyExt;
        1102  +
        let body = http_response
        1103  +
            .into_body()
        1104  +
            .collect()
 1061   1105   
            .await
 1062         -
            .expect("unable to extract body to bytes");
        1106  +
            .expect("unable to collect body")
        1107  +
            .to_bytes();
 1063   1108   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1064   1109   
            &body,
 1065   1110   
            "{}",
 1066   1111   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1067   1112   
        ));
 1068   1113   
    }
 1069   1114   
}
 1070   1115   
 1071   1116   
::pin_project_lite::pin_project! {
 1072   1117   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1073   1118   
    /// [`MapWithEnumKeyOpInput`](crate::input::MapWithEnumKeyOpInput) using modelled bindings.
 1074   1119   
    pub struct MapWithEnumKeyOpInputFuture {
 1075   1120   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MapWithEnumKeyOpInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 1076   1121   
    }
 1077   1122   
}
 1078   1123   
 1079   1124   
impl std::future::Future for MapWithEnumKeyOpInputFuture {
 1080   1125   
    type Output = Result<
 1081   1126   
        crate::input::MapWithEnumKeyOpInput,
 1082   1127   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
 1083   1128   
    >;
 1084   1129   
 1085   1130   
    fn poll(
 1086   1131   
        self: std::pin::Pin<&mut Self>,
 1087   1132   
        cx: &mut std::task::Context<'_>,
 1088   1133   
    ) -> std::task::Poll<Self::Output> {
 1089   1134   
        let this = self.project();
 1090   1135   
        this.inner.as_mut().poll(cx)
 1091   1136   
    }
 1092   1137   
}
 1093   1138   
 1094   1139   
impl<B>
 1095   1140   
    ::aws_smithy_http_server::request::FromRequest<
 1096   1141   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1097   1142   
        B,
 1098   1143   
    > for crate::input::MapWithEnumKeyOpInput
 1099   1144   
where
 1100   1145   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1101   1146   
    B: 'static,
 1102   1147   
 1103   1148   
    B::Data: Send,
 1104   1149   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1105   1150   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1106   1151   
{
 1107   1152   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1108   1153   
    type Future = MapWithEnumKeyOpInputFuture;
 1109   1154   
 1110         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1155  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1111   1156   
        let fut = async move {
 1112   1157   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1113   1158   
                request.headers(),
 1114   1159   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1115   1160   
            ) {
 1116   1161   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1117   1162   
            }
 1118   1163   
            crate::protocol_serde::shape_map_with_enum_key_op::de_map_with_enum_key_op_http_request(
 1119   1164   
                request,
 1120   1165   
            )
@@ -1154,1199 +1365,1424 @@
 1174   1219   
 1175   1220   
#[allow(unreachable_code, unused_variables)]
 1176   1221   
#[cfg(test)]
 1177   1222   
mod map_with_enum_key_op_test {
 1178   1223   
 1179   1224   
    /// Test ID: MapWithEnumKeyRequest
 1180   1225   
    #[::tokio::test]
 1181   1226   
    #[::tracing_test::traced_test]
 1182   1227   
    async fn map_with_enum_key_request_request() {
 1183   1228   
        #[allow(unused_mut)]
 1184         -
        let mut http_request = http::Request::builder()
        1229  +
        let mut http_request = ::http_1x::Request::builder()
 1185   1230   
            .uri("/map-with-enum-key")
 1186   1231   
            .method("POST")
 1187   1232   
            .header("Content-Type", "application/json")
 1188         -
            .body(::aws_smithy_http_server::body::Body::from(
 1189         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
        1233  +
            .body(::aws_smithy_http_server::body::boxed(
        1234  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
        1235  +
                    &::aws_smithy_protocol_test::decode_body_data(
 1190   1236   
                        "{\"map\":{\"enumvalue\":\"something\"}}".as_bytes(),
 1191   1237   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
        1238  +
                    ),
 1192   1239   
                )),
 1193   1240   
            ))
 1194   1241   
            .unwrap();
 1195   1242   
        #[allow(unused_mut)]
 1196   1243   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1197   1244   
        let config = crate::service::RestJsonExtrasConfig::builder().build();
 1198         -
        let service =
 1199         -
            crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
        1245  +
        let service = crate::service::RestJsonExtras::builder::<
        1246  +
            ::aws_smithy_http_server::body::BoxBody,
        1247  +
            _,
        1248  +
            _,
        1249  +
            _,
        1250  +
        >(config)
 1200   1251   
        .map_with_enum_key_op(move |input: crate::input::MapWithEnumKeyOpInput| {
 1201   1252   
            let sender = sender.clone();
 1202   1253   
            async move {
 1203   1254   
                let result = {
 1204   1255   
                    let expected = crate::input::MapWithEnumKeyOpInput {
 1205   1256   
                        map: ::std::option::Option::Some({
 1206   1257   
                            let mut ret = ::std::collections::HashMap::new();
 1207   1258   
                            ret.insert(
 1208   1259   
                                "enumvalue"
 1209   1260   
                                    .parse::<crate::model::StringEnum>()
 1210   1261   
                                    .expect("static value validated to member"),
 1211   1262   
                                "something".to_owned(),
 1212   1263   
                            );
 1213   1264   
                            ret
 1214   1265   
                        }),
 1215   1266   
                    };
 1216   1267   
                    ::pretty_assertions::assert_eq!(input, expected);
 1217   1268   
                    let output = crate::output::MapWithEnumKeyOpOutput {
 1218   1269   
                        map: ::std::option::Option::None,
 1219   1270   
                    };
 1220   1271   
                    Ok(output)
 1221   1272   
                };
 1222   1273   
                sender.send(()).await.expect("receiver dropped early");
 1223   1274   
                result
 1224   1275   
            }
 1225   1276   
        })
 1226   1277   
        .build_unchecked();
 1227   1278   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1228   1279   
            .await
 1229   1280   
            .expect("unable to make an HTTP request");
 1230   1281   
        assert!(
 1231   1282   
            receiver.recv().await.is_some(),
 1232   1283   
            "we expected operation handler to be invoked but it was not entered"
 1233   1284   
        );
 1234   1285   
    }
 1235   1286   
    /// Test ID: MapWithEnumKeyResponse
 1236   1287   
    #[::tokio::test]
 1237   1288   
    #[::tracing_test::traced_test]
 1238   1289   
    async fn map_with_enum_key_response_response() {
 1239   1290   
        let output = crate::output::MapWithEnumKeyOpOutput {
 1240   1291   
            map: ::std::option::Option::Some({
 1241   1292   
                let mut ret = ::std::collections::HashMap::new();
 1242   1293   
                ret.insert(
 1243   1294   
                    "enumvalue"
 1244   1295   
                        .parse::<crate::model::StringEnum>()
 1245   1296   
                        .expect("static value validated to member"),
 1246   1297   
                    "something".to_owned(),
 1247   1298   
                );
 1248   1299   
                ret
 1249   1300   
            }),
 1250   1301   
        };
 1251   1302   
        use ::aws_smithy_http_server::response::IntoResponse;
 1252   1303   
        let http_response = output.into_response();
 1253   1304   
        ::pretty_assertions::assert_eq!(
 1254         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1305  +
            ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1255   1306   
            http_response.status()
 1256   1307   
        );
 1257         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1308  +
        use ::http_body_util::BodyExt;
        1309  +
        let body = http_response
        1310  +
            .into_body()
        1311  +
            .collect()
 1258   1312   
            .await
 1259         -
            .expect("unable to extract body to bytes");
        1313  +
            .expect("unable to collect body")
        1314  +
            .to_bytes();
 1260   1315   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1261   1316   
            &body,
 1262   1317   
            "{\"map\":{\"enumvalue\":\"something\"}}",
 1263   1318   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1264   1319   
        ));
 1265   1320   
    }
 1266   1321   
 1267   1322   
    /// Upper case error modeled lower case.
 1268   1323   
    /// Test ID: ServiceLevelErrorServer
 1269   1324   
    #[::tokio::test]
 1270   1325   
    #[::tracing_test::traced_test]
 1271   1326   
    async fn service_level_error_server_response() {
 1272   1327   
        let output = crate::error::ExtraError {};
 1273   1328   
        let output = crate::error::MapWithEnumKeyOpError::ExtraError(output);
 1274   1329   
        use ::aws_smithy_http_server::response::IntoResponse;
 1275   1330   
        let http_response = output.into_response();
 1276   1331   
        ::pretty_assertions::assert_eq!(
 1277         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
        1332  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
 1278   1333   
            http_response.status()
 1279   1334   
        );
 1280   1335   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
 1281   1336   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1282   1337   
            http_response.headers(),
 1283   1338   
            expected_headers,
 1284   1339   
        ));
 1285         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1340  +
        use ::http_body_util::BodyExt;
        1341  +
        let body = http_response
        1342  +
            .into_body()
        1343  +
            .collect()
 1286   1344   
            .await
 1287         -
            .expect("unable to extract body to bytes");
        1345  +
            .expect("unable to collect body")
        1346  +
            .to_bytes();
 1288   1347   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1289   1348   
            &body,
 1290   1349   
            "{}",
 1291   1350   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1292   1351   
        ));
 1293   1352   
    }
 1294   1353   
}
 1295   1354   
 1296   1355   
::pin_project_lite::pin_project! {
 1297   1356   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1298   1357   
    /// [`StatusResponseInput`](crate::input::StatusResponseInput) using modelled bindings.
 1299   1358   
    pub struct StatusResponseInputFuture {
 1300   1359   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StatusResponseInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 1301   1360   
    }
 1302   1361   
}
 1303   1362   
 1304   1363   
impl std::future::Future for StatusResponseInputFuture {
 1305   1364   
    type Output = Result<
 1306   1365   
        crate::input::StatusResponseInput,
 1307   1366   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
 1308   1367   
    >;
 1309   1368   
 1310   1369   
    fn poll(
 1311   1370   
        self: std::pin::Pin<&mut Self>,
 1312   1371   
        cx: &mut std::task::Context<'_>,
 1313   1372   
    ) -> std::task::Poll<Self::Output> {
 1314   1373   
        let this = self.project();
 1315   1374   
        this.inner.as_mut().poll(cx)
 1316   1375   
    }
 1317   1376   
}
 1318   1377   
 1319   1378   
impl<B>
 1320   1379   
    ::aws_smithy_http_server::request::FromRequest<
 1321   1380   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1322   1381   
        B,
 1323   1382   
    > for crate::input::StatusResponseInput
 1324   1383   
where
 1325   1384   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1326   1385   
    B: 'static,
 1327   1386   
 1328   1387   
    B::Data: Send,
 1329   1388   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1330   1389   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1331   1390   
{
 1332   1391   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1333   1392   
    type Future = StatusResponseInputFuture;
 1334   1393   
 1335         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1394  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1336   1395   
        let fut = async move {
 1337   1396   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1338   1397   
                request.headers(),
 1339   1398   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1340   1399   
            ) {
 1341   1400   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1342   1401   
            }
 1343   1402   
            crate::protocol_serde::shape_status_response::de_status_response_http_request(request)
 1344   1403   
                .await
 1345   1404   
        };
@@ -1381,1440 +1499,1562 @@
 1401   1460   
    /// Upper case error modeled lower case.
 1402   1461   
    /// Test ID: ServiceLevelErrorServer
 1403   1462   
    #[::tokio::test]
 1404   1463   
    #[::tracing_test::traced_test]
 1405   1464   
    async fn service_level_error_server_response() {
 1406   1465   
        let output = crate::error::ExtraError {};
 1407   1466   
        let output = crate::error::StatusResponseError::ExtraError(output);
 1408   1467   
        use ::aws_smithy_http_server::response::IntoResponse;
 1409   1468   
        let http_response = output.into_response();
 1410   1469   
        ::pretty_assertions::assert_eq!(
 1411         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
        1470  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
 1412   1471   
            http_response.status()
 1413   1472   
        );
 1414   1473   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
 1415   1474   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1416   1475   
            http_response.headers(),
 1417   1476   
            expected_headers,
 1418   1477   
        ));
 1419         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1478  +
        use ::http_body_util::BodyExt;
        1479  +
        let body = http_response
        1480  +
            .into_body()
        1481  +
            .collect()
 1420   1482   
            .await
 1421         -
            .expect("unable to extract body to bytes");
        1483  +
            .expect("unable to collect body")
        1484  +
            .to_bytes();
 1422   1485   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1423   1486   
            &body,
 1424   1487   
            "{}",
 1425   1488   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1426   1489   
        ));
 1427   1490   
    }
 1428   1491   
}
 1429   1492   
 1430   1493   
::pin_project_lite::pin_project! {
 1431   1494   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1432   1495   
    /// [`EnumQueryInput`](crate::input::EnumQueryInput) using modelled bindings.
 1433   1496   
    pub struct EnumQueryInputFuture {
 1434   1497   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EnumQueryInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 1435   1498   
    }
 1436   1499   
}
 1437   1500   
 1438   1501   
impl std::future::Future for EnumQueryInputFuture {
 1439   1502   
    type Output = Result<
 1440   1503   
        crate::input::EnumQueryInput,
 1441   1504   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
 1442   1505   
    >;
 1443   1506   
 1444   1507   
    fn poll(
 1445   1508   
        self: std::pin::Pin<&mut Self>,
 1446   1509   
        cx: &mut std::task::Context<'_>,
 1447   1510   
    ) -> std::task::Poll<Self::Output> {
 1448   1511   
        let this = self.project();
 1449   1512   
        this.inner.as_mut().poll(cx)
 1450   1513   
    }
 1451   1514   
}
 1452   1515   
 1453   1516   
impl<B>
 1454   1517   
    ::aws_smithy_http_server::request::FromRequest<
 1455   1518   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1456   1519   
        B,
 1457   1520   
    > for crate::input::EnumQueryInput
 1458   1521   
where
 1459   1522   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1460   1523   
    B: 'static,
 1461   1524   
 1462   1525   
    B::Data: Send,
 1463   1526   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1464   1527   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1465   1528   
{
 1466   1529   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1467   1530   
    type Future = EnumQueryInputFuture;
 1468   1531   
 1469         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1532  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1470   1533   
        let fut = async move {
 1471   1534   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1472   1535   
                request.headers(),
 1473   1536   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1474   1537   
            ) {
 1475   1538   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1476   1539   
            }
 1477   1540   
            crate::protocol_serde::shape_enum_query::de_enum_query_http_request(request).await
 1478   1541   
        };
 1479   1542   
        use ::futures_util::future::TryFutureExt;
@@ -1508,1571 +1673,1746 @@
 1528   1591   
 1529   1592   
#[allow(unreachable_code, unused_variables)]
 1530   1593   
#[cfg(test)]
 1531   1594   
mod enum_query_test {
 1532   1595   
 1533   1596   
    /// Test ID: EnumQueryRequest
 1534   1597   
    #[::tokio::test]
 1535   1598   
    #[::tracing_test::traced_test]
 1536   1599   
    async fn enum_query_request_request() {
 1537   1600   
        #[allow(unused_mut)]
 1538         -
        let mut http_request = http::Request::builder()
        1601  +
        let mut http_request = ::http_1x::Request::builder()
 1539   1602   
            .uri("/foo/enumvalue")
 1540   1603   
            .method("GET")
 1541         -
            .body(::aws_smithy_http_server::body::Body::empty())
        1604  +
            .body(::aws_smithy_http_server::body::boxed(
        1605  +
                ::http_body_util::Empty::new(),
        1606  +
            ))
 1542   1607   
            .unwrap();
 1543   1608   
        #[allow(unused_mut)]
 1544   1609   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1545   1610   
        let config = crate::service::RestJsonExtrasConfig::builder().build();
 1546         -
        let service =
 1547         -
            crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
        1611  +
        let service = crate::service::RestJsonExtras::builder::<
        1612  +
            ::aws_smithy_http_server::body::BoxBody,
        1613  +
            _,
        1614  +
            _,
        1615  +
            _,
        1616  +
        >(config)
 1548   1617   
        .enum_query(move |input: crate::input::EnumQueryInput| {
 1549   1618   
            let sender = sender.clone();
 1550   1619   
            async move {
 1551   1620   
                let result = {
 1552   1621   
                    let expected = crate::input::EnumQueryInput {
 1553   1622   
                        r#enum: "enumvalue"
 1554   1623   
                            .parse::<crate::model::StringEnum>()
 1555   1624   
                            .expect("static value validated to member"),
 1556   1625   
                    };
 1557   1626   
                    ::pretty_assertions::assert_eq!(input, expected);
 1558   1627   
                    let output = crate::output::EnumQueryOutput {};
 1559   1628   
                    Ok(output)
 1560   1629   
                };
 1561   1630   
                sender.send(()).await.expect("receiver dropped early");
 1562   1631   
                result
 1563   1632   
            }
 1564   1633   
        })
 1565   1634   
        .build_unchecked();
 1566   1635   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1567   1636   
            .await
 1568   1637   
            .expect("unable to make an HTTP request");
 1569   1638   
        assert!(
 1570   1639   
            receiver.recv().await.is_some(),
 1571   1640   
            "we expected operation handler to be invoked but it was not entered"
 1572   1641   
        );
 1573   1642   
    }
 1574   1643   
 1575   1644   
    /// Upper case error modeled lower case.
 1576   1645   
    /// Test ID: ServiceLevelErrorServer
 1577   1646   
    #[::tokio::test]
 1578   1647   
    #[::tracing_test::traced_test]
 1579   1648   
    async fn service_level_error_server_response() {
 1580   1649   
        let output = crate::error::ExtraError {};
 1581   1650   
        let output = crate::error::EnumQueryError::ExtraError(output);
 1582   1651   
        use ::aws_smithy_http_server::response::IntoResponse;
 1583   1652   
        let http_response = output.into_response();
 1584   1653   
        ::pretty_assertions::assert_eq!(
 1585         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
        1654  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
 1586   1655   
            http_response.status()
 1587   1656   
        );
 1588   1657   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
 1589   1658   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1590   1659   
            http_response.headers(),
 1591   1660   
            expected_headers,
 1592   1661   
        ));
 1593         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1662  +
        use ::http_body_util::BodyExt;
        1663  +
        let body = http_response
        1664  +
            .into_body()
        1665  +
            .collect()
 1594   1666   
            .await
 1595         -
            .expect("unable to extract body to bytes");
        1667  +
            .expect("unable to collect body")
        1668  +
            .to_bytes();
 1596   1669   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1597   1670   
            &body,
 1598   1671   
            "{}",
 1599   1672   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1600   1673   
        ));
 1601   1674   
    }
 1602   1675   
}
 1603   1676   
 1604   1677   
::pin_project_lite::pin_project! {
 1605   1678   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1606   1679   
    /// [`PrimitiveIntHeaderInput`](crate::input::PrimitiveIntHeaderInput) using modelled bindings.
 1607   1680   
    pub struct PrimitiveIntHeaderInputFuture {
 1608   1681   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PrimitiveIntHeaderInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 1609   1682   
    }
 1610   1683   
}
 1611   1684   
 1612   1685   
impl std::future::Future for PrimitiveIntHeaderInputFuture {
 1613   1686   
    type Output = Result<
 1614   1687   
        crate::input::PrimitiveIntHeaderInput,
 1615   1688   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
 1616   1689   
    >;
 1617   1690   
 1618   1691   
    fn poll(
 1619   1692   
        self: std::pin::Pin<&mut Self>,
 1620   1693   
        cx: &mut std::task::Context<'_>,
 1621   1694   
    ) -> std::task::Poll<Self::Output> {
 1622   1695   
        let this = self.project();
 1623   1696   
        this.inner.as_mut().poll(cx)
 1624   1697   
    }
 1625   1698   
}
 1626   1699   
 1627   1700   
impl<B>
 1628   1701   
    ::aws_smithy_http_server::request::FromRequest<
 1629   1702   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1630   1703   
        B,
 1631   1704   
    > for crate::input::PrimitiveIntHeaderInput
 1632   1705   
where
 1633   1706   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1634   1707   
    B: 'static,
 1635   1708   
 1636   1709   
    B::Data: Send,
 1637   1710   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1638   1711   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1639   1712   
{
 1640   1713   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1641   1714   
    type Future = PrimitiveIntHeaderInputFuture;
 1642   1715   
 1643         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1716  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1644   1717   
        let fut = async move {
 1645   1718   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1646   1719   
                request.headers(),
 1647   1720   
                &crate::mimes::CONTENT_TYPE_APPLICATION_JSON,
 1648   1721   
            ) {
 1649   1722   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1650   1723   
            }
 1651   1724   
            crate::protocol_serde::shape_primitive_int_header::de_primitive_int_header_http_request(
 1652   1725   
                request,
 1653   1726   
            )
@@ -1690,1763 +1840,1917 @@
 1710   1783   
mod primitive_int_header_test {
 1711   1784   
 1712   1785   
    /// Test ID: DeserPrimitiveHeader
 1713   1786   
    #[::tokio::test]
 1714   1787   
    #[::tracing_test::traced_test]
 1715   1788   
    async fn deser_primitive_header_response() {
 1716   1789   
        let output = crate::output::PrimitiveIntHeaderOutput { field: 123 };
 1717   1790   
        use ::aws_smithy_http_server::response::IntoResponse;
 1718   1791   
        let http_response = output.into_response();
 1719   1792   
        ::pretty_assertions::assert_eq!(
 1720         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1793  +
            ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1721   1794   
            http_response.status()
 1722   1795   
        );
 1723   1796   
        let expected_headers = [("x-field", "123")];
 1724   1797   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1725   1798   
            http_response.headers(),
 1726   1799   
            expected_headers,
 1727   1800   
        ));
 1728   1801   
    }
 1729   1802   
    /// Test ID: DeserPrimitiveHeaderMissing
 1730   1803   
    #[::tokio::test]
 1731   1804   
    #[::tracing_test::traced_test]
 1732   1805   
    async fn deser_primitive_header_missing_response() {
 1733   1806   
        let output = crate::output::PrimitiveIntHeaderOutput { field: 0 };
 1734   1807   
        use ::aws_smithy_http_server::response::IntoResponse;
 1735   1808   
        let http_response = output.into_response();
 1736   1809   
        ::pretty_assertions::assert_eq!(
 1737         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1810  +
            ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1738   1811   
            http_response.status()
 1739   1812   
        );
 1740   1813   
    }
 1741   1814   
 1742   1815   
    /// Upper case error modeled lower case.
 1743   1816   
    /// Test ID: ServiceLevelErrorServer
 1744   1817   
    #[::tokio::test]
 1745   1818   
    #[::tracing_test::traced_test]
 1746   1819   
    async fn service_level_error_server_response() {
 1747   1820   
        let output = crate::error::ExtraError {};
 1748   1821   
        let output = crate::error::PrimitiveIntHeaderError::ExtraError(output);
 1749   1822   
        use ::aws_smithy_http_server::response::IntoResponse;
 1750   1823   
        let http_response = output.into_response();
 1751   1824   
        ::pretty_assertions::assert_eq!(
 1752         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
        1825  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
 1753   1826   
            http_response.status()
 1754   1827   
        );
 1755   1828   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
 1756   1829   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1757   1830   
            http_response.headers(),
 1758   1831   
            expected_headers,
 1759   1832   
        ));
 1760         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        1833  +
        use ::http_body_util::BodyExt;
        1834  +
        let body = http_response
        1835  +
            .into_body()
        1836  +
            .collect()
 1761   1837   
            .await
 1762         -
            .expect("unable to extract body to bytes");
        1838  +
            .expect("unable to collect body")
        1839  +
            .to_bytes();
 1763   1840   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1764   1841   
            &body,
 1765   1842   
            "{}",
 1766   1843   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1767   1844   
        ));
 1768   1845   
    }
 1769   1846   
}
 1770   1847   
 1771   1848   
::pin_project_lite::pin_project! {
 1772   1849   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1773   1850   
    /// [`StringPayloadInput`](crate::input::StringPayloadInput) using modelled bindings.
 1774   1851   
    pub struct StringPayloadInputFuture {
 1775   1852   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StringPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 1776   1853   
    }
 1777   1854   
}
 1778   1855   
 1779   1856   
impl std::future::Future for StringPayloadInputFuture {
 1780   1857   
    type Output = Result<
 1781   1858   
        crate::input::StringPayloadInput,
 1782   1859   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
 1783   1860   
    >;
 1784   1861   
 1785   1862   
    fn poll(
 1786   1863   
        self: std::pin::Pin<&mut Self>,
 1787   1864   
        cx: &mut std::task::Context<'_>,
 1788   1865   
    ) -> std::task::Poll<Self::Output> {
 1789   1866   
        let this = self.project();
 1790   1867   
        this.inner.as_mut().poll(cx)
 1791   1868   
    }
 1792   1869   
}
 1793   1870   
 1794   1871   
impl<B>
 1795   1872   
    ::aws_smithy_http_server::request::FromRequest<
 1796   1873   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1797   1874   
        B,
 1798   1875   
    > for crate::input::StringPayloadInput
 1799   1876   
where
 1800   1877   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
 1801   1878   
    B: 'static,
 1802   1879   
 1803   1880   
    B::Data: Send,
 1804   1881   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
 1805   1882   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
 1806   1883   
{
 1807   1884   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
 1808   1885   
    type Future = StringPayloadInputFuture;
 1809   1886   
 1810         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1887  +
    fn from_request(request: ::http_1x::Request<B>) -> Self::Future {
 1811   1888   
        let fut = async move {
 1812   1889   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1813   1890   
                request.headers(),
 1814   1891   
                &crate::mimes::CONTENT_TYPE_TEXT_PLAIN,
 1815   1892   
            ) {
 1816   1893   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1817   1894   
            }
 1818   1895   
            crate::protocol_serde::shape_string_payload::de_string_payload_http_request(request)
 1819   1896   
                .await
 1820   1897   
        };
@@ -1850,1927 +1950,2037 @@
 1870   1947   
 1871   1948   
#[allow(unreachable_code, unused_variables)]
 1872   1949   
#[cfg(test)]
 1873   1950   
mod string_payload_test {
 1874   1951   
 1875   1952   
    /// Test ID: StringPayload
 1876   1953   
    #[::tokio::test]
 1877   1954   
    #[::tracing_test::traced_test]
 1878   1955   
    async fn string_payload_request() {
 1879   1956   
        #[allow(unused_mut)]
 1880         -
        let mut http_request = http::Request::builder()
        1957  +
        let mut http_request = ::http_1x::Request::builder()
 1881   1958   
            .uri("/StringPayload")
 1882   1959   
            .method("POST")
 1883   1960   
            .header("Content-Type", "text/plain")
 1884         -
            .body(::aws_smithy_http_server::body::Body::from(
 1885         -
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
        1961  +
            .body(::aws_smithy_http_server::body::boxed(
        1962  +
                ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
        1963  +
                    &::aws_smithy_protocol_test::decode_body_data(
 1886   1964   
                        "rawstring".as_bytes(),
 1887   1965   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
        1966  +
                    ),
 1888   1967   
                )),
 1889   1968   
            ))
 1890   1969   
            .unwrap();
 1891   1970   
        #[allow(unused_mut)]
 1892   1971   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1893   1972   
        let config = crate::service::RestJsonExtrasConfig::builder().build();
 1894         -
        let service =
 1895         -
            crate::service::RestJsonExtras::builder::<::hyper::body::Body, _, _, _>(config)
        1973  +
        let service = crate::service::RestJsonExtras::builder::<
        1974  +
            ::aws_smithy_http_server::body::BoxBody,
        1975  +
            _,
        1976  +
            _,
        1977  +
            _,
        1978  +
        >(config)
 1896   1979   
        .string_payload(move |input: crate::input::StringPayloadInput| {
 1897   1980   
            let sender = sender.clone();
 1898   1981   
            async move {
 1899   1982   
                let result = {
 1900   1983   
                    let expected = crate::input::StringPayloadInput {
 1901   1984   
                        payload: ::std::option::Option::Some("rawstring".to_owned()),
 1902   1985   
                    };
 1903   1986   
                    ::pretty_assertions::assert_eq!(input, expected);
 1904   1987   
                    let output = crate::output::StringPayloadOutput {
 1905   1988   
                        payload: ::std::option::Option::None,
 1906   1989   
                    };
 1907   1990   
                    Ok(output)
 1908   1991   
                };
 1909   1992   
                sender.send(()).await.expect("receiver dropped early");
 1910   1993   
                result
 1911   1994   
            }
 1912   1995   
        })
 1913   1996   
        .build_unchecked();
 1914   1997   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1915   1998   
            .await
 1916   1999   
            .expect("unable to make an HTTP request");
 1917   2000   
        assert!(
 1918   2001   
            receiver.recv().await.is_some(),
 1919   2002   
            "we expected operation handler to be invoked but it was not entered"
 1920   2003   
        );
 1921   2004   
    }
 1922   2005   
 1923   2006   
    /// Upper case error modeled lower case.
 1924   2007   
    /// Test ID: ServiceLevelErrorServer
 1925   2008   
    #[::tokio::test]
 1926   2009   
    #[::tracing_test::traced_test]
 1927   2010   
    async fn service_level_error_server_response() {
 1928   2011   
        let output = crate::error::ExtraError {};
 1929   2012   
        let output = crate::error::StringPayloadError::ExtraError(output);
 1930   2013   
        use ::aws_smithy_http_server::response::IntoResponse;
 1931   2014   
        let http_response = output.into_response();
 1932   2015   
        ::pretty_assertions::assert_eq!(
 1933         -
            http::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
        2016  +
            ::http_1x::StatusCode::from_u16(500).expect("invalid expected HTTP status code"),
 1934   2017   
            http_response.status()
 1935   2018   
        );
 1936   2019   
        let expected_headers = [("X-Amzn-Errortype", "ExtraError")];
 1937   2020   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1938   2021   
            http_response.headers(),
 1939   2022   
            expected_headers,
 1940   2023   
        ));
 1941         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        2024  +
        use ::http_body_util::BodyExt;
        2025  +
        let body = http_response
        2026  +
            .into_body()
        2027  +
            .collect()
 1942   2028   
            .await
 1943         -
            .expect("unable to extract body to bytes");
        2029  +
            .expect("unable to collect body")
        2030  +
            .to_bytes();
 1944   2031   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1945   2032   
            &body,
 1946   2033   
            "{}",
 1947   2034   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 1948   2035   
        ));
 1949   2036   
    }
 1950   2037   
}

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_case_insensitive_error_operation.rs

@@ -1,1 +116,116 @@
    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_case_insensitive_error_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::CaseInsensitiveErrorOperationInput,
    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::case_insensitive_error_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   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
   23     23   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_case_insensitive_error_operation_http_response(
   29     29   
    #[allow(unused_variables)] output: crate::output::CaseInsensitiveErrorOperationOutput,
   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 = 200;
   43     43   
        builder = builder.status(http_status);
   44     44   
        let payload = "";
   45     45   
        let content_length = payload.len();
   46     46   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   47     47   
            builder,
   48         -
            ::http::header::CONTENT_LENGTH,
          48  +
            ::http_1x::header::CONTENT_LENGTH,
   49     49   
            content_length,
   50     50   
        );
   51     51   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   52     52   
        builder.body(body)?
   53     53   
    })
   54     54   
}
   55     55   
   56     56   
#[allow(clippy::unnecessary_wraps)]
   57     57   
pub fn ser_case_insensitive_error_operation_http_error(
   58     58   
    error: &crate::error::CaseInsensitiveErrorOperationError,
   59     59   
) -> std::result::Result<
   60     60   
    ::aws_smithy_http_server::response::Response,
   61     61   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   62     62   
> {
   63     63   
    Ok({
   64     64   
        match error {
   65     65   
            crate::error::CaseInsensitiveErrorOperationError::CaseInsensitiveError(output) => {
   66     66   
                let payload = crate::protocol_serde::shape_case_insensitive_error::ser_case_insensitive_error_error(output)?;
   67     67   
                #[allow(unused_mut)]
   68         -
                let mut builder = ::http::Response::builder();
          68  +
                let mut builder = ::http_1x::Response::builder();
   69     69   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   70     70   
                    builder,
   71         -
                    ::http::header::CONTENT_TYPE,
          71  +
                    ::http_1x::header::CONTENT_TYPE,
   72     72   
                    "application/json",
   73     73   
                );
   74     74   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   75     75   
                    builder,
   76         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          76  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   77     77   
                    "CaseInsensitiveError",
   78     78   
                );
   79     79   
                let content_length = payload.len();
   80     80   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81     81   
                    builder,
   82         -
                    ::http::header::CONTENT_LENGTH,
          82  +
                    ::http_1x::header::CONTENT_LENGTH,
   83     83   
                    content_length,
   84     84   
                );
   85     85   
                builder
   86     86   
                    .status(500)
   87     87   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   88     88   
            }
   89     89   
            crate::error::CaseInsensitiveErrorOperationError::ExtraError(output) => {
   90     90   
                let payload =
   91     91   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   92     92   
                #[allow(unused_mut)]
   93         -
                let mut builder = ::http::Response::builder();
          93  +
                let mut builder = ::http_1x::Response::builder();
   94     94   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   95     95   
                    builder,
   96         -
                    ::http::header::CONTENT_TYPE,
          96  +
                    ::http_1x::header::CONTENT_TYPE,
   97     97   
                    "application/json",
   98     98   
                );
   99     99   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  100    100   
                    builder,
  101         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         101  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  102    102   
                    "ExtraError",
  103    103   
                );
  104    104   
                let content_length = payload.len();
  105    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  106    106   
                    builder,
  107         -
                    ::http::header::CONTENT_LENGTH,
         107  +
                    ::http_1x::header::CONTENT_LENGTH,
  108    108   
                    content_length,
  109    109   
                );
  110    110   
                builder
  111    111   
                    .status(500)
  112    112   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  113    113   
            }
  114    114   
        }
  115    115   
    })
  116    116   
}

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_empty_struct_with_content_on_wire_op.rs

@@ -1,1 +95,95 @@
    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_empty_struct_with_content_on_wire_op_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::EmptyStructWithContentOnWireOpInput,
    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::empty_struct_with_content_on_wire_op_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   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
   24     24   
        input.build()
   25     25   
    })
   26     26   
}
   27     27   
   28     28   
#[allow(clippy::unnecessary_wraps)]
   29     29   
pub fn ser_empty_struct_with_content_on_wire_op_http_response(
   30     30   
    #[allow(unused_variables)] output: crate::output::EmptyStructWithContentOnWireOpOutput,
   31     31   
) -> std::result::Result<
   32     32   
    ::aws_smithy_http_server::response::Response,
   33     33   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   34     34   
> {
   35     35   
    Ok({
   36     36   
        #[allow(unused_mut)]
   37         -
        let mut builder = ::http::Response::builder();
          37  +
        let mut builder = ::http_1x::Response::builder();
   38     38   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   39     39   
            builder,
   40         -
            ::http::header::CONTENT_TYPE,
          40  +
            ::http_1x::header::CONTENT_TYPE,
   41     41   
            "application/json",
   42     42   
        );
   43     43   
        let http_status: u16 = 200;
   44     44   
        builder = builder.status(http_status);
   45     45   
        let payload =
   46     46   
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op_output::ser_empty_struct_with_content_on_wire_op_output_output_output(&output)?
   47     47   
        ;
   48     48   
        let content_length = payload.len();
   49     49   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51         -
            ::http::header::CONTENT_LENGTH,
          51  +
            ::http_1x::header::CONTENT_LENGTH,
   52     52   
            content_length,
   53     53   
        );
   54     54   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   55     55   
        builder.body(body)?
   56     56   
    })
   57     57   
}
   58     58   
   59     59   
#[allow(clippy::unnecessary_wraps)]
   60     60   
pub fn ser_empty_struct_with_content_on_wire_op_http_error(
   61     61   
    error: &crate::error::EmptyStructWithContentOnWireOpError,
   62     62   
) -> std::result::Result<
   63     63   
    ::aws_smithy_http_server::response::Response,
   64     64   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     65   
> {
   66     66   
    Ok({
   67     67   
        match error {
   68     68   
            crate::error::EmptyStructWithContentOnWireOpError::ExtraError(output) => {
   69     69   
                let payload =
   70     70   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   71     71   
                #[allow(unused_mut)]
   72         -
                let mut builder = ::http::Response::builder();
          72  +
                let mut builder = ::http_1x::Response::builder();
   73     73   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   74     74   
                    builder,
   75         -
                    ::http::header::CONTENT_TYPE,
          75  +
                    ::http_1x::header::CONTENT_TYPE,
   76     76   
                    "application/json",
   77     77   
                );
   78     78   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79     79   
                    builder,
   80         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          80  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   81     81   
                    "ExtraError",
   82     82   
                );
   83     83   
                let content_length = payload.len();
   84     84   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     85   
                    builder,
   86         -
                    ::http::header::CONTENT_LENGTH,
          86  +
                    ::http_1x::header::CONTENT_LENGTH,
   87     87   
                    content_length,
   88     88   
                );
   89     89   
                builder
   90     90   
                    .status(500)
   91     91   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   92     92   
            }
   93     93   
        }
   94     94   
    })
   95     95   
}

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_enum_query.rs

@@ -1,1 +132,132 @@
    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_enum_query_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::EnumQueryInput,
    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::enum_query_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   
        let input_string = uri.path();
   23     23   
        let (input_string, (_, m1)) =
   24     24   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     25   
                ::nom::sequence::preceded(
   26     26   
                    ::nom::bytes::complete::tag("/"),
   27     27   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("foo"),
   28     28   
                ),
   29     29   
                ::nom::sequence::preceded(
   30     30   
                    ::nom::bytes::complete::tag("/"),
   31     31   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   32     32   
                        ::nom::bytes::complete::take_until("/"),
   33     33   
                        ::nom::combinator::rest,
   34     34   
                    )),
   35     35   
                ),
   36     36   
            ))(input_string)?;
   37     37   
        debug_assert_eq!("", input_string);
   38     38   
        input = input.set_enum(crate::protocol_serde::shape_enum_query_input::de_enum(m1)?);
   39     39   
        input.build()?
   40     40   
    })
   41     41   
}
   42     42   
   43     43   
#[allow(clippy::unnecessary_wraps)]
   44     44   
pub fn ser_enum_query_http_response(
   45     45   
    #[allow(unused_variables)] output: crate::output::EnumQueryOutput,
   46     46   
) -> std::result::Result<
   47     47   
    ::aws_smithy_http_server::response::Response,
   48     48   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   49     49   
> {
   50     50   
    Ok({
   51     51   
        #[allow(unused_mut)]
   52         -
        let mut builder = ::http::Response::builder();
          52  +
        let mut builder = ::http_1x::Response::builder();
   53     53   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     54   
            builder,
   55         -
            ::http::header::CONTENT_TYPE,
          55  +
            ::http_1x::header::CONTENT_TYPE,
   56     56   
            "application/json",
   57     57   
        );
   58     58   
        let http_status: u16 = 200;
   59     59   
        builder = builder.status(http_status);
   60     60   
        let payload = "";
   61     61   
        let content_length = payload.len();
   62     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     63   
            builder,
   64         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   65     65   
            content_length,
   66     66   
        );
   67     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   68     68   
        builder.body(body)?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_enum_query_http_error(
   74     74   
    error: &crate::error::EnumQueryError,
   75     75   
) -> std::result::Result<
   76     76   
    ::aws_smithy_http_server::response::Response,
   77     77   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78     78   
> {
   79     79   
    Ok({
   80     80   
        match error {
   81     81   
            crate::error::EnumQueryError::ValidationException(output) => {
   82     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   85     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86     86   
                    builder,
   87         -
                    ::http::header::CONTENT_TYPE,
          87  +
                    ::http_1x::header::CONTENT_TYPE,
   88     88   
                    "application/json",
   89     89   
                );
   90     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     91   
                    builder,
   92         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          92  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                    "ValidationException",
   94     94   
                );
   95     95   
                let content_length = payload.len();
   96     96   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98         -
                    ::http::header::CONTENT_LENGTH,
          98  +
                    ::http_1x::header::CONTENT_LENGTH,
   99     99   
                    content_length,
  100    100   
                );
  101    101   
                builder
  102    102   
                    .status(400)
  103    103   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  104    104   
            }
  105    105   
            crate::error::EnumQueryError::ExtraError(output) => {
  106    106   
                let payload =
  107    107   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
  108    108   
                #[allow(unused_mut)]
  109         -
                let mut builder = ::http::Response::builder();
         109  +
                let mut builder = ::http_1x::Response::builder();
  110    110   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  111    111   
                    builder,
  112         -
                    ::http::header::CONTENT_TYPE,
         112  +
                    ::http_1x::header::CONTENT_TYPE,
  113    113   
                    "application/json",
  114    114   
                );
  115    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  116    116   
                    builder,
  117         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         117  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  118    118   
                    "ExtraError",
  119    119   
                );
  120    120   
                let content_length = payload.len();
  121    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  122    122   
                    builder,
  123         -
                    ::http::header::CONTENT_LENGTH,
         123  +
                    ::http_1x::header::CONTENT_LENGTH,
  124    124   
                    content_length,
  125    125   
                );
  126    126   
                builder
  127    127   
                    .status(500)
  128    128   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  129    129   
            }
  130    130   
        }
  131    131   
    })
  132    132   
}

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_escaped_string_values.rs

@@ -1,1 +149,152 @@
    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_escaped_string_values_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::EscapedStringValuesInput,
    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::escaped_string_values_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_escaped_string_values::de_escaped_string_values(
   29     32   
                bytes.as_ref(),
   30     33   
                input,
   31     34   
            )?;
   32     35   
        }
   33     36   
        input.build()?
   34     37   
    })
   35     38   
}
   36     39   
   37     40   
#[allow(clippy::unnecessary_wraps)]
   38     41   
pub fn ser_escaped_string_values_http_response(
   39     42   
    #[allow(unused_variables)] output: crate::output::EscapedStringValuesOutput,
   40     43   
) -> std::result::Result<
   41     44   
    ::aws_smithy_http_server::response::Response,
   42     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     46   
> {
   44     47   
    Ok({
   45     48   
        #[allow(unused_mut)]
   46         -
        let mut builder = ::http::Response::builder();
          49  +
        let mut builder = ::http_1x::Response::builder();
   47     50   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     51   
            builder,
   49         -
            ::http::header::CONTENT_TYPE,
          52  +
            ::http_1x::header::CONTENT_TYPE,
   50     53   
            "application/json",
   51     54   
        );
   52     55   
        let http_status: u16 = 200;
   53     56   
        builder = builder.status(http_status);
   54     57   
        let payload =
   55     58   
            crate::protocol_serde::shape_escaped_string_values_output::ser_escaped_string_values_output_output_output(&output)?
   56     59   
        ;
   57     60   
        let content_length = payload.len();
   58     61   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     62   
            builder,
   60         -
            ::http::header::CONTENT_LENGTH,
          63  +
            ::http_1x::header::CONTENT_LENGTH,
   61     64   
            content_length,
   62     65   
        );
   63     66   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   64     67   
        builder.body(body)?
   65     68   
    })
   66     69   
}
   67     70   
   68     71   
#[allow(clippy::unnecessary_wraps)]
   69     72   
pub fn ser_escaped_string_values_http_error(
   70     73   
    error: &crate::error::EscapedStringValuesError,
   71     74   
) -> std::result::Result<
   72     75   
    ::aws_smithy_http_server::response::Response,
   73     76   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     77   
> {
   75     78   
    Ok({
   76     79   
        match error {
   77     80   
            crate::error::EscapedStringValuesError::ValidationException(output) => {
   78     81   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   79     82   
                #[allow(unused_mut)]
   80         -
                let mut builder = ::http::Response::builder();
          83  +
                let mut builder = ::http_1x::Response::builder();
   81     84   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82     85   
                    builder,
   83         -
                    ::http::header::CONTENT_TYPE,
          86  +
                    ::http_1x::header::CONTENT_TYPE,
   84     87   
                    "application/json",
   85     88   
                );
   86     89   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87     90   
                    builder,
   88         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          91  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   89     92   
                    "ValidationException",
   90     93   
                );
   91     94   
                let content_length = payload.len();
   92     95   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93     96   
                    builder,
   94         -
                    ::http::header::CONTENT_LENGTH,
          97  +
                    ::http_1x::header::CONTENT_LENGTH,
   95     98   
                    content_length,
   96     99   
                );
   97    100   
                builder
   98    101   
                    .status(400)
   99    102   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  100    103   
            }
  101    104   
            crate::error::EscapedStringValuesError::ExtraError(output) => {
  102    105   
                let payload =
  103    106   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
  104    107   
                #[allow(unused_mut)]
  105         -
                let mut builder = ::http::Response::builder();
         108  +
                let mut builder = ::http_1x::Response::builder();
  106    109   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    110   
                    builder,
  108         -
                    ::http::header::CONTENT_TYPE,
         111  +
                    ::http_1x::header::CONTENT_TYPE,
  109    112   
                    "application/json",
  110    113   
                );
  111    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    115   
                    builder,
  113         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         116  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  114    117   
                    "ExtraError",
  115    118   
                );
  116    119   
                let content_length = payload.len();
  117    120   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    121   
                    builder,
  119         -
                    ::http::header::CONTENT_LENGTH,
         122  +
                    ::http_1x::header::CONTENT_LENGTH,
  120    123   
                    content_length,
  121    124   
                );
  122    125   
                builder
  123    126   
                    .status(500)
  124    127   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  125    128   
            }
  126    129   
        }
  127    130   
    })
  128    131   
}
  129    132   

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_http_query_params_only_operation.rs

@@ -1,1 +103,103 @@
    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_http_query_params_only_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::HttpQueryParamsOnlyOperationInput,
    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::http_query_params_only_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   
        let query_string = uri.query().unwrap_or("");
   23     23   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24     24   
        let mut query_params: ::std::collections::HashMap<
   25     25   
            ::std::string::String,
   26     26   
            ::std::string::String,
   27     27   
        > = ::std::collections::HashMap::new();
   28     28   
        for (k, v) in pairs {
   29     29   
            query_params
   30     30   
                .entry(String::from(k))
   31     31   
                .or_insert_with(|| String::from(v));
   32     32   
        }
   33     33   
        input = input.set_query_map(Some(query_params));
   34     34   
        input.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
#[allow(clippy::unnecessary_wraps)]
   39     39   
pub fn ser_http_query_params_only_operation_http_response(
   40     40   
    #[allow(unused_variables)] output: crate::output::HttpQueryParamsOnlyOperationOutput,
   41     41   
) -> std::result::Result<
   42     42   
    ::aws_smithy_http_server::response::Response,
   43     43   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   44     44   
> {
   45     45   
    Ok({
   46     46   
        #[allow(unused_mut)]
   47         -
        let mut builder = ::http::Response::builder();
          47  +
        let mut builder = ::http_1x::Response::builder();
   48     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50         -
            ::http::header::CONTENT_TYPE,
          50  +
            ::http_1x::header::CONTENT_TYPE,
   51     51   
            "application/json",
   52     52   
        );
   53     53   
        let http_status: u16 = 200;
   54     54   
        builder = builder.status(http_status);
   55     55   
        let payload = "";
   56     56   
        let content_length = payload.len();
   57     57   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   58     58   
            builder,
   59         -
            ::http::header::CONTENT_LENGTH,
          59  +
            ::http_1x::header::CONTENT_LENGTH,
   60     60   
            content_length,
   61     61   
        );
   62     62   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   63     63   
        builder.body(body)?
   64     64   
    })
   65     65   
}
   66     66   
   67     67   
#[allow(clippy::unnecessary_wraps)]
   68     68   
pub fn ser_http_query_params_only_operation_http_error(
   69     69   
    error: &crate::error::HttpQueryParamsOnlyOperationError,
   70     70   
) -> std::result::Result<
   71     71   
    ::aws_smithy_http_server::response::Response,
   72     72   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   73     73   
> {
   74     74   
    Ok({
   75     75   
        match error {
   76     76   
            crate::error::HttpQueryParamsOnlyOperationError::ExtraError(output) => {
   77     77   
                let payload =
   78     78   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   79     79   
                #[allow(unused_mut)]
   80         -
                let mut builder = ::http::Response::builder();
          80  +
                let mut builder = ::http_1x::Response::builder();
   81     81   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82     82   
                    builder,
   83         -
                    ::http::header::CONTENT_TYPE,
          83  +
                    ::http_1x::header::CONTENT_TYPE,
   84     84   
                    "application/json",
   85     85   
                );
   86     86   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          88  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   89     89   
                    "ExtraError",
   90     90   
                );
   91     91   
                let content_length = payload.len();
   92     92   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94         -
                    ::http::header::CONTENT_LENGTH,
          94  +
                    ::http_1x::header::CONTENT_LENGTH,
   95     95   
                    content_length,
   96     96   
                );
   97     97   
                builder
   98     98   
                    .status(500)
   99     99   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  100    100   
            }
  101    101   
        }
  102    102   
    })
  103    103   
}

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_map_with_enum_key_op.rs

@@ -1,1 +149,152 @@
    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_map_with_enum_key_op_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::MapWithEnumKeyOpInput,
    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::map_with_enum_key_op_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_map_with_enum_key_op::de_map_with_enum_key_op(
   29     32   
                bytes.as_ref(),
   30     33   
                input,
   31     34   
            )?;
   32     35   
        }
   33     36   
        input.build()?
   34     37   
    })
   35     38   
}
   36     39   
   37     40   
#[allow(clippy::unnecessary_wraps)]
   38     41   
pub fn ser_map_with_enum_key_op_http_response(
   39     42   
    #[allow(unused_variables)] output: crate::output::MapWithEnumKeyOpOutput,
   40     43   
) -> std::result::Result<
   41     44   
    ::aws_smithy_http_server::response::Response,
   42     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     46   
> {
   44     47   
    Ok({
   45     48   
        #[allow(unused_mut)]
   46         -
        let mut builder = ::http::Response::builder();
          49  +
        let mut builder = ::http_1x::Response::builder();
   47     50   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     51   
            builder,
   49         -
            ::http::header::CONTENT_TYPE,
          52  +
            ::http_1x::header::CONTENT_TYPE,
   50     53   
            "application/json",
   51     54   
        );
   52     55   
        let http_status: u16 = 200;
   53     56   
        builder = builder.status(http_status);
   54     57   
        let payload =
   55     58   
            crate::protocol_serde::shape_map_with_enum_key_op_output::ser_map_with_enum_key_op_output_output_output(&output)?
   56     59   
        ;
   57     60   
        let content_length = payload.len();
   58     61   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     62   
            builder,
   60         -
            ::http::header::CONTENT_LENGTH,
          63  +
            ::http_1x::header::CONTENT_LENGTH,
   61     64   
            content_length,
   62     65   
        );
   63     66   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   64     67   
        builder.body(body)?
   65     68   
    })
   66     69   
}
   67     70   
   68     71   
#[allow(clippy::unnecessary_wraps)]
   69     72   
pub fn ser_map_with_enum_key_op_http_error(
   70     73   
    error: &crate::error::MapWithEnumKeyOpError,
   71     74   
) -> std::result::Result<
   72     75   
    ::aws_smithy_http_server::response::Response,
   73     76   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     77   
> {
   75     78   
    Ok({
   76     79   
        match error {
   77     80   
            crate::error::MapWithEnumKeyOpError::ValidationException(output) => {
   78     81   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   79     82   
                #[allow(unused_mut)]
   80         -
                let mut builder = ::http::Response::builder();
          83  +
                let mut builder = ::http_1x::Response::builder();
   81     84   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82     85   
                    builder,
   83         -
                    ::http::header::CONTENT_TYPE,
          86  +
                    ::http_1x::header::CONTENT_TYPE,
   84     87   
                    "application/json",
   85     88   
                );
   86     89   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87     90   
                    builder,
   88         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          91  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   89     92   
                    "ValidationException",
   90     93   
                );
   91     94   
                let content_length = payload.len();
   92     95   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93     96   
                    builder,
   94         -
                    ::http::header::CONTENT_LENGTH,
          97  +
                    ::http_1x::header::CONTENT_LENGTH,
   95     98   
                    content_length,
   96     99   
                );
   97    100   
                builder
   98    101   
                    .status(400)
   99    102   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  100    103   
            }
  101    104   
            crate::error::MapWithEnumKeyOpError::ExtraError(output) => {
  102    105   
                let payload =
  103    106   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
  104    107   
                #[allow(unused_mut)]
  105         -
                let mut builder = ::http::Response::builder();
         108  +
                let mut builder = ::http_1x::Response::builder();
  106    109   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    110   
                    builder,
  108         -
                    ::http::header::CONTENT_TYPE,
         111  +
                    ::http_1x::header::CONTENT_TYPE,
  109    112   
                    "application/json",
  110    113   
                );
  111    114   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    115   
                    builder,
  113         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         116  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  114    117   
                    "ExtraError",
  115    118   
                );
  116    119   
                let content_length = payload.len();
  117    120   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    121   
                    builder,
  119         -
                    ::http::header::CONTENT_LENGTH,
         122  +
                    ::http_1x::header::CONTENT_LENGTH,
  120    123   
                    content_length,
  121    124   
                );
  122    125   
                builder
  123    126   
                    .status(500)
  124    127   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  125    128   
            }
  126    129   
        }
  127    130   
    })
  128    131   
}
  129    132   

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_null_in_non_sparse.rs

@@ -1,1 +94,94 @@
    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_null_in_non_sparse_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::NullInNonSparseInput,
    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::null_in_non_sparse_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   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
   23     23   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_null_in_non_sparse_http_response(
   29     29   
    #[allow(unused_variables)] output: crate::output::NullInNonSparseOutput,
   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 = 200;
   43     43   
        builder = builder.status(http_status);
   44     44   
        let payload =
   45     45   
            crate::protocol_serde::shape_null_in_non_sparse_output::ser_null_in_non_sparse_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   
}
   57     57   
   58     58   
#[allow(clippy::unnecessary_wraps)]
   59     59   
pub fn ser_null_in_non_sparse_http_error(
   60     60   
    error: &crate::error::NullInNonSparseError,
   61     61   
) -> std::result::Result<
   62     62   
    ::aws_smithy_http_server::response::Response,
   63     63   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     64   
> {
   65     65   
    Ok({
   66     66   
        match error {
   67     67   
            crate::error::NullInNonSparseError::ExtraError(output) => {
   68     68   
                let payload =
   69     69   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   70     70   
                #[allow(unused_mut)]
   71         -
                let mut builder = ::http::Response::builder();
          71  +
                let mut builder = ::http_1x::Response::builder();
   72     72   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   73     73   
                    builder,
   74         -
                    ::http::header::CONTENT_TYPE,
          74  +
                    ::http_1x::header::CONTENT_TYPE,
   75     75   
                    "application/json",
   76     76   
                );
   77     77   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78     78   
                    builder,
   79         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          79  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   80     80   
                    "ExtraError",
   81     81   
                );
   82     82   
                let content_length = payload.len();
   83     83   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85         -
                    ::http::header::CONTENT_LENGTH,
          85  +
                    ::http_1x::header::CONTENT_LENGTH,
   86     86   
                    content_length,
   87     87   
                );
   88     88   
                builder
   89     89   
                    .status(500)
   90     90   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   91     91   
            }
   92     92   
        }
   93     93   
    })
   94     94   
}

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_primitive_int_header.rs

@@ -1,1 +147,149 @@
    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_primitive_int_header_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::PrimitiveIntHeaderInput,
    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::primitive_int_header_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   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
   23     23   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_primitive_int_header_http_response(
   29     29   
    #[allow(unused_variables)] output: crate::output::PrimitiveIntHeaderOutput,
   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 =
   38     38   
            crate::protocol_serde::shape_primitive_int_header::ser_primitive_int_header_headers(
   39     39   
                &output, builder,
   40     40   
            )?;
   41     41   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   42     42   
            builder,
   43         -
            ::http::header::CONTENT_TYPE,
          43  +
            ::http_1x::header::CONTENT_TYPE,
   44     44   
            "application/json",
   45     45   
        );
   46     46   
        let http_status: u16 = 200;
   47     47   
        builder = builder.status(http_status);
   48     48   
        let payload =
   49     49   
            crate::protocol_serde::shape_primitive_int_header_output::ser_primitive_int_header_output_output_output(&output)?
   50     50   
        ;
   51     51   
        let content_length = payload.len();
   52     52   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   53     53   
            builder,
   54         -
            ::http::header::CONTENT_LENGTH,
          54  +
            ::http_1x::header::CONTENT_LENGTH,
   55     55   
            content_length,
   56     56   
        );
   57     57   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   58     58   
        builder.body(body)?
   59     59   
    })
   60     60   
}
   61     61   
   62     62   
#[allow(clippy::unnecessary_wraps)]
   63     63   
pub fn ser_primitive_int_header_http_error(
   64     64   
    error: &crate::error::PrimitiveIntHeaderError,
   65     65   
) -> std::result::Result<
   66     66   
    ::aws_smithy_http_server::response::Response,
   67     67   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   68     68   
> {
   69     69   
    Ok({
   70     70   
        match error {
   71     71   
            crate::error::PrimitiveIntHeaderError::ValidationException(output) => {
   72     72   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   73     73   
                #[allow(unused_mut)]
   74         -
                let mut builder = ::http::Response::builder();
          74  +
                let mut builder = ::http_1x::Response::builder();
   75     75   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   76     76   
                    builder,
   77         -
                    ::http::header::CONTENT_TYPE,
          77  +
                    ::http_1x::header::CONTENT_TYPE,
   78     78   
                    "application/json",
   79     79   
                );
   80     80   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81     81   
                    builder,
   82         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          82  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   83     83   
                    "ValidationException",
   84     84   
                );
   85     85   
                let content_length = payload.len();
   86     86   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88         -
                    ::http::header::CONTENT_LENGTH,
          88  +
                    ::http_1x::header::CONTENT_LENGTH,
   89     89   
                    content_length,
   90     90   
                );
   91     91   
                builder
   92     92   
                    .status(400)
   93     93   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   94     94   
            }
   95     95   
            crate::error::PrimitiveIntHeaderError::ExtraError(output) => {
   96     96   
                let payload =
   97     97   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   98     98   
                #[allow(unused_mut)]
   99         -
                let mut builder = ::http::Response::builder();
          99  +
                let mut builder = ::http_1x::Response::builder();
  100    100   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  101    101   
                    builder,
  102         -
                    ::http::header::CONTENT_TYPE,
         102  +
                    ::http_1x::header::CONTENT_TYPE,
  103    103   
                    "application/json",
  104    104   
                );
  105    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  106    106   
                    builder,
  107         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
         107  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
  108    108   
                    "ExtraError",
  109    109   
                );
  110    110   
                let content_length = payload.len();
  111    111   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    112   
                    builder,
  113         -
                    ::http::header::CONTENT_LENGTH,
         113  +
                    ::http_1x::header::CONTENT_LENGTH,
  114    114   
                    content_length,
  115    115   
                );
  116    116   
                builder
  117    117   
                    .status(500)
  118    118   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  119    119   
            }
  120    120   
        }
  121    121   
    })
  122    122   
}
  123    123   
  124    124   
pub fn ser_primitive_int_header_headers(
  125    125   
    input: &crate::output::PrimitiveIntHeaderOutput,
  126         -
    mut builder: ::http::response::Builder,
  127         -
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  128         -
{
         126  +
    mut builder: ::http_1x::response::Builder,
         127  +
) -> std::result::Result<
         128  +
    ::http_1x::response::Builder,
         129  +
    ::aws_smithy_types::error::operation::BuildError,
         130  +
> {
  129    131   
    {
  130    132   
        let mut encoder = ::aws_smithy_types::primitive::Encoder::from(input.field);
  131    133   
        let formatted_1 = encoder.encode();
  132    134   
        if !formatted_1.is_empty() {
  133    135   
            let header_value = formatted_1;
  134         -
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
         136  +
            let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| {
  135    137   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  136    138   
                    "field",
  137    139   
                    format!(
  138    140   
                        "`{}` cannot be used as a header value: {}",
  139    141   
                        &header_value, err
  140    142   
                    ),
  141    143   
                )
  142    144   
            })?;
  143    145   
            builder = builder.header("x-field", header_value);
  144    146   
        }

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_primitive_int_op.rs

@@ -1,1 +125,128 @@
    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_primitive_int_op_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::PrimitiveIntOpInput,
    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::primitive_int_op_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_primitive_int_op::de_primitive_int_op(
   29     32   
                bytes.as_ref(),
   30     33   
                input,
   31     34   
            )?;
   32     35   
        }
   33     36   
        input.build()
   34     37   
    })
   35     38   
}
   36     39   
   37     40   
#[allow(clippy::unnecessary_wraps)]
   38     41   
pub fn ser_primitive_int_op_http_response(
   39     42   
    #[allow(unused_variables)] output: crate::output::PrimitiveIntOpOutput,
   40     43   
) -> std::result::Result<
   41     44   
    ::aws_smithy_http_server::response::Response,
   42     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     46   
> {
   44     47   
    Ok({
   45     48   
        #[allow(unused_mut)]
   46         -
        let mut builder = ::http::Response::builder();
          49  +
        let mut builder = ::http_1x::Response::builder();
   47     50   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     51   
            builder,
   49         -
            ::http::header::CONTENT_TYPE,
          52  +
            ::http_1x::header::CONTENT_TYPE,
   50     53   
            "application/json",
   51     54   
        );
   52     55   
        let http_status: u16 = 200;
   53     56   
        builder = builder.status(http_status);
   54     57   
        let payload =
   55     58   
            crate::protocol_serde::shape_primitive_int_op_output::ser_primitive_int_op_output_output_output(&output)?
   56     59   
        ;
   57     60   
        let content_length = payload.len();
   58     61   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     62   
            builder,
   60         -
            ::http::header::CONTENT_LENGTH,
          63  +
            ::http_1x::header::CONTENT_LENGTH,
   61     64   
            content_length,
   62     65   
        );
   63     66   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   64     67   
        builder.body(body)?
   65     68   
    })
   66     69   
}
   67     70   
   68     71   
#[allow(clippy::unnecessary_wraps)]
   69     72   
pub fn ser_primitive_int_op_http_error(
   70     73   
    error: &crate::error::PrimitiveIntOpError,
   71     74   
) -> std::result::Result<
   72     75   
    ::aws_smithy_http_server::response::Response,
   73     76   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     77   
> {
   75     78   
    Ok({
   76     79   
        match error {
   77     80   
            crate::error::PrimitiveIntOpError::ExtraError(output) => {
   78     81   
                let payload =
   79     82   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   80     83   
                #[allow(unused_mut)]
   81         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   82     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83     86   
                    builder,
   84         -
                    ::http::header::CONTENT_TYPE,
          87  +
                    ::http_1x::header::CONTENT_TYPE,
   85     88   
                    "application/json",
   86     89   
                );
   87     90   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   88     91   
                    builder,
   89         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          92  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   90     93   
                    "ExtraError",
   91     94   
                );
   92     95   
                let content_length = payload.len();
   93     96   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94     97   
                    builder,
   95         -
                    ::http::header::CONTENT_LENGTH,
          98  +
                    ::http_1x::header::CONTENT_LENGTH,
   96     99   
                    content_length,
   97    100   
                );
   98    101   
                builder
   99    102   
                    .status(500)
  100    103   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  101    104   
            }
  102    105   
        }
  103    106   
    })
  104    107   
}
  105    108   

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_query_precedence.rs

@@ -1,1 +110,110 @@
    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_query_precedence_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::QueryPrecedenceInput,
    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::query_precedence_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   
        let query_string = uri.query().unwrap_or("");
   23     23   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24     24   
        let mut query_params: ::std::collections::HashMap<
   25     25   
            ::std::string::String,
   26     26   
            ::std::string::String,
   27     27   
        > = ::std::collections::HashMap::new();
   28     28   
        let mut foo_seen = false;
   29     29   
        for (k, v) in pairs {
   30     30   
            if !foo_seen && k == "bar" {
   31     31   
                input = input.set_foo(crate::protocol_serde::shape_query_precedence_input::de_foo(
   32     32   
                    &v,
   33     33   
                )?);
   34     34   
                foo_seen = true;
   35     35   
            }
   36     36   
            query_params
   37     37   
                .entry(String::from(k))
   38     38   
                .or_insert_with(|| String::from(v));
   39     39   
        }
   40     40   
        input = input.set_baz(Some(query_params));
   41     41   
        input.build()
   42     42   
    })
   43     43   
}
   44     44   
   45     45   
#[allow(clippy::unnecessary_wraps)]
   46     46   
pub fn ser_query_precedence_http_response(
   47     47   
    #[allow(unused_variables)] output: crate::output::QueryPrecedenceOutput,
   48     48   
) -> std::result::Result<
   49     49   
    ::aws_smithy_http_server::response::Response,
   50     50   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   51     51   
> {
   52     52   
    Ok({
   53     53   
        #[allow(unused_mut)]
   54         -
        let mut builder = ::http::Response::builder();
          54  +
        let mut builder = ::http_1x::Response::builder();
   55     55   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     56   
            builder,
   57         -
            ::http::header::CONTENT_TYPE,
          57  +
            ::http_1x::header::CONTENT_TYPE,
   58     58   
            "application/json",
   59     59   
        );
   60     60   
        let http_status: u16 = 200;
   61     61   
        builder = builder.status(http_status);
   62     62   
        let payload = "";
   63     63   
        let content_length = payload.len();
   64     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   65     65   
            builder,
   66         -
            ::http::header::CONTENT_LENGTH,
          66  +
            ::http_1x::header::CONTENT_LENGTH,
   67     67   
            content_length,
   68     68   
        );
   69     69   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   70     70   
        builder.body(body)?
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_query_precedence_http_error(
   76     76   
    error: &crate::error::QueryPrecedenceError,
   77     77   
) -> std::result::Result<
   78     78   
    ::aws_smithy_http_server::response::Response,
   79     79   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80     80   
> {
   81     81   
    Ok({
   82     82   
        match error {
   83     83   
            crate::error::QueryPrecedenceError::ExtraError(output) => {
   84     84   
                let payload =
   85     85   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   86     86   
                #[allow(unused_mut)]
   87         -
                let mut builder = ::http::Response::builder();
          87  +
                let mut builder = ::http_1x::Response::builder();
   88     88   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89     89   
                    builder,
   90         -
                    ::http::header::CONTENT_TYPE,
          90  +
                    ::http_1x::header::CONTENT_TYPE,
   91     91   
                    "application/json",
   92     92   
                );
   93     93   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   94     94   
                    builder,
   95         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          95  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   96     96   
                    "ExtraError",
   97     97   
                );
   98     98   
                let content_length = payload.len();
   99     99   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  100    100   
                    builder,
  101         -
                    ::http::header::CONTENT_LENGTH,
         101  +
                    ::http_1x::header::CONTENT_LENGTH,
  102    102   
                    content_length,
  103    103   
                );
  104    104   
                builder
  105    105   
                    .status(500)
  106    106   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  107    107   
            }
  108    108   
        }
  109    109   
    })
  110    110   
}

tmp-codegen-diff/codegen-server-test/rest_json_extras/rust-server-codegen/src/protocol_serde/shape_status_response.rs

@@ -1,1 +95,95 @@
    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_status_response_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::StatusResponseInput,
    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::status_response_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   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
   23     23   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_status_response_http_response(
   29     29   
    #[allow(unused_variables)] output: crate::output::StatusResponseOutput,
   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 status = output.field;
   43     43   
        let http_status: u16 = status.try_into().map_err(::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
   44     44   
        builder = builder.status(http_status);
   45     45   
        let payload =
   46     46   
            crate::protocol_serde::shape_status_response_output::ser_status_response_output_output_output(&output)?
   47     47   
        ;
   48     48   
        let content_length = payload.len();
   49     49   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51         -
            ::http::header::CONTENT_LENGTH,
          51  +
            ::http_1x::header::CONTENT_LENGTH,
   52     52   
            content_length,
   53     53   
        );
   54     54   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   55     55   
        builder.body(body)?
   56     56   
    })
   57     57   
}
   58     58   
   59     59   
#[allow(clippy::unnecessary_wraps)]
   60     60   
pub fn ser_status_response_http_error(
   61     61   
    error: &crate::error::StatusResponseError,
   62     62   
) -> std::result::Result<
   63     63   
    ::aws_smithy_http_server::response::Response,
   64     64   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     65   
> {
   66     66   
    Ok({
   67     67   
        match error {
   68     68   
            crate::error::StatusResponseError::ExtraError(output) => {
   69     69   
                let payload =
   70     70   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   71     71   
                #[allow(unused_mut)]
   72         -
                let mut builder = ::http::Response::builder();
          72  +
                let mut builder = ::http_1x::Response::builder();
   73     73   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   74     74   
                    builder,
   75         -
                    ::http::header::CONTENT_TYPE,
          75  +
                    ::http_1x::header::CONTENT_TYPE,
   76     76   
                    "application/json",
   77     77   
                );
   78     78   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79     79   
                    builder,
   80         -
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
          80  +
                    ::http_1x::header::HeaderName::from_static("x-amzn-errortype"),
   81     81   
                    "ExtraError",
   82     82   
                );
   83     83   
                let content_length = payload.len();
   84     84   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     85   
                    builder,
   86         -
                    ::http::header::CONTENT_LENGTH,
          86  +
                    ::http_1x::header::CONTENT_LENGTH,
   87     87   
                    content_length,
   88     88   
                );
   89     89   
                builder
   90     90   
                    .status(500)
   91     91   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   92     92   
            }
   93     93   
        }
   94     94   
    })
   95     95   
}