Server Test

Server Test

rev. ce76c569583a3fdee1e9d39e082a8d5efd7b13b7 (ignoring whitespace)

Files changed:

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

@@ -14,14 +49,52 @@
   34     34   
version = "0.1"
   35     35   
[dev-dependencies.aws-smithy-protocol-test]
   36     36   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-protocol-test"
   37     37   
[dev-dependencies.hyper]
   38     38   
version = "0.14.12"
   39     39   
[dev-dependencies.pretty_assertions]
   40     40   
version = "1.3.0"
   41     41   
[dev-dependencies.tokio]
   42     42   
version = "1.23.1"
   43     43   
features = ["macros", "test-util", "rt-multi-thread"]
          44  +
[dev-dependencies.tracing-test]
          45  +
version = "0.2.5"
          46  +
features = ["no-env-filter"]
   44     47   
[features]
   45     48   
aws-lambda = ["aws-smithy-http-server/aws-lambda"]
   46     49   
rt-tokio = ["aws-smithy-types/rt-tokio"]
   47     50   
default = ["aws-lambda", "rt-tokio"]
   48     51   
   49     52   

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

@@ -1,1 +87,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[cfg(test)]
    3         -
#[allow(unreachable_code, unused_variables)]
    4         -
mod server_response_code_default_operation_test {
    5         -
    /// Test ID: ResponseCodeDefaultOperation
    6         -
    #[::tokio::test]
    7         -
    async fn response_code_default_operation_response() {
    8         -
        let output = crate::output::ResponseCodeDefaultOperationOutput {};
    9         -
        use ::aws_smithy_http_server::response::IntoResponse;
   10         -
        let http_response = output.into_response();
   11         -
        ::pretty_assertions::assert_eq!(
   12         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
   13         -
            http_response.status()
   14         -
        );
   15         -
    }
   16         -
}
   17         -
#[cfg(test)]
   18         -
#[allow(unreachable_code, unused_variables)]
   19         -
mod server_response_code_http_fallback_operation_test {
   20         -
    /// Test ID: ResponseCodeHttpFallbackOperation
   21         -
    #[::tokio::test]
   22         -
    async fn response_code_http_fallback_operation_response() {
   23         -
        let output = crate::output::ResponseCodeHttpFallbackOperationOutput {};
   24         -
        use ::aws_smithy_http_server::response::IntoResponse;
   25         -
        let http_response = output.into_response();
   26         -
        ::pretty_assertions::assert_eq!(
   27         -
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
   28         -
            http_response.status()
   29         -
        );
   30         -
        let expected_headers = [("Content-Length", "2")];
   31         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
   32         -
            http_response.headers(),
   33         -
            expected_headers,
   34         -
        ));
   35         -
    }
   36         -
}
   37         -
#[cfg(test)]
   38         -
#[allow(unreachable_code, unused_variables)]
   39         -
mod server_response_code_required_operation_test {
   40         -
    /// Test ID: ResponseCodeRequiredOperation
   41         -
    #[::tokio::test]
   42         -
    async fn response_code_required_operation_response() {
   43         -
        let output = crate::output::ResponseCodeRequiredOperationOutput { response_code: 201 };
   44         -
        use ::aws_smithy_http_server::response::IntoResponse;
   45         -
        let http_response = output.into_response();
   46         -
        ::pretty_assertions::assert_eq!(
   47         -
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
   48         -
            http_response.status()
   49         -
        );
   50         -
        let expected_headers = [("Content-Length", "2")];
   51         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
   52         -
            http_response.headers(),
   53         -
            expected_headers,
   54         -
        ));
   55         -
    }
   56         -
}
   57         -
   58      2   
const CONTENT_TYPE_RESPONSECODEDEFAULTOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
   59      3   
::pin_project_lite::pin_project! {
   60      4   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   61      5   
    /// [`ResponseCodeDefaultOperationInput`](crate::input::ResponseCodeDefaultOperationInput) using modelled bindings.
   62      6   
    pub struct ResponseCodeDefaultOperationInputFuture {
   63      7   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeDefaultOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
   64      8   
    }
   65      9   
}
   66     10   
   67     11   
impl std::future::Future for ResponseCodeDefaultOperationInputFuture {
@@ -110,54 +169,131 @@
  130     74   
        match crate::protocol_serde::shape_response_code_default_operation::ser_response_code_default_operation_http_response(self) {
  131     75   
                        Ok(response) => response,
  132     76   
                        Err(e) => {
  133     77   
                            ::tracing::error!(error = %e, "failed to serialize response");
  134     78   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  135     79   
                        }
  136     80   
                    }
  137     81   
    }
  138     82   
}
  139     83   
          84  +
#[allow(unreachable_code, unused_variables)]
          85  +
#[cfg(test)]
          86  +
mod response_code_default_operation_test {
          87  +
          88  +
    /// Test ID: ResponseCodeDefaultOperation
          89  +
    #[::tokio::test]
          90  +
    #[::tracing_test::traced_test]
          91  +
    async fn response_code_default_operation_response() {
          92  +
        let output = crate::output::ResponseCodeDefaultOperationOutput {};
          93  +
        use ::aws_smithy_http_server::response::IntoResponse;
          94  +
        let http_response = output.into_response();
          95  +
        ::pretty_assertions::assert_eq!(
          96  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
          97  +
            http_response.status()
          98  +
        );
          99  +
    }
         100  +
}
         101  +
  140    102   
const CONTENT_TYPE_RESPONSECODEHTTPFALLBACKOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
  141    103   
::pin_project_lite::pin_project! {
  142    104   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  143    105   
    /// [`ResponseCodeHttpFallbackOperationInput`](crate::input::ResponseCodeHttpFallbackOperationInput) using modelled bindings.
  144    106   
    pub struct ResponseCodeHttpFallbackOperationInputFuture {
  145    107   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeHttpFallbackOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  146    108   
    }
  147    109   
}
  148    110   
  149    111   
impl std::future::Future for ResponseCodeHttpFallbackOperationInputFuture {
@@ -192,154 +251,236 @@
  212    174   
        match crate::protocol_serde::shape_response_code_http_fallback_operation::ser_response_code_http_fallback_operation_http_response(self) {
  213    175   
                        Ok(response) => response,
  214    176   
                        Err(e) => {
  215    177   
                            ::tracing::error!(error = %e, "failed to serialize response");
  216    178   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  217    179   
                        }
  218    180   
                    }
  219    181   
    }
  220    182   
}
  221    183   
         184  +
#[allow(unreachable_code, unused_variables)]
         185  +
#[cfg(test)]
         186  +
mod response_code_http_fallback_operation_test {
         187  +
         188  +
    /// Test ID: ResponseCodeHttpFallbackOperation
         189  +
    #[::tokio::test]
         190  +
    #[::tracing_test::traced_test]
         191  +
    async fn response_code_http_fallback_operation_response() {
         192  +
        let output = crate::output::ResponseCodeHttpFallbackOperationOutput {};
         193  +
        use ::aws_smithy_http_server::response::IntoResponse;
         194  +
        let http_response = output.into_response();
         195  +
        ::pretty_assertions::assert_eq!(
         196  +
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
         197  +
            http_response.status()
         198  +
        );
         199  +
        let expected_headers = [("Content-Length", "2")];
         200  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
         201  +
            http_response.headers(),
         202  +
            expected_headers,
         203  +
        ));
         204  +
    }
         205  +
}
         206  +
  222    207   
const CONTENT_TYPE_RESPONSECODEREQUIREDOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
  223    208   
::pin_project_lite::pin_project! {
  224    209   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  225    210   
    /// [`ResponseCodeRequiredOperationInput`](crate::input::ResponseCodeRequiredOperationInput) using modelled bindings.
  226    211   
    pub struct ResponseCodeRequiredOperationInputFuture {
  227    212   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResponseCodeRequiredOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  228    213   
    }
  229    214   
}
  230    215   
  231    216   
impl std::future::Future for ResponseCodeRequiredOperationInputFuture {
@@ -274,259 +333,341 @@
  294    279   
        match crate::protocol_serde::shape_response_code_required_operation::ser_response_code_required_operation_http_response(self) {
  295    280   
                        Ok(response) => response,
  296    281   
                        Err(e) => {
  297    282   
                            ::tracing::error!(error = %e, "failed to serialize response");
  298    283   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  299    284   
                        }
  300    285   
                    }
  301    286   
    }
  302    287   
}
  303    288   
         289  +
#[allow(unreachable_code, unused_variables)]
         290  +
#[cfg(test)]
         291  +
mod response_code_required_operation_test {
         292  +
         293  +
    /// Test ID: ResponseCodeRequiredOperation
         294  +
    #[::tokio::test]
         295  +
    #[::tracing_test::traced_test]
         296  +
    async fn response_code_required_operation_response() {
         297  +
        let output = crate::output::ResponseCodeRequiredOperationOutput { response_code: 201 };
         298  +
        use ::aws_smithy_http_server::response::IntoResponse;
         299  +
        let http_response = output.into_response();
         300  +
        ::pretty_assertions::assert_eq!(
         301  +
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
         302  +
            http_response.status()
         303  +
        );
         304  +
        let expected_headers = [("Content-Length", "2")];
         305  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
         306  +
            http_response.headers(),
         307  +
            expected_headers,
         308  +
        ));
         309  +
    }
         310  +
}
         311  +
  304    312   
const CONTENT_TYPE_REQUIREDHEADERCOLLECTIONOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
  305    313   
::pin_project_lite::pin_project! {
  306    314   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  307    315   
    /// [`RequiredHeaderCollectionOperationInput`](crate::input::RequiredHeaderCollectionOperationInput) using modelled bindings.
  308    316   
    pub struct RequiredHeaderCollectionOperationInputFuture {
  309    317   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RequiredHeaderCollectionOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  310    318   
    }
  311    319   
}
  312    320   
  313    321   
impl std::future::Future for RequiredHeaderCollectionOperationInputFuture {

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

@@ -1,1 +32,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3      2   
static CONTENT_TYPE_DONOTHING: ::once_cell::sync::Lazy<::mime::Mime> =
    4      3   
    ::once_cell::sync::Lazy::new(|| {
    5      4   
        "application/x-amz-json-1.1"
    6      5   
            .parse::<::mime::Mime>()
    7      6   
            .expect("BUG: MIME parsing failed, content_type is not valid")
    8      7   
    });
    9      8   
::pin_project_lite::pin_project! {
   10      9   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   11     10   
    /// [`DoNothingInput`](crate::input::DoNothingInput) using modelled bindings.
   12     11   
    pub struct DoNothingInputFuture {

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

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

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

@@ -1,1 +125,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[cfg(test)]
    3         -
#[allow(unreachable_code, unused_variables)]
    4         -
mod server_reserved_words_as_members_test {
    5         -
    /// Test ID: reserved_words
    6         -
    #[::tokio::test]
    7         -
    async fn reserved_words_request() {
    8         -
        #[allow(unused_mut)]
    9         -
        let mut http_request = http::Request::builder()
   10         -
            .uri("/")
   11         -
            .method("POST")
   12         -
            .header("Content-Type", "application/x-amz-json-1.1")
   13         -
            .header("X-Amz-Target", "Config.ReservedWordsAsMembers")
   14         -
            .body(::aws_smithy_http_server::body::Body::from(
   15         -
                ::bytes::Bytes::from_static("{\"as\": 5, \"async\": true}".as_bytes()),
   16         -
            ))
   17         -
            .unwrap();
   18         -
        #[allow(unused_mut)]
   19         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
   20         -
        let config = crate::service::ConfigConfig::builder().build();
   21         -
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
   22         -
            .reserved_words_as_members(move |input: crate::input::ReservedWordsAsMembersInput| {
   23         -
                let sender = sender.clone();
   24         -
                async move {
   25         -
                    let result = {
   26         -
                        let expected = crate::input::ReservedWordsAsMembersInput {
   27         -
                            r#as: ::std::option::Option::Some(5),
   28         -
                            r#async: ::std::option::Option::Some(true),
   29         -
                            r#enum: ::std::option::Option::None,
   30         -
                            self_: ::std::option::Option::None,
   31         -
                            crate_: ::std::option::Option::None,
   32         -
                            super_: ::std::option::Option::None,
   33         -
                            build_value: ::std::option::Option::None,
   34         -
                            default_value: ::std::option::Option::None,
   35         -
                            send: ::std::option::Option::None,
   36         -
                        };
   37         -
                        ::pretty_assertions::assert_eq!(input, expected);
   38         -
                        let response = crate::output::ReservedWordsAsMembersOutput {};
   39         -
                        Ok(response)
   40         -
                    };
   41         -
                    sender.send(()).await.expect("receiver dropped early");
   42         -
                    result
   43         -
                }
   44         -
            })
   45         -
            .build_unchecked();
   46         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
   47         -
            .await
   48         -
            .expect("unable to make an HTTP request");
   49         -
        assert!(receiver.recv().await.is_some());
   50         -
    }
   51         -
}
   52         -
#[cfg(test)]
   53         -
#[allow(unreachable_code, unused_variables)]
   54         -
mod server_structure_name_punning_test {
   55         -
    /// Test ID: structure_punning
   56         -
    #[::tokio::test]
   57         -
    async fn structure_punning_request() {
   58         -
        #[allow(unused_mut)]
   59         -
        let mut http_request = http::Request::builder()
   60         -
            .uri("/")
   61         -
            .method("POST")
   62         -
            .header("Content-Type", "application/x-amz-json-1.1")
   63         -
            .header("X-Amz-Target", "Config.StructureNamePunning")
   64         -
            .body(::aws_smithy_http_server::body::Body::from(
   65         -
                ::bytes::Bytes::from_static("{\"regular_string\": \"hello!\"}".as_bytes()),
   66         -
            ))
   67         -
            .unwrap();
   68         -
        #[allow(unused_mut)]
   69         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
   70         -
        let config = crate::service::ConfigConfig::builder().build();
   71         -
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
   72         -
            .structure_name_punning(move |input: crate::input::StructureNamePunningInput| {
   73         -
                let sender = sender.clone();
   74         -
                async move {
   75         -
                    let result = {
   76         -
                        let expected = crate::input::StructureNamePunningInput {
   77         -
                            regular_string: ::std::option::Option::Some("hello!".to_owned()),
   78         -
                            punned_vec: ::std::option::Option::None,
   79         -
                        };
   80         -
                        ::pretty_assertions::assert_eq!(input, expected);
   81         -
                        let response = crate::output::StructureNamePunningOutput {};
   82         -
                        response
   83         -
                    };
   84         -
                    sender.send(()).await.expect("receiver dropped early");
   85         -
                    result
   86         -
                }
   87         -
            })
   88         -
            .build_unchecked();
   89         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
   90         -
            .await
   91         -
            .expect("unable to make an HTTP request");
   92         -
        assert!(receiver.recv().await.is_some());
   93         -
    }
   94         -
}
   95         -
   96      2   
static CONTENT_TYPE_RPCECHO: ::once_cell::sync::Lazy<::mime::Mime> =
   97      3   
    ::once_cell::sync::Lazy::new(|| {
   98      4   
        "application/x-amz-json-1.1"
   99      5   
            .parse::<::mime::Mime>()
  100      6   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  101      7   
    });
  102      8   
::pin_project_lite::pin_project! {
  103      9   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  104     10   
    /// [`RpcEchoInput`](crate::input::RpcEchoInput) using modelled bindings.
  105     11   
    pub struct RpcEchoInputFuture {
@@ -684,590 +743,698 @@
  704    610   
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
  705    611   
                        Ok(response) => response,
  706    612   
                        Err(e) => {
  707    613   
                            ::tracing::error!(error = %e, "failed to serialize response");
  708    614   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  709    615   
                        }
  710    616   
                    }
  711    617   
    }
  712    618   
}
  713    619   
         620  +
#[allow(unreachable_code, unused_variables)]
         621  +
#[cfg(test)]
         622  +
mod structure_name_punning_test {
         623  +
         624  +
    /// Test ID: structure_punning
         625  +
    #[::tokio::test]
         626  +
    #[::tracing_test::traced_test]
         627  +
    async fn structure_punning_request() {
         628  +
        #[allow(unused_mut)]
         629  +
        let mut http_request = http::Request::builder()
         630  +
            .uri("/")
         631  +
            .method("POST")
         632  +
            .header("Content-Type", "application/x-amz-json-1.1")
         633  +
            .header("X-Amz-Target", "Config.StructureNamePunning")
         634  +
            .body(::aws_smithy_http_server::body::Body::from(
         635  +
                ::bytes::Bytes::from_static("{\"regular_string\": \"hello!\"}".as_bytes()),
         636  +
            ))
         637  +
            .unwrap();
         638  +
        #[allow(unused_mut)]
         639  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
         640  +
        let config = crate::service::ConfigConfig::builder().build();
         641  +
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
         642  +
            .structure_name_punning(move |input: crate::input::StructureNamePunningInput| {
         643  +
                let sender = sender.clone();
         644  +
                async move {
         645  +
                    let result = {
         646  +
                        let expected = crate::input::StructureNamePunningInput {
         647  +
                            regular_string: ::std::option::Option::Some("hello!".to_owned()),
         648  +
                            punned_vec: ::std::option::Option::None,
         649  +
                        };
         650  +
                        ::pretty_assertions::assert_eq!(input, expected);
         651  +
                        let response = crate::output::StructureNamePunningOutput {};
         652  +
                        response
         653  +
                    };
         654  +
                    sender.send(()).await.expect("receiver dropped early");
         655  +
                    result
         656  +
                }
         657  +
            })
         658  +
            .build_unchecked();
         659  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
         660  +
            .await
         661  +
            .expect("unable to make an HTTP request");
         662  +
        assert!(
         663  +
            receiver.recv().await.is_some(),
         664  +
            "we expected operation handler to be invoked but it was not entered"
         665  +
        );
         666  +
    }
         667  +
}
         668  +
  714    669   
static CONTENT_TYPE_RESERVEDWORDSASMEMBERS: ::once_cell::sync::Lazy<::mime::Mime> =
  715    670   
    ::once_cell::sync::Lazy::new(|| {
  716    671   
        "application/x-amz-json-1.1"
  717    672   
            .parse::<::mime::Mime>()
  718    673   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  719    674   
    });
  720    675   
::pin_project_lite::pin_project! {
  721    676   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  722    677   
    /// [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) using modelled bindings.
  723    678   
    pub struct ReservedWordsAsMembersInputFuture {
@@ -786,741 +0,826 @@
  806    761   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
  807    762   
                response
  808    763   
            },
  809    764   
            Err(e) => {
  810    765   
                ::tracing::error!(error = %e, "failed to serialize response");
  811    766   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  812    767   
            }
  813    768   
        }
  814    769   
    }
  815    770   
}
         771  +
         772  +
#[allow(unreachable_code, unused_variables)]
         773  +
#[cfg(test)]
         774  +
mod reserved_words_as_members_test {
         775  +
         776  +
    /// Test ID: reserved_words
         777  +
    #[::tokio::test]
         778  +
    #[::tracing_test::traced_test]
         779  +
    async fn reserved_words_request() {
         780  +
        #[allow(unused_mut)]
         781  +
        let mut http_request = http::Request::builder()
         782  +
            .uri("/")
         783  +
            .method("POST")
         784  +
            .header("Content-Type", "application/x-amz-json-1.1")
         785  +
            .header("X-Amz-Target", "Config.ReservedWordsAsMembers")
         786  +
            .body(::aws_smithy_http_server::body::Body::from(
         787  +
                ::bytes::Bytes::from_static("{\"as\": 5, \"async\": true}".as_bytes()),
         788  +
            ))
         789  +
            .unwrap();
         790  +
        #[allow(unused_mut)]
         791  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
         792  +
        let config = crate::service::ConfigConfig::builder().build();
         793  +
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
         794  +
            .reserved_words_as_members(move |input: crate::input::ReservedWordsAsMembersInput| {
         795  +
                let sender = sender.clone();
         796  +
                async move {
         797  +
                    let result = {
         798  +
                        let expected = crate::input::ReservedWordsAsMembersInput {
         799  +
                            r#as: ::std::option::Option::Some(5),
         800  +
                            r#async: ::std::option::Option::Some(true),
         801  +
                            r#enum: ::std::option::Option::None,
         802  +
                            self_: ::std::option::Option::None,
         803  +
                            crate_: ::std::option::Option::None,
         804  +
                            super_: ::std::option::Option::None,
         805  +
                            build_value: ::std::option::Option::None,
         806  +
                            default_value: ::std::option::Option::None,
         807  +
                            send: ::std::option::Option::None,
         808  +
                        };
         809  +
                        ::pretty_assertions::assert_eq!(input, expected);
         810  +
                        let response = crate::output::ReservedWordsAsMembersOutput {};
         811  +
                        Ok(response)
         812  +
                    };
         813  +
                    sender.send(()).await.expect("receiver dropped early");
         814  +
                    result
         815  +
                }
         816  +
            })
         817  +
            .build_unchecked();
         818  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
         819  +
            .await
         820  +
            .expect("unable to make an HTTP request");
         821  +
        assert!(
         822  +
            receiver.recv().await.is_some(),
         823  +
            "we expected operation handler to be invoked but it was not entered"
         824  +
        );
         825  +
    }
         826  +
}

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

@@ -1,1 +32,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3      2   
static CONTENT_TYPE_STRUCTS: ::once_cell::sync::Lazy<::mime::Mime> =
    4      3   
    ::once_cell::sync::Lazy::new(|| {
    5      4   
        "application/x-amz-json-1.1"
    6      5   
            .parse::<::mime::Mime>()
    7      6   
            .expect("BUG: MIME parsing failed, content_type is not valid")
    8      7   
    });
    9      8   
::pin_project_lite::pin_project! {
   10      9   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   11     10   
    /// [`StructsInput`](crate::input::StructsInput) using modelled bindings.
   12     11   
    pub struct StructsInputFuture {

tmp-codegen-diff/codegen-server-test/pokemon-service-awsjson-server-sdk/rust-server-codegen/src/operation.rs

@@ -1,1 +32,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3      2   
static CONTENT_TYPE_CHECKHEALTH: ::once_cell::sync::Lazy<::mime::Mime> =
    4      3   
    ::once_cell::sync::Lazy::new(|| {
    5      4   
        "application/x-amz-json-1.0"
    6      5   
            .parse::<::mime::Mime>()
    7      6   
            .expect("BUG: MIME parsing failed, content_type is not valid")
    8      7   
    });
    9      8   
::pin_project_lite::pin_project! {
   10      9   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
   11     10   
    /// [`CheckHealthInput`](crate::input::CheckHealthInput) using modelled bindings.
   12     11   
    pub struct CheckHealthInputFuture {

tmp-codegen-diff/codegen-server-test/pokemon-service-server-sdk/rust-server-codegen/src/operation.rs

@@ -1,1 +32,31 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3      2   
const CONTENT_TYPE_GETSTORAGE: ::mime::Mime = ::mime::APPLICATION_JSON;
    4      3   
::pin_project_lite::pin_project! {
    5      4   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    6      5   
    /// [`GetStorageInput`](crate::input::GetStorageInput) using modelled bindings.
    7      6   
    pub struct GetStorageInputFuture {
    8      7   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GetStorageInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
    9      8   
    }
   10      9   
}
   11     10   
   12     11   
impl std::future::Future for GetStorageInputFuture {

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

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

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

@@ -1,1 +30598,32207 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[cfg(test)]
           2  +
const CONTENT_TYPE_PUTWITHCONTENTENCODING: ::mime::Mime = ::mime::APPLICATION_JSON;
           3  +
::pin_project_lite::pin_project! {
           4  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
           5  +
    /// [`PutWithContentEncodingInput`](crate::input::PutWithContentEncodingInput) using modelled bindings.
           6  +
    pub struct PutWithContentEncodingInputFuture {
           7  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PutWithContentEncodingInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
           8  +
    }
           9  +
}
          10  +
          11  +
impl std::future::Future for PutWithContentEncodingInputFuture {
          12  +
    type Output = Result<
          13  +
        crate::input::PutWithContentEncodingInput,
          14  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
          15  +
    >;
          16  +
          17  +
    fn poll(
          18  +
        self: std::pin::Pin<&mut Self>,
          19  +
        cx: &mut std::task::Context<'_>,
          20  +
    ) -> std::task::Poll<Self::Output> {
          21  +
        let this = self.project();
          22  +
        this.inner.as_mut().poll(cx)
          23  +
    }
          24  +
}
          25  +
          26  +
impl<B>
          27  +
    ::aws_smithy_http_server::request::FromRequest<
          28  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
          29  +
        B,
          30  +
    > for crate::input::PutWithContentEncodingInput
          31  +
where
          32  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          33  +
    B: 'static,
          34  +
          35  +
    B::Data: Send,
          36  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          37  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          38  +
{
          39  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
          40  +
    type Future = PutWithContentEncodingInputFuture;
          41  +
          42  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
          43  +
        let fut = async move {
          44  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
          45  +
                request.headers(),
          46  +
                &CONTENT_TYPE_PUTWITHCONTENTENCODING,
          47  +
            ) {
          48  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
          49  +
            }
          50  +
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_request(request)
          51  +
                            .await
          52  +
                            .map_err(Into::into)
          53  +
        };
          54  +
        use ::futures_util::future::TryFutureExt;
          55  +
        let fut = fut.map_err(
          56  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
          57  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
          58  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
          59  +
                    e,
          60  +
                )
          61  +
            },
          62  +
        );
          63  +
        PutWithContentEncodingInputFuture {
          64  +
            inner: Box::pin(fut),
          65  +
        }
          66  +
    }
          67  +
}
          68  +
impl
          69  +
    ::aws_smithy_http_server::response::IntoResponse<
          70  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
          71  +
    > for crate::output::PutWithContentEncodingOutput
          72  +
{
          73  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
          74  +
        match crate::protocol_serde::shape_put_with_content_encoding::ser_put_with_content_encoding_http_response(self) {
          75  +
                        Ok(response) => response,
          76  +
                        Err(e) => {
          77  +
                            ::tracing::error!(error = %e, "failed to serialize response");
          78  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
          79  +
                        }
          80  +
                    }
          81  +
    }
          82  +
}
          83  +
          84  +
const CONTENT_TYPE_FRACTIONALSECONDS: ::mime::Mime = ::mime::APPLICATION_JSON;
          85  +
::pin_project_lite::pin_project! {
          86  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
          87  +
    /// [`FractionalSecondsInput`](crate::input::FractionalSecondsInput) using modelled bindings.
          88  +
    pub struct FractionalSecondsInputFuture {
          89  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::FractionalSecondsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
          90  +
    }
          91  +
}
          92  +
          93  +
impl std::future::Future for FractionalSecondsInputFuture {
          94  +
    type Output = Result<
          95  +
        crate::input::FractionalSecondsInput,
          96  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
          97  +
    >;
          98  +
          99  +
    fn poll(
         100  +
        self: std::pin::Pin<&mut Self>,
         101  +
        cx: &mut std::task::Context<'_>,
         102  +
    ) -> std::task::Poll<Self::Output> {
         103  +
        let this = self.project();
         104  +
        this.inner.as_mut().poll(cx)
         105  +
    }
         106  +
}
         107  +
         108  +
impl<B>
         109  +
    ::aws_smithy_http_server::request::FromRequest<
         110  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         111  +
        B,
         112  +
    > for crate::input::FractionalSecondsInput
         113  +
where
         114  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         115  +
    B: 'static,
         116  +
         117  +
    B::Data: Send,
         118  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         119  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         120  +
{
         121  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         122  +
    type Future = FractionalSecondsInputFuture;
         123  +
         124  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         125  +
        let fut = async move {
         126  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         127  +
                request.headers(),
         128  +
                &CONTENT_TYPE_FRACTIONALSECONDS,
         129  +
            ) {
         130  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         131  +
            }
         132  +
            crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_http_request(
         133  +
                request,
         134  +
            )
         135  +
            .await
         136  +
            .map_err(Into::into)
         137  +
        };
         138  +
        use ::futures_util::future::TryFutureExt;
         139  +
        let fut = fut.map_err(
         140  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         141  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         142  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
         143  +
                    e,
         144  +
                )
         145  +
            },
         146  +
        );
         147  +
        FractionalSecondsInputFuture {
         148  +
            inner: Box::pin(fut),
         149  +
        }
         150  +
    }
         151  +
}
         152  +
impl
         153  +
    ::aws_smithy_http_server::response::IntoResponse<
         154  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         155  +
    > for crate::output::FractionalSecondsOutput
         156  +
{
         157  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         158  +
        match crate::protocol_serde::shape_fractional_seconds::ser_fractional_seconds_http_response(
         159  +
            self,
         160  +
        ) {
         161  +
            Ok(response) => response,
         162  +
            Err(e) => {
         163  +
                ::tracing::error!(error = %e, "failed to serialize response");
         164  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         165  +
            }
         166  +
        }
         167  +
    }
         168  +
}
         169  +
         170  +
const CONTENT_TYPE_DATETIMEOFFSETS: ::mime::Mime = ::mime::APPLICATION_JSON;
         171  +
::pin_project_lite::pin_project! {
         172  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         173  +
    /// [`DatetimeOffsetsInput`](crate::input::DatetimeOffsetsInput) using modelled bindings.
         174  +
    pub struct DatetimeOffsetsInputFuture {
         175  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DatetimeOffsetsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         176  +
    }
         177  +
}
         178  +
         179  +
impl std::future::Future for DatetimeOffsetsInputFuture {
         180  +
    type Output = Result<
         181  +
        crate::input::DatetimeOffsetsInput,
         182  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         183  +
    >;
         184  +
         185  +
    fn poll(
         186  +
        self: std::pin::Pin<&mut Self>,
         187  +
        cx: &mut std::task::Context<'_>,
         188  +
    ) -> std::task::Poll<Self::Output> {
         189  +
        let this = self.project();
         190  +
        this.inner.as_mut().poll(cx)
         191  +
    }
         192  +
}
         193  +
         194  +
impl<B>
         195  +
    ::aws_smithy_http_server::request::FromRequest<
         196  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         197  +
        B,
         198  +
    > for crate::input::DatetimeOffsetsInput
         199  +
where
         200  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         201  +
    B: 'static,
         202  +
         203  +
    B::Data: Send,
         204  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         205  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         206  +
{
         207  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         208  +
    type Future = DatetimeOffsetsInputFuture;
         209  +
         210  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         211  +
        let fut = async move {
         212  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         213  +
                request.headers(),
         214  +
                &CONTENT_TYPE_DATETIMEOFFSETS,
         215  +
            ) {
         216  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         217  +
            }
         218  +
            crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets_http_request(request)
         219  +
                .await
         220  +
                .map_err(Into::into)
         221  +
        };
         222  +
        use ::futures_util::future::TryFutureExt;
         223  +
        let fut = fut.map_err(
         224  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         225  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         226  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
         227  +
                    e,
         228  +
                )
         229  +
            },
         230  +
        );
         231  +
        DatetimeOffsetsInputFuture {
         232  +
            inner: Box::pin(fut),
         233  +
        }
         234  +
    }
         235  +
}
         236  +
impl
         237  +
    ::aws_smithy_http_server::response::IntoResponse<
         238  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         239  +
    > for crate::output::DatetimeOffsetsOutput
         240  +
{
         241  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         242  +
        match crate::protocol_serde::shape_datetime_offsets::ser_datetime_offsets_http_response(
         243  +
            self,
         244  +
        ) {
         245  +
            Ok(response) => response,
         246  +
            Err(e) => {
         247  +
                ::tracing::error!(error = %e, "failed to serialize response");
         248  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         249  +
            }
         250  +
        }
         251  +
    }
         252  +
}
         253  +
         254  +
const CONTENT_TYPE_TESTNOPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
         255  +
::pin_project_lite::pin_project! {
         256  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         257  +
    /// [`TestNoPayloadInput`](crate::input::TestNoPayloadInput) using modelled bindings.
         258  +
    pub struct TestNoPayloadInputFuture {
         259  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestNoPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         260  +
    }
         261  +
}
         262  +
         263  +
impl std::future::Future for TestNoPayloadInputFuture {
         264  +
    type Output = Result<
         265  +
        crate::input::TestNoPayloadInput,
         266  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         267  +
    >;
         268  +
         269  +
    fn poll(
         270  +
        self: std::pin::Pin<&mut Self>,
         271  +
        cx: &mut std::task::Context<'_>,
         272  +
    ) -> std::task::Poll<Self::Output> {
         273  +
        let this = self.project();
         274  +
        this.inner.as_mut().poll(cx)
         275  +
    }
         276  +
}
         277  +
         278  +
impl<B>
         279  +
    ::aws_smithy_http_server::request::FromRequest<
         280  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         281  +
        B,
         282  +
    > for crate::input::TestNoPayloadInput
         283  +
where
         284  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         285  +
    B: 'static,
         286  +
         287  +
    B::Data: Send,
         288  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         289  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         290  +
{
         291  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         292  +
    type Future = TestNoPayloadInputFuture;
         293  +
         294  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         295  +
        let fut = async move {
         296  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         297  +
                request.headers(),
         298  +
                &CONTENT_TYPE_TESTNOPAYLOAD,
         299  +
            ) {
         300  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         301  +
            }
         302  +
            crate::protocol_serde::shape_test_no_payload::de_test_no_payload_http_request(request)
         303  +
                .await
         304  +
                .map_err(Into::into)
         305  +
        };
         306  +
        use ::futures_util::future::TryFutureExt;
         307  +
        let fut = fut.map_err(
         308  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         309  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         310  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
         311  +
                    e,
         312  +
                )
         313  +
            },
         314  +
        );
         315  +
        TestNoPayloadInputFuture {
         316  +
            inner: Box::pin(fut),
         317  +
        }
         318  +
    }
         319  +
}
         320  +
impl
         321  +
    ::aws_smithy_http_server::response::IntoResponse<
         322  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         323  +
    > for crate::output::TestNoPayloadOutput
         324  +
{
         325  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         326  +
        match crate::protocol_serde::shape_test_no_payload::ser_test_no_payload_http_response(self)
         327  +
        {
         328  +
            Ok(response) => response,
         329  +
            Err(e) => {
         330  +
                ::tracing::error!(error = %e, "failed to serialize response");
         331  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         332  +
            }
         333  +
        }
         334  +
    }
         335  +
}
         336  +
    3    337   
#[allow(unreachable_code, unused_variables)]
    4         -
mod server_all_query_string_types_test {
    5         -
    /// Serializes query string parameters with all supported types
    6         -
    /// Test ID: RestJsonAllQueryStringTypes
         338  +
#[cfg(test)]
         339  +
mod test_no_payload_test {
         340  +
         341  +
    /// Serializes a GET request with no modeled body
         342  +
    /// Test ID: RestJsonHttpWithNoModeledBody
    7    343   
    #[::tokio::test]
    8         -
    async fn rest_json_all_query_string_types_request() {
         344  +
    #[::tracing_test::traced_test]
         345  +
    async fn rest_json_http_with_no_modeled_body_request() {
    9    346   
        #[allow(unused_mut)]
   10    347   
        let mut http_request = http::Request::builder()
   11         -
            .uri("/AllQueryStringTypesInput")
         348  +
            .uri("/no_payload")
   12    349   
            .method("GET")
   13    350   
            .body(::aws_smithy_http_server::body::Body::from(
   14    351   
                ::bytes::Bytes::from_static("".as_bytes()),
   15    352   
            ))
   16    353   
            .unwrap();
   17         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?String=Hello%20there&StringList=a&StringList=b&StringList=c&StringSet=a&StringSet=b&StringSet=c&Byte=1&Short=2&Integer=3&IntegerList=1&IntegerList=2&IntegerList=3&IntegerSet=1&IntegerSet=2&IntegerSet=3&Long=4&Float=1.1&Double=1.1&DoubleList=1.1&DoubleList=2.1&DoubleList=3.1&Boolean=true&BooleanList=true&BooleanList=false&BooleanList=true&Timestamp=1970-01-01T00%3A00%3A01Z&TimestampList=1970-01-01T00%3A00%3A01Z&TimestampList=1970-01-01T00%3A00%3A02Z&TimestampList=1970-01-01T00%3A00%3A03Z&Enum=Foo&EnumList=Foo&EnumList=Baz&EnumList=Bar&IntegerEnum=1&IntegerEnumList=1&IntegerEnumList=2&IntegerEnumList=3".parse().unwrap();
   18    354   
        #[allow(unused_mut)]
   19    355   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
   20    356   
        let config = crate::service::RestJsonConfig::builder().build();
   21    357   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
   22         -
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         358  +
            .test_no_payload(move |input: crate::input::TestNoPayloadInput| {
   23    359   
                let sender = sender.clone();
   24    360   
                async move {
   25    361   
                    let result = {
   26         -
                        use ::aws_smithy_protocol_test::FloatEquals;
   27         -
                        let expected = crate::input::AllQueryStringTypesInput {
   28         -
                            query_string: ::std::option::Option::Some("Hello there".to_owned()),
   29         -
                            query_string_list: ::std::option::Option::Some(vec![
   30         -
                                "a".to_owned(),
   31         -
                                "b".to_owned(),
   32         -
                                "c".to_owned(),
   33         -
                            ]),
   34         -
                            query_string_set: ::std::option::Option::Some(
   35         -
                                vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]
   36         -
                                    .try_into()
   37         -
                                    .expect("this is only used in tests"),
   38         -
                            ),
   39         -
                            query_byte: ::std::option::Option::Some(1),
   40         -
                            query_short: ::std::option::Option::Some(2),
   41         -
                            query_integer: ::std::option::Option::Some(3),
   42         -
                            query_integer_list: ::std::option::Option::Some(vec![1, 2, 3]),
   43         -
                            query_integer_set: ::std::option::Option::Some(
   44         -
                                vec![1, 2, 3]
   45         -
                                    .try_into()
   46         -
                                    .expect("this is only used in tests"),
   47         -
                            ),
   48         -
                            query_long: ::std::option::Option::Some(4),
   49         -
                            query_float: ::std::option::Option::Some(1.1_f32),
   50         -
                            query_double: ::std::option::Option::Some(1.1_f64),
   51         -
                            query_double_list: ::std::option::Option::Some(vec![
   52         -
                                1.1_f64, 2.1_f64, 3.1_f64,
   53         -
                            ]),
   54         -
                            query_boolean: ::std::option::Option::Some(true),
   55         -
                            query_boolean_list: ::std::option::Option::Some(vec![
   56         -
                                true, false, true,
   57         -
                            ]),
   58         -
                            query_timestamp: ::std::option::Option::Some(
   59         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(1, 0_f64),
   60         -
                            ),
   61         -
                            query_timestamp_list: ::std::option::Option::Some(vec![
   62         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(1, 0_f64),
   63         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(2, 0_f64),
   64         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(3, 0_f64),
   65         -
                            ]),
   66         -
                            query_enum: ::std::option::Option::Some(
   67         -
                                "Foo"
   68         -
                                    .parse::<crate::model::FooEnum>()
   69         -
                                    .expect("static value validated to member"),
   70         -
                            ),
   71         -
                            query_enum_list: ::std::option::Option::Some(vec![
   72         -
                                "Foo"
   73         -
                                    .parse::<crate::model::FooEnum>()
   74         -
                                    .expect("static value validated to member"),
   75         -
                                "Baz"
   76         -
                                    .parse::<crate::model::FooEnum>()
   77         -
                                    .expect("static value validated to member"),
   78         -
                                "Bar"
   79         -
                                    .parse::<crate::model::FooEnum>()
   80         -
                                    .expect("static value validated to member"),
   81         -
                            ]),
   82         -
                            query_integer_enum: ::std::option::Option::Some(1),
   83         -
                            query_integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
   84         -
                            query_params_map_of_string_list: ::std::option::Option::Some({
   85         -
                                let mut ret = ::std::collections::HashMap::new();
   86         -
                                ret.insert("String".to_owned(), vec!["Hello there".to_owned()]);
   87         -
                                ret.insert(
   88         -
                                    "StringList".to_owned(),
   89         -
                                    vec!["a".to_owned(), "b".to_owned(), "c".to_owned()],
   90         -
                                );
   91         -
                                ret.insert(
   92         -
                                    "StringSet".to_owned(),
   93         -
                                    vec!["a".to_owned(), "b".to_owned(), "c".to_owned()],
   94         -
                                );
   95         -
                                ret.insert("Byte".to_owned(), vec!["1".to_owned()]);
   96         -
                                ret.insert("Short".to_owned(), vec!["2".to_owned()]);
   97         -
                                ret.insert("Integer".to_owned(), vec!["3".to_owned()]);
   98         -
                                ret.insert(
   99         -
                                    "IntegerList".to_owned(),
  100         -
                                    vec!["1".to_owned(), "2".to_owned(), "3".to_owned()],
  101         -
                                );
  102         -
                                ret.insert(
  103         -
                                    "IntegerSet".to_owned(),
  104         -
                                    vec!["1".to_owned(), "2".to_owned(), "3".to_owned()],
  105         -
                                );
  106         -
                                ret.insert("Long".to_owned(), vec!["4".to_owned()]);
  107         -
                                ret.insert("Float".to_owned(), vec!["1.1".to_owned()]);
  108         -
                                ret.insert("Double".to_owned(), vec!["1.1".to_owned()]);
  109         -
                                ret.insert(
  110         -
                                    "DoubleList".to_owned(),
  111         -
                                    vec!["1.1".to_owned(), "2.1".to_owned(), "3.1".to_owned()],
  112         -
                                );
  113         -
                                ret.insert("Boolean".to_owned(), vec!["true".to_owned()]);
  114         -
                                ret.insert(
  115         -
                                    "BooleanList".to_owned(),
  116         -
                                    vec!["true".to_owned(), "false".to_owned(), "true".to_owned()],
  117         -
                                );
  118         -
                                ret.insert(
  119         -
                                    "Timestamp".to_owned(),
  120         -
                                    vec!["1970-01-01T00:00:01Z".to_owned()],
  121         -
                                );
  122         -
                                ret.insert(
  123         -
                                    "TimestampList".to_owned(),
  124         -
                                    vec![
  125         -
                                        "1970-01-01T00:00:01Z".to_owned(),
  126         -
                                        "1970-01-01T00:00:02Z".to_owned(),
  127         -
                                        "1970-01-01T00:00:03Z".to_owned(),
  128         -
                                    ],
  129         -
                                );
  130         -
                                ret.insert("Enum".to_owned(), vec!["Foo".to_owned()]);
  131         -
                                ret.insert(
  132         -
                                    "EnumList".to_owned(),
  133         -
                                    vec!["Foo".to_owned(), "Baz".to_owned(), "Bar".to_owned()],
  134         -
                                );
  135         -
                                ret.insert("IntegerEnum".to_owned(), vec!["1".to_owned()]);
  136         -
                                ret.insert(
  137         -
                                    "IntegerEnumList".to_owned(),
  138         -
                                    vec!["1".to_owned(), "2".to_owned(), "3".to_owned()],
  139         -
                                );
  140         -
                                ret
  141         -
                            }),
         362  +
                        let expected = crate::input::TestNoPayloadInput {
         363  +
                            test_id: ::std::option::Option::None,
  142    364   
                        };
  143         -
                        ::pretty_assertions::assert_eq!(
  144         -
                            input.query_string,
  145         -
                            expected.query_string,
  146         -
                            "Unexpected value for `query_string`"
  147         -
                        );
  148         -
                        ::pretty_assertions::assert_eq!(
  149         -
                            input.query_string_list,
  150         -
                            expected.query_string_list,
  151         -
                            "Unexpected value for `query_string_list`"
  152         -
                        );
  153         -
                        ::pretty_assertions::assert_eq!(
  154         -
                            input.query_string_set,
  155         -
                            expected.query_string_set,
  156         -
                            "Unexpected value for `query_string_set`"
  157         -
                        );
  158         -
                        ::pretty_assertions::assert_eq!(
  159         -
                            input.query_byte,
  160         -
                            expected.query_byte,
  161         -
                            "Unexpected value for `query_byte`"
  162         -
                        );
  163         -
                        ::pretty_assertions::assert_eq!(
  164         -
                            input.query_short,
  165         -
                            expected.query_short,
  166         -
                            "Unexpected value for `query_short`"
  167         -
                        );
  168         -
                        ::pretty_assertions::assert_eq!(
  169         -
                            input.query_integer,
  170         -
                            expected.query_integer,
  171         -
                            "Unexpected value for `query_integer`"
         365  +
                        ::pretty_assertions::assert_eq!(input, expected);
         366  +
                        let response = crate::output::TestNoPayloadOutput {
         367  +
                            test_id: ::std::option::Option::None,
         368  +
                        };
         369  +
                        response
         370  +
                    };
         371  +
                    sender.send(()).await.expect("receiver dropped early");
         372  +
                    result
         373  +
                }
         374  +
            })
         375  +
            .build_unchecked();
         376  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
         377  +
            .await
         378  +
            .expect("unable to make an HTTP request");
         379  +
        assert!(
         380  +
            receiver.recv().await.is_some(),
         381  +
            "we expected operation handler to be invoked but it was not entered"
  172    382   
        );
  173         -
                        ::pretty_assertions::assert_eq!(
  174         -
                            input.query_integer_list,
  175         -
                            expected.query_integer_list,
  176         -
                            "Unexpected value for `query_integer_list`"
  177         -
                        );
  178         -
                        ::pretty_assertions::assert_eq!(
  179         -
                            input.query_integer_set,
  180         -
                            expected.query_integer_set,
  181         -
                            "Unexpected value for `query_integer_set`"
  182         -
                        );
  183         -
                        ::pretty_assertions::assert_eq!(
  184         -
                            input.query_long,
  185         -
                            expected.query_long,
  186         -
                            "Unexpected value for `query_long`"
  187         -
                        );
  188         -
                        assert!(
  189         -
                            input.query_float.float_equals(&expected.query_float),
  190         -
                            "Unexpected value for `query_float` {:?} vs. {:?}",
  191         -
                            expected.query_float,
  192         -
                            input.query_float
  193         -
                        );
  194         -
                        assert!(
  195         -
                            input.query_double.float_equals(&expected.query_double),
  196         -
                            "Unexpected value for `query_double` {:?} vs. {:?}",
  197         -
                            expected.query_double,
  198         -
                            input.query_double
  199         -
                        );
  200         -
                        ::pretty_assertions::assert_eq!(
  201         -
                            input.query_double_list,
  202         -
                            expected.query_double_list,
  203         -
                            "Unexpected value for `query_double_list`"
  204         -
                        );
  205         -
                        ::pretty_assertions::assert_eq!(
  206         -
                            input.query_boolean,
  207         -
                            expected.query_boolean,
  208         -
                            "Unexpected value for `query_boolean`"
  209         -
                        );
  210         -
                        ::pretty_assertions::assert_eq!(
  211         -
                            input.query_boolean_list,
  212         -
                            expected.query_boolean_list,
  213         -
                            "Unexpected value for `query_boolean_list`"
  214         -
                        );
  215         -
                        ::pretty_assertions::assert_eq!(
  216         -
                            input.query_timestamp,
  217         -
                            expected.query_timestamp,
  218         -
                            "Unexpected value for `query_timestamp`"
  219         -
                        );
  220         -
                        ::pretty_assertions::assert_eq!(
  221         -
                            input.query_timestamp_list,
  222         -
                            expected.query_timestamp_list,
  223         -
                            "Unexpected value for `query_timestamp_list`"
  224         -
                        );
  225         -
                        ::pretty_assertions::assert_eq!(
  226         -
                            input.query_enum,
  227         -
                            expected.query_enum,
  228         -
                            "Unexpected value for `query_enum`"
  229         -
                        );
  230         -
                        ::pretty_assertions::assert_eq!(
  231         -
                            input.query_enum_list,
  232         -
                            expected.query_enum_list,
  233         -
                            "Unexpected value for `query_enum_list`"
  234         -
                        );
  235         -
                        ::pretty_assertions::assert_eq!(
  236         -
                            input.query_integer_enum,
  237         -
                            expected.query_integer_enum,
  238         -
                            "Unexpected value for `query_integer_enum`"
  239         -
                        );
  240         -
                        ::pretty_assertions::assert_eq!(
  241         -
                            input.query_integer_enum_list,
  242         -
                            expected.query_integer_enum_list,
  243         -
                            "Unexpected value for `query_integer_enum_list`"
  244         -
                        );
  245         -
                        ::pretty_assertions::assert_eq!(
  246         -
                            input.query_params_map_of_string_list,
  247         -
                            expected.query_params_map_of_string_list,
  248         -
                            "Unexpected value for `query_params_map_of_string_list`"
  249         -
                        );
  250         -
                        let response = crate::output::AllQueryStringTypesOutput {};
  251         -
                        Ok(response)
  252         -
                    };
  253         -
                    sender.send(()).await.expect("receiver dropped early");
  254         -
                    result
  255         -
                }
  256         -
            })
  257         -
            .build_unchecked();
  258         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  259         -
            .await
  260         -
            .expect("unable to make an HTTP request");
  261         -
        assert!(receiver.recv().await.is_some());
  262    383   
    }
  263         -
    /// Handles query string maps
  264         -
    /// Test ID: RestJsonQueryStringMap
         384  +
    /// Serializes a GET request with header member but no modeled body
         385  +
    /// Test ID: RestJsonHttpWithHeaderMemberNoModeledBody
  265    386   
    #[::tokio::test]
  266         -
    async fn rest_json_query_string_map_request() {
         387  +
    #[::tracing_test::traced_test]
         388  +
    async fn rest_json_http_with_header_member_no_modeled_body_request() {
  267    389   
        #[allow(unused_mut)]
  268    390   
        let mut http_request = http::Request::builder()
  269         -
            .uri("/AllQueryStringTypesInput")
         391  +
            .uri("/no_payload")
  270    392   
            .method("GET")
         393  +
            .header("X-Amz-Test-Id", "t-12345")
  271    394   
            .body(::aws_smithy_http_server::body::Body::from(
  272    395   
                ::bytes::Bytes::from_static("".as_bytes()),
  273    396   
            ))
  274    397   
            .unwrap();
  275         -
        *http_request.uri_mut() =
  276         -
            "/AllQueryStringTypesInput?QueryParamsStringKeyA=Foo&QueryParamsStringKeyB=Bar"
  277         -
                .parse()
  278         -
                .unwrap();
  279    398   
        #[allow(unused_mut)]
  280    399   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  281    400   
        let config = crate::service::RestJsonConfig::builder().build();
  282    401   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
  283         -
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         402  +
            .test_no_payload(move |input: crate::input::TestNoPayloadInput| {
  284    403   
                let sender = sender.clone();
  285    404   
                async move {
  286    405   
                    let result = {
  287         -
                        use ::aws_smithy_protocol_test::FloatEquals;
  288         -
                        let expected = crate::input::AllQueryStringTypesInput {
  289         -
                            query_params_map_of_string_list: ::std::option::Option::Some({
  290         -
                                let mut ret = ::std::collections::HashMap::new();
  291         -
                                ret.insert(
  292         -
                                    "QueryParamsStringKeyA".to_owned(),
  293         -
                                    vec!["Foo".to_owned()],
  294         -
                                );
  295         -
                                ret.insert(
  296         -
                                    "QueryParamsStringKeyB".to_owned(),
  297         -
                                    vec!["Bar".to_owned()],
  298         -
                                );
  299         -
                                ret
  300         -
                            }),
  301         -
                            query_string: ::std::option::Option::None,
  302         -
                            query_string_list: ::std::option::Option::None,
  303         -
                            query_string_set: ::std::option::Option::None,
  304         -
                            query_byte: ::std::option::Option::None,
  305         -
                            query_short: ::std::option::Option::None,
  306         -
                            query_integer: ::std::option::Option::None,
  307         -
                            query_integer_list: ::std::option::Option::None,
  308         -
                            query_integer_set: ::std::option::Option::None,
  309         -
                            query_long: ::std::option::Option::None,
  310         -
                            query_float: ::std::option::Option::None,
  311         -
                            query_double: ::std::option::Option::None,
  312         -
                            query_double_list: ::std::option::Option::None,
  313         -
                            query_boolean: ::std::option::Option::None,
  314         -
                            query_boolean_list: ::std::option::Option::None,
  315         -
                            query_timestamp: ::std::option::Option::None,
  316         -
                            query_timestamp_list: ::std::option::Option::None,
  317         -
                            query_enum: ::std::option::Option::None,
  318         -
                            query_enum_list: ::std::option::Option::None,
  319         -
                            query_integer_enum: ::std::option::Option::None,
  320         -
                            query_integer_enum_list: ::std::option::Option::None,
         406  +
                        let expected = crate::input::TestNoPayloadInput {
         407  +
                            test_id: ::std::option::Option::Some("t-12345".to_owned()),
  321    408   
                        };
  322         -
                        ::pretty_assertions::assert_eq!(
  323         -
                            input.query_string,
  324         -
                            expected.query_string,
  325         -
                            "Unexpected value for `query_string`"
  326         -
                        );
  327         -
                        ::pretty_assertions::assert_eq!(
  328         -
                            input.query_string_list,
  329         -
                            expected.query_string_list,
  330         -
                            "Unexpected value for `query_string_list`"
  331         -
                        );
  332         -
                        ::pretty_assertions::assert_eq!(
  333         -
                            input.query_string_set,
  334         -
                            expected.query_string_set,
  335         -
                            "Unexpected value for `query_string_set`"
  336         -
                        );
  337         -
                        ::pretty_assertions::assert_eq!(
  338         -
                            input.query_byte,
  339         -
                            expected.query_byte,
  340         -
                            "Unexpected value for `query_byte`"
  341         -
                        );
  342         -
                        ::pretty_assertions::assert_eq!(
  343         -
                            input.query_short,
  344         -
                            expected.query_short,
  345         -
                            "Unexpected value for `query_short`"
  346         -
                        );
  347         -
                        ::pretty_assertions::assert_eq!(
  348         -
                            input.query_integer,
  349         -
                            expected.query_integer,
  350         -
                            "Unexpected value for `query_integer`"
  351         -
                        );
  352         -
                        ::pretty_assertions::assert_eq!(
  353         -
                            input.query_integer_list,
  354         -
                            expected.query_integer_list,
  355         -
                            "Unexpected value for `query_integer_list`"
  356         -
                        );
  357         -
                        ::pretty_assertions::assert_eq!(
  358         -
                            input.query_integer_set,
  359         -
                            expected.query_integer_set,
  360         -
                            "Unexpected value for `query_integer_set`"
  361         -
                        );
  362         -
                        ::pretty_assertions::assert_eq!(
  363         -
                            input.query_long,
  364         -
                            expected.query_long,
  365         -
                            "Unexpected value for `query_long`"
  366         -
                        );
  367         -
                        assert!(
  368         -
                            input.query_float.float_equals(&expected.query_float),
  369         -
                            "Unexpected value for `query_float` {:?} vs. {:?}",
  370         -
                            expected.query_float,
  371         -
                            input.query_float
  372         -
                        );
  373         -
                        assert!(
  374         -
                            input.query_double.float_equals(&expected.query_double),
  375         -
                            "Unexpected value for `query_double` {:?} vs. {:?}",
  376         -
                            expected.query_double,
  377         -
                            input.query_double
  378         -
                        );
  379         -
                        ::pretty_assertions::assert_eq!(
  380         -
                            input.query_double_list,
  381         -
                            expected.query_double_list,
  382         -
                            "Unexpected value for `query_double_list`"
  383         -
                        );
  384         -
                        ::pretty_assertions::assert_eq!(
  385         -
                            input.query_boolean,
  386         -
                            expected.query_boolean,
  387         -
                            "Unexpected value for `query_boolean`"
  388         -
                        );
  389         -
                        ::pretty_assertions::assert_eq!(
  390         -
                            input.query_boolean_list,
  391         -
                            expected.query_boolean_list,
  392         -
                            "Unexpected value for `query_boolean_list`"
  393         -
                        );
  394         -
                        ::pretty_assertions::assert_eq!(
  395         -
                            input.query_timestamp,
  396         -
                            expected.query_timestamp,
  397         -
                            "Unexpected value for `query_timestamp`"
  398         -
                        );
  399         -
                        ::pretty_assertions::assert_eq!(
  400         -
                            input.query_timestamp_list,
  401         -
                            expected.query_timestamp_list,
  402         -
                            "Unexpected value for `query_timestamp_list`"
  403         -
                        );
  404         -
                        ::pretty_assertions::assert_eq!(
  405         -
                            input.query_enum,
  406         -
                            expected.query_enum,
  407         -
                            "Unexpected value for `query_enum`"
  408         -
                        );
  409         -
                        ::pretty_assertions::assert_eq!(
  410         -
                            input.query_enum_list,
  411         -
                            expected.query_enum_list,
  412         -
                            "Unexpected value for `query_enum_list`"
  413         -
                        );
  414         -
                        ::pretty_assertions::assert_eq!(
  415         -
                            input.query_integer_enum,
  416         -
                            expected.query_integer_enum,
  417         -
                            "Unexpected value for `query_integer_enum`"
  418         -
                        );
  419         -
                        ::pretty_assertions::assert_eq!(
  420         -
                            input.query_integer_enum_list,
  421         -
                            expected.query_integer_enum_list,
  422         -
                            "Unexpected value for `query_integer_enum_list`"
  423         -
                        );
  424         -
                        ::pretty_assertions::assert_eq!(
  425         -
                            input.query_params_map_of_string_list,
  426         -
                            expected.query_params_map_of_string_list,
  427         -
                            "Unexpected value for `query_params_map_of_string_list`"
  428         -
                        );
  429         -
                        let response = crate::output::AllQueryStringTypesOutput {};
  430         -
                        Ok(response)
         409  +
                        ::pretty_assertions::assert_eq!(input, expected);
         410  +
                        let response = crate::output::TestNoPayloadOutput {
         411  +
                            test_id: ::std::option::Option::None,
         412  +
                        };
         413  +
                        response
  431    414   
                    };
  432    415   
                    sender.send(()).await.expect("receiver dropped early");
  433    416   
                    result
  434    417   
                }
  435    418   
            })
  436    419   
            .build_unchecked();
  437    420   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  438    421   
            .await
  439    422   
            .expect("unable to make an HTTP request");
  440         -
        assert!(receiver.recv().await.is_some());
         423  +
        assert!(
         424  +
            receiver.recv().await.is_some(),
         425  +
            "we expected operation handler to be invoked but it was not entered"
         426  +
        );
  441    427   
    }
  442         -
    /// Handles escaping all required characters in the query string.
  443         -
    /// Test ID: RestJsonQueryStringEscaping
         428  +
}
         429  +
         430  +
::pin_project_lite::pin_project! {
         431  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         432  +
    /// [`TestPayloadBlobInput`](crate::input::TestPayloadBlobInput) using modelled bindings.
         433  +
    pub struct TestPayloadBlobInputFuture {
         434  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestPayloadBlobInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         435  +
    }
         436  +
}
         437  +
         438  +
impl std::future::Future for TestPayloadBlobInputFuture {
         439  +
    type Output = Result<
         440  +
        crate::input::TestPayloadBlobInput,
         441  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         442  +
    >;
         443  +
         444  +
    fn poll(
         445  +
        self: std::pin::Pin<&mut Self>,
         446  +
        cx: &mut std::task::Context<'_>,
         447  +
    ) -> std::task::Poll<Self::Output> {
         448  +
        let this = self.project();
         449  +
        this.inner.as_mut().poll(cx)
         450  +
    }
         451  +
}
         452  +
         453  +
impl<B>
         454  +
    ::aws_smithy_http_server::request::FromRequest<
         455  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         456  +
        B,
         457  +
    > for crate::input::TestPayloadBlobInput
         458  +
where
         459  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         460  +
    B: 'static,
         461  +
         462  +
    B::Data: Send,
         463  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         464  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         465  +
{
         466  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         467  +
    type Future = TestPayloadBlobInputFuture;
         468  +
         469  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         470  +
        let fut = async move {
         471  +
            crate::protocol_serde::shape_test_payload_blob::de_test_payload_blob_http_request(
         472  +
                request,
         473  +
            )
         474  +
            .await
         475  +
            .map_err(Into::into)
         476  +
        };
         477  +
        use ::futures_util::future::TryFutureExt;
         478  +
        let fut = fut.map_err(
         479  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         480  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         481  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
         482  +
                    e,
         483  +
                )
         484  +
            },
         485  +
        );
         486  +
        TestPayloadBlobInputFuture {
         487  +
            inner: Box::pin(fut),
         488  +
        }
         489  +
    }
         490  +
}
         491  +
impl
         492  +
    ::aws_smithy_http_server::response::IntoResponse<
         493  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         494  +
    > for crate::output::TestPayloadBlobOutput
         495  +
{
         496  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         497  +
        match crate::protocol_serde::shape_test_payload_blob::ser_test_payload_blob_http_response(
         498  +
            self,
         499  +
        ) {
         500  +
            Ok(response) => response,
         501  +
            Err(e) => {
         502  +
                ::tracing::error!(error = %e, "failed to serialize response");
         503  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         504  +
            }
         505  +
        }
         506  +
    }
         507  +
}
         508  +
         509  +
#[allow(unreachable_code, unused_variables)]
         510  +
#[cfg(test)]
         511  +
mod test_payload_blob_test {
         512  +
         513  +
    /// Serializes a payload targeting an empty blob
         514  +
    /// Test ID: RestJsonHttpWithEmptyBlobPayload
  444    515   
    #[::tokio::test]
  445         -
    async fn rest_json_query_string_escaping_request() {
         516  +
    #[::tracing_test::traced_test]
         517  +
    async fn rest_json_http_with_empty_blob_payload_request() {
  446    518   
        #[allow(unused_mut)]
  447    519   
        let mut http_request = http::Request::builder()
  448         -
            .uri("/AllQueryStringTypesInput")
  449         -
            .method("GET")
         520  +
            .uri("/blob_payload")
         521  +
            .method("POST")
         522  +
            .header("Content-Type", "application/octet-stream")
  450    523   
            .body(::aws_smithy_http_server::body::Body::from(
  451    524   
                ::bytes::Bytes::from_static("".as_bytes()),
  452    525   
            ))
  453    526   
            .unwrap();
  454         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?String=%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9".parse().unwrap();
  455    527   
        #[allow(unused_mut)]
  456    528   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  457    529   
        let config = crate::service::RestJsonConfig::builder().build();
  458    530   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
  459         -
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         531  +
            .test_payload_blob(move |input: crate::input::TestPayloadBlobInput| {
  460    532   
                let sender = sender.clone();
  461    533   
                async move {
  462    534   
                    let result = {
  463         -
                        use ::aws_smithy_protocol_test::FloatEquals;
  464         -
                        let expected = crate::input::AllQueryStringTypesInput {
  465         -
                            query_string: ::std::option::Option::Some(
  466         -
                                " %:/?#[]@!$&'()*+,;=😹".to_owned(),
         535  +
                        let expected = crate::input::TestPayloadBlobInput {
         536  +
                            content_type: ::std::option::Option::Some(
         537  +
                                "application/octet-stream".to_owned(),
  467    538   
                            ),
  468         -
                            query_params_map_of_string_list: ::std::option::Option::Some({
  469         -
                                let mut ret = ::std::collections::HashMap::new();
  470         -
                                ret.insert(
  471         -
                                    "String".to_owned(),
  472         -
                                    vec![" %:/?#[]@!$&'()*+,;=😹".to_owned()],
  473         -
                                );
  474         -
                                ret
  475         -
                            }),
  476         -
                            query_string_list: ::std::option::Option::None,
  477         -
                            query_string_set: ::std::option::Option::None,
  478         -
                            query_byte: ::std::option::Option::None,
  479         -
                            query_short: ::std::option::Option::None,
  480         -
                            query_integer: ::std::option::Option::None,
  481         -
                            query_integer_list: ::std::option::Option::None,
  482         -
                            query_integer_set: ::std::option::Option::None,
  483         -
                            query_long: ::std::option::Option::None,
  484         -
                            query_float: ::std::option::Option::None,
  485         -
                            query_double: ::std::option::Option::None,
  486         -
                            query_double_list: ::std::option::Option::None,
  487         -
                            query_boolean: ::std::option::Option::None,
  488         -
                            query_boolean_list: ::std::option::Option::None,
  489         -
                            query_timestamp: ::std::option::Option::None,
  490         -
                            query_timestamp_list: ::std::option::Option::None,
  491         -
                            query_enum: ::std::option::Option::None,
  492         -
                            query_enum_list: ::std::option::Option::None,
  493         -
                            query_integer_enum: ::std::option::Option::None,
  494         -
                            query_integer_enum_list: ::std::option::Option::None,
         539  +
                            data: ::std::option::Option::None,
  495    540   
                        };
  496         -
                        ::pretty_assertions::assert_eq!(
  497         -
                            input.query_string,
  498         -
                            expected.query_string,
  499         -
                            "Unexpected value for `query_string`"
  500         -
                        );
  501         -
                        ::pretty_assertions::assert_eq!(
  502         -
                            input.query_string_list,
  503         -
                            expected.query_string_list,
  504         -
                            "Unexpected value for `query_string_list`"
  505         -
                        );
  506         -
                        ::pretty_assertions::assert_eq!(
  507         -
                            input.query_string_set,
  508         -
                            expected.query_string_set,
  509         -
                            "Unexpected value for `query_string_set`"
  510         -
                        );
  511         -
                        ::pretty_assertions::assert_eq!(
  512         -
                            input.query_byte,
  513         -
                            expected.query_byte,
  514         -
                            "Unexpected value for `query_byte`"
  515         -
                        );
  516         -
                        ::pretty_assertions::assert_eq!(
  517         -
                            input.query_short,
  518         -
                            expected.query_short,
  519         -
                            "Unexpected value for `query_short`"
  520         -
                        );
  521         -
                        ::pretty_assertions::assert_eq!(
  522         -
                            input.query_integer,
  523         -
                            expected.query_integer,
  524         -
                            "Unexpected value for `query_integer`"
  525         -
                        );
  526         -
                        ::pretty_assertions::assert_eq!(
  527         -
                            input.query_integer_list,
  528         -
                            expected.query_integer_list,
  529         -
                            "Unexpected value for `query_integer_list`"
  530         -
                        );
  531         -
                        ::pretty_assertions::assert_eq!(
  532         -
                            input.query_integer_set,
  533         -
                            expected.query_integer_set,
  534         -
                            "Unexpected value for `query_integer_set`"
  535         -
                        );
  536         -
                        ::pretty_assertions::assert_eq!(
  537         -
                            input.query_long,
  538         -
                            expected.query_long,
  539         -
                            "Unexpected value for `query_long`"
  540         -
                        );
  541         -
                        assert!(
  542         -
                            input.query_float.float_equals(&expected.query_float),
  543         -
                            "Unexpected value for `query_float` {:?} vs. {:?}",
  544         -
                            expected.query_float,
  545         -
                            input.query_float
  546         -
                        );
  547         -
                        assert!(
  548         -
                            input.query_double.float_equals(&expected.query_double),
  549         -
                            "Unexpected value for `query_double` {:?} vs. {:?}",
  550         -
                            expected.query_double,
  551         -
                            input.query_double
  552         -
                        );
  553         -
                        ::pretty_assertions::assert_eq!(
  554         -
                            input.query_double_list,
  555         -
                            expected.query_double_list,
  556         -
                            "Unexpected value for `query_double_list`"
  557         -
                        );
  558         -
                        ::pretty_assertions::assert_eq!(
  559         -
                            input.query_boolean,
  560         -
                            expected.query_boolean,
  561         -
                            "Unexpected value for `query_boolean`"
  562         -
                        );
  563         -
                        ::pretty_assertions::assert_eq!(
  564         -
                            input.query_boolean_list,
  565         -
                            expected.query_boolean_list,
  566         -
                            "Unexpected value for `query_boolean_list`"
  567         -
                        );
  568         -
                        ::pretty_assertions::assert_eq!(
  569         -
                            input.query_timestamp,
  570         -
                            expected.query_timestamp,
  571         -
                            "Unexpected value for `query_timestamp`"
  572         -
                        );
  573         -
                        ::pretty_assertions::assert_eq!(
  574         -
                            input.query_timestamp_list,
  575         -
                            expected.query_timestamp_list,
  576         -
                            "Unexpected value for `query_timestamp_list`"
  577         -
                        );
  578         -
                        ::pretty_assertions::assert_eq!(
  579         -
                            input.query_enum,
  580         -
                            expected.query_enum,
  581         -
                            "Unexpected value for `query_enum`"
  582         -
                        );
  583         -
                        ::pretty_assertions::assert_eq!(
  584         -
                            input.query_enum_list,
  585         -
                            expected.query_enum_list,
  586         -
                            "Unexpected value for `query_enum_list`"
  587         -
                        );
  588         -
                        ::pretty_assertions::assert_eq!(
  589         -
                            input.query_integer_enum,
  590         -
                            expected.query_integer_enum,
  591         -
                            "Unexpected value for `query_integer_enum`"
  592         -
                        );
  593         -
                        ::pretty_assertions::assert_eq!(
  594         -
                            input.query_integer_enum_list,
  595         -
                            expected.query_integer_enum_list,
  596         -
                            "Unexpected value for `query_integer_enum_list`"
  597         -
                        );
  598         -
                        ::pretty_assertions::assert_eq!(
  599         -
                            input.query_params_map_of_string_list,
  600         -
                            expected.query_params_map_of_string_list,
  601         -
                            "Unexpected value for `query_params_map_of_string_list`"
  602         -
                        );
  603         -
                        let response = crate::output::AllQueryStringTypesOutput {};
  604         -
                        Ok(response)
         541  +
                        ::pretty_assertions::assert_eq!(input, expected);
         542  +
                        let response = crate::output::TestPayloadBlobOutput {
         543  +
                            content_type: ::std::option::Option::None,
         544  +
                            data: ::std::option::Option::None,
         545  +
                        };
         546  +
                        response
  605    547   
                    };
  606    548   
                    sender.send(()).await.expect("receiver dropped early");
  607    549   
                    result
  608    550   
                }
  609    551   
            })
  610    552   
            .build_unchecked();
  611    553   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  612    554   
            .await
  613    555   
            .expect("unable to make an HTTP request");
  614         -
        assert!(receiver.recv().await.is_some());
         556  +
        assert!(
         557  +
            receiver.recv().await.is_some(),
         558  +
            "we expected operation handler to be invoked but it was not entered"
         559  +
        );
  615    560   
    }
  616         -
    /// Supports handling NaN float query values.
  617         -
    /// Test ID: RestJsonSupportsNaNFloatQueryValues
         561  +
    /// Serializes a payload targeting a blob
         562  +
    /// Test ID: RestJsonTestPayloadBlob
  618    563   
    #[::tokio::test]
  619         -
    async fn rest_json_supports_na_n_float_query_values_request() {
         564  +
    #[::tracing_test::traced_test]
         565  +
    async fn rest_json_test_payload_blob_request() {
  620    566   
        #[allow(unused_mut)]
  621    567   
        let mut http_request = http::Request::builder()
  622         -
            .uri("/AllQueryStringTypesInput")
  623         -
            .method("GET")
         568  +
            .uri("/blob_payload")
         569  +
            .method("POST")
         570  +
            .header("Content-Type", "image/jpg")
  624    571   
            .body(::aws_smithy_http_server::body::Body::from(
  625         -
                ::bytes::Bytes::from_static("".as_bytes()),
         572  +
                ::bytes::Bytes::from_static("1234".as_bytes()),
  626    573   
            ))
  627    574   
            .unwrap();
  628         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=NaN&Double=NaN"
  629         -
            .parse()
  630         -
            .unwrap();
  631    575   
        #[allow(unused_mut)]
  632    576   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  633    577   
        let config = crate::service::RestJsonConfig::builder().build();
  634    578   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
  635         -
                        .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         579  +
            .test_payload_blob(move |input: crate::input::TestPayloadBlobInput| {
  636    580   
                let sender = sender.clone();
  637    581   
                async move {
  638         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
  639         -
        let expected =
  640         -
            crate::input::AllQueryStringTypesInput {
  641         -
                query_float:
  642         -
                    ::std::option::Option::Some(
  643         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
  644         -
                    )
  645         -
                ,
  646         -
                query_double:
  647         -
                    ::std::option::Option::Some(
  648         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
  649         -
                    )
  650         -
                ,
  651         -
                query_params_map_of_string_list:
  652         -
                    ::std::option::Option::Some(
  653         -
                         {
  654         -
                            let mut ret = ::std::collections::HashMap::new();
  655         -
                            ret.insert(
  656         -
                                "Float".to_owned()
  657         -
                                ,
  658         -
                                vec![
  659         -
                                    "NaN".to_owned()
  660         -
                                    ,
  661         -
                                ]
  662         -
                            );
  663         -
                            ret.insert(
  664         -
                                "Double".to_owned()
  665         -
                                ,
  666         -
                                vec![
  667         -
                                    "NaN".to_owned()
  668         -
                                    ,
  669         -
                                ]
         582  +
                    let result = {
         583  +
                        let expected = crate::input::TestPayloadBlobInput {
         584  +
                            content_type: ::std::option::Option::Some("image/jpg".to_owned()),
         585  +
                            data: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
         586  +
                                "1234",
         587  +
                            )),
         588  +
                        };
         589  +
                        ::pretty_assertions::assert_eq!(input, expected);
         590  +
                        let response = crate::output::TestPayloadBlobOutput {
         591  +
                            content_type: ::std::option::Option::None,
         592  +
                            data: ::std::option::Option::None,
         593  +
                        };
         594  +
                        response
         595  +
                    };
         596  +
                    sender.send(()).await.expect("receiver dropped early");
         597  +
                    result
         598  +
                }
         599  +
            })
         600  +
            .build_unchecked();
         601  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
         602  +
            .await
         603  +
            .expect("unable to make an HTTP request");
         604  +
        assert!(
         605  +
            receiver.recv().await.is_some(),
         606  +
            "we expected operation handler to be invoked but it was not entered"
  670    607   
        );
  671         -
                            ret
  672    608   
    }
         609  +
}
         610  +
         611  +
const CONTENT_TYPE_TESTPAYLOADSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
         612  +
::pin_project_lite::pin_project! {
         613  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         614  +
    /// [`TestPayloadStructureInput`](crate::input::TestPayloadStructureInput) using modelled bindings.
         615  +
    pub struct TestPayloadStructureInputFuture {
         616  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestPayloadStructureInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         617  +
    }
         618  +
}
         619  +
         620  +
impl std::future::Future for TestPayloadStructureInputFuture {
         621  +
    type Output = Result<
         622  +
        crate::input::TestPayloadStructureInput,
         623  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         624  +
    >;
         625  +
         626  +
    fn poll(
         627  +
        self: std::pin::Pin<&mut Self>,
         628  +
        cx: &mut std::task::Context<'_>,
         629  +
    ) -> std::task::Poll<Self::Output> {
         630  +
        let this = self.project();
         631  +
        this.inner.as_mut().poll(cx)
         632  +
    }
         633  +
}
         634  +
         635  +
impl<B>
         636  +
    ::aws_smithy_http_server::request::FromRequest<
         637  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         638  +
        B,
         639  +
    > for crate::input::TestPayloadStructureInput
         640  +
where
         641  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         642  +
    B: 'static,
         643  +
         644  +
    B::Data: Send,
         645  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         646  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         647  +
{
         648  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         649  +
    type Future = TestPayloadStructureInputFuture;
         650  +
         651  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         652  +
        let fut = async move {
         653  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         654  +
                request.headers(),
         655  +
                &CONTENT_TYPE_TESTPAYLOADSTRUCTURE,
         656  +
            ) {
         657  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         658  +
            }
         659  +
            crate::protocol_serde::shape_test_payload_structure::de_test_payload_structure_http_request(request)
         660  +
                            .await
         661  +
                            .map_err(Into::into)
         662  +
        };
         663  +
        use ::futures_util::future::TryFutureExt;
         664  +
        let fut = fut.map_err(
         665  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         666  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         667  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
         668  +
                    e,
  673    669   
                )
  674         -
                ,
  675         -
                query_string:
  676         -
                    ::std::option::Option::None
  677         -
                ,
  678         -
                query_string_list:
  679         -
                    ::std::option::Option::None
  680         -
                ,
  681         -
                query_string_set:
  682         -
                    ::std::option::Option::None
  683         -
                ,
  684         -
                query_byte:
  685         -
                    ::std::option::Option::None
  686         -
                ,
  687         -
                query_short:
  688         -
                    ::std::option::Option::None
  689         -
                ,
  690         -
                query_integer:
  691         -
                    ::std::option::Option::None
  692         -
                ,
  693         -
                query_integer_list:
  694         -
                    ::std::option::Option::None
  695         -
                ,
  696         -
                query_integer_set:
  697         -
                    ::std::option::Option::None
  698         -
                ,
  699         -
                query_long:
  700         -
                    ::std::option::Option::None
  701         -
                ,
  702         -
                query_double_list:
  703         -
                    ::std::option::Option::None
  704         -
                ,
  705         -
                query_boolean:
  706         -
                    ::std::option::Option::None
  707         -
                ,
  708         -
                query_boolean_list:
  709         -
                    ::std::option::Option::None
  710         -
                ,
  711         -
                query_timestamp:
  712         -
                    ::std::option::Option::None
  713         -
                ,
  714         -
                query_timestamp_list:
  715         -
                    ::std::option::Option::None
  716         -
                ,
  717         -
                query_enum:
  718         -
                    ::std::option::Option::None
  719         -
                ,
  720         -
                query_enum_list:
  721         -
                    ::std::option::Option::None
  722         -
                ,
  723         -
                query_integer_enum:
  724         -
                    ::std::option::Option::None
  725         -
                ,
  726         -
                query_integer_enum_list:
  727         -
                    ::std::option::Option::None
  728         -
                ,
         670  +
            },
         671  +
        );
         672  +
        TestPayloadStructureInputFuture {
         673  +
            inner: Box::pin(fut),
  729    674   
        }
  730         -
        ;
  731         -
        ::pretty_assertions::assert_eq!(input.query_string, expected.query_string, "Unexpected value for `query_string`");
  732         -
        ::pretty_assertions::assert_eq!(input.query_string_list, expected.query_string_list, "Unexpected value for `query_string_list`");
  733         -
        ::pretty_assertions::assert_eq!(input.query_string_set, expected.query_string_set, "Unexpected value for `query_string_set`");
  734         -
        ::pretty_assertions::assert_eq!(input.query_byte, expected.query_byte, "Unexpected value for `query_byte`");
  735         -
        ::pretty_assertions::assert_eq!(input.query_short, expected.query_short, "Unexpected value for `query_short`");
  736         -
        ::pretty_assertions::assert_eq!(input.query_integer, expected.query_integer, "Unexpected value for `query_integer`");
  737         -
        ::pretty_assertions::assert_eq!(input.query_integer_list, expected.query_integer_list, "Unexpected value for `query_integer_list`");
  738         -
        ::pretty_assertions::assert_eq!(input.query_integer_set, expected.query_integer_set, "Unexpected value for `query_integer_set`");
  739         -
        ::pretty_assertions::assert_eq!(input.query_long, expected.query_long, "Unexpected value for `query_long`");
  740         -
        assert!(input.query_float.float_equals(&expected.query_float),
  741         -
                                            "Unexpected value for `query_float` {:?} vs. {:?}", expected.query_float, input.query_float);
  742         -
        assert!(input.query_double.float_equals(&expected.query_double),
  743         -
                                            "Unexpected value for `query_double` {:?} vs. {:?}", expected.query_double, input.query_double);
  744         -
        ::pretty_assertions::assert_eq!(input.query_double_list, expected.query_double_list, "Unexpected value for `query_double_list`");
  745         -
        ::pretty_assertions::assert_eq!(input.query_boolean, expected.query_boolean, "Unexpected value for `query_boolean`");
  746         -
        ::pretty_assertions::assert_eq!(input.query_boolean_list, expected.query_boolean_list, "Unexpected value for `query_boolean_list`");
  747         -
        ::pretty_assertions::assert_eq!(input.query_timestamp, expected.query_timestamp, "Unexpected value for `query_timestamp`");
  748         -
        ::pretty_assertions::assert_eq!(input.query_timestamp_list, expected.query_timestamp_list, "Unexpected value for `query_timestamp_list`");
  749         -
        ::pretty_assertions::assert_eq!(input.query_enum, expected.query_enum, "Unexpected value for `query_enum`");
  750         -
        ::pretty_assertions::assert_eq!(input.query_enum_list, expected.query_enum_list, "Unexpected value for `query_enum_list`");
  751         -
        ::pretty_assertions::assert_eq!(input.query_integer_enum, expected.query_integer_enum, "Unexpected value for `query_integer_enum`");
  752         -
        ::pretty_assertions::assert_eq!(input.query_integer_enum_list, expected.query_integer_enum_list, "Unexpected value for `query_integer_enum_list`");
  753         -
        ::pretty_assertions::assert_eq!(input.query_params_map_of_string_list, expected.query_params_map_of_string_list, "Unexpected value for `query_params_map_of_string_list`");
  754         -
        let response =
  755         -
            crate::output::AllQueryStringTypesOutput {
  756    675   
    }
  757         -
        ;
  758         -
        Ok(response) };
         676  +
}
         677  +
impl
         678  +
    ::aws_smithy_http_server::response::IntoResponse<
         679  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         680  +
    > for crate::output::TestPayloadStructureOutput
         681  +
{
         682  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         683  +
        match crate::protocol_serde::shape_test_payload_structure::ser_test_payload_structure_http_response(self) {
         684  +
                        Ok(response) => response,
         685  +
                        Err(e) => {
         686  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         687  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         688  +
                        }
         689  +
                    }
         690  +
    }
         691  +
}
         692  +
         693  +
#[allow(unreachable_code, unused_variables)]
         694  +
#[cfg(test)]
         695  +
mod test_payload_structure_test {
         696  +
         697  +
    /// Serializes a payload targeting an empty structure
         698  +
    /// Test ID: RestJsonHttpWithEmptyStructurePayload
         699  +
    #[::tokio::test]
         700  +
    #[::tracing_test::traced_test]
         701  +
    async fn rest_json_http_with_empty_structure_payload_request() {
         702  +
        #[allow(unused_mut)]
         703  +
        let mut http_request = http::Request::builder()
         704  +
            .uri("/payload")
         705  +
            .method("POST")
         706  +
            .header("Content-Type", "application/json")
         707  +
            .body(::aws_smithy_http_server::body::Body::from(
         708  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
         709  +
            ))
         710  +
            .unwrap();
         711  +
        #[allow(unused_mut)]
         712  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
         713  +
        let config = crate::service::RestJsonConfig::builder().build();
         714  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
         715  +
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
         716  +
                let sender = sender.clone();
         717  +
                async move {
         718  +
                    let result = {
         719  +
                        let expected = crate::input::TestPayloadStructureInput {
         720  +
                            payload_config: ::std::option::Option::Some(
         721  +
                                crate::model::PayloadConfig {
         722  +
                                    data: ::std::option::Option::None,
         723  +
                                },
         724  +
                            ),
         725  +
                            test_id: ::std::option::Option::None,
         726  +
                        };
         727  +
                        ::pretty_assertions::assert_eq!(input, expected);
         728  +
                        let response = crate::output::TestPayloadStructureOutput {
         729  +
                            payload_config: ::std::option::Option::Some(
         730  +
                                crate::model::PayloadConfig {
         731  +
                                    data: ::std::option::Option::None,
         732  +
                                },
         733  +
                            ),
         734  +
                            test_id: ::std::option::Option::None,
         735  +
                        };
         736  +
                        response
         737  +
                    };
  759    738   
                    sender.send(()).await.expect("receiver dropped early");
  760    739   
                    result
  761    740   
                }
  762    741   
            })
  763    742   
            .build_unchecked();
  764    743   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  765    744   
            .await
  766    745   
            .expect("unable to make an HTTP request");
  767         -
        assert!(receiver.recv().await.is_some());
         746  +
        assert!(
         747  +
            receiver.recv().await.is_some(),
         748  +
            "we expected operation handler to be invoked but it was not entered"
         749  +
        );
  768    750   
    }
  769         -
    /// Supports handling Infinity float query values.
  770         -
    /// Test ID: RestJsonSupportsInfinityFloatQueryValues
         751  +
    /// Serializes a payload targeting a structure
         752  +
    /// Test ID: RestJsonTestPayloadStructure
  771    753   
    #[::tokio::test]
  772         -
    async fn rest_json_supports_infinity_float_query_values_request() {
         754  +
    #[::tracing_test::traced_test]
         755  +
    async fn rest_json_test_payload_structure_request() {
  773    756   
        #[allow(unused_mut)]
  774    757   
        let mut http_request = http::Request::builder()
  775         -
            .uri("/AllQueryStringTypesInput")
  776         -
            .method("GET")
         758  +
            .uri("/payload")
         759  +
            .method("POST")
         760  +
            .header("Content-Type", "application/json")
  777    761   
            .body(::aws_smithy_http_server::body::Body::from(
  778         -
                ::bytes::Bytes::from_static("".as_bytes()),
         762  +
                ::bytes::Bytes::from_static("{\"data\": 25\n}".as_bytes()),
  779    763   
            ))
  780    764   
            .unwrap();
  781         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=Infinity&Double=Infinity"
  782         -
            .parse()
  783         -
            .unwrap();
  784    765   
        #[allow(unused_mut)]
  785    766   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  786    767   
        let config = crate::service::RestJsonConfig::builder().build();
  787    768   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
  788         -
                        .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         769  +
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
  789    770   
                let sender = sender.clone();
  790    771   
                async move {
  791         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
  792         -
        let expected =
  793         -
            crate::input::AllQueryStringTypesInput {
  794         -
                query_float:
  795         -
                    ::std::option::Option::Some(
  796         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
  797         -
                    )
  798         -
                ,
  799         -
                query_double:
  800         -
                    ::std::option::Option::Some(
  801         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
  802         -
                    )
  803         -
                ,
  804         -
                query_params_map_of_string_list:
  805         -
                    ::std::option::Option::Some(
  806         -
                         {
  807         -
                            let mut ret = ::std::collections::HashMap::new();
  808         -
                            ret.insert(
  809         -
                                "Float".to_owned()
  810         -
                                ,
  811         -
                                vec![
  812         -
                                    "Infinity".to_owned()
  813         -
                                    ,
  814         -
                                ]
  815         -
                            );
  816         -
                            ret.insert(
  817         -
                                "Double".to_owned()
  818         -
                                ,
  819         -
                                vec![
  820         -
                                    "Infinity".to_owned()
  821         -
                                    ,
  822         -
                                ]
  823         -
                            );
  824         -
                            ret
  825         -
                        }
  826         -
                    )
  827         -
                ,
  828         -
                query_string:
  829         -
                    ::std::option::Option::None
  830         -
                ,
  831         -
                query_string_list:
  832         -
                    ::std::option::Option::None
  833         -
                ,
  834         -
                query_string_set:
  835         -
                    ::std::option::Option::None
  836         -
                ,
  837         -
                query_byte:
  838         -
                    ::std::option::Option::None
  839         -
                ,
  840         -
                query_short:
  841         -
                    ::std::option::Option::None
  842         -
                ,
  843         -
                query_integer:
  844         -
                    ::std::option::Option::None
  845         -
                ,
  846         -
                query_integer_list:
  847         -
                    ::std::option::Option::None
  848         -
                ,
  849         -
                query_integer_set:
  850         -
                    ::std::option::Option::None
  851         -
                ,
  852         -
                query_long:
  853         -
                    ::std::option::Option::None
  854         -
                ,
  855         -
                query_double_list:
  856         -
                    ::std::option::Option::None
  857         -
                ,
  858         -
                query_boolean:
  859         -
                    ::std::option::Option::None
  860         -
                ,
  861         -
                query_boolean_list:
  862         -
                    ::std::option::Option::None
  863         -
                ,
  864         -
                query_timestamp:
  865         -
                    ::std::option::Option::None
  866         -
                ,
  867         -
                query_timestamp_list:
  868         -
                    ::std::option::Option::None
  869         -
                ,
  870         -
                query_enum:
  871         -
                    ::std::option::Option::None
  872         -
                ,
  873         -
                query_enum_list:
  874         -
                    ::std::option::Option::None
  875         -
                ,
  876         -
                query_integer_enum:
  877         -
                    ::std::option::Option::None
  878         -
                ,
  879         -
                query_integer_enum_list:
  880         -
                    ::std::option::Option::None
  881         -
                ,
  882         -
            }
  883         -
        ;
  884         -
        ::pretty_assertions::assert_eq!(input.query_string, expected.query_string, "Unexpected value for `query_string`");
  885         -
        ::pretty_assertions::assert_eq!(input.query_string_list, expected.query_string_list, "Unexpected value for `query_string_list`");
  886         -
        ::pretty_assertions::assert_eq!(input.query_string_set, expected.query_string_set, "Unexpected value for `query_string_set`");
  887         -
        ::pretty_assertions::assert_eq!(input.query_byte, expected.query_byte, "Unexpected value for `query_byte`");
  888         -
        ::pretty_assertions::assert_eq!(input.query_short, expected.query_short, "Unexpected value for `query_short`");
  889         -
        ::pretty_assertions::assert_eq!(input.query_integer, expected.query_integer, "Unexpected value for `query_integer`");
  890         -
        ::pretty_assertions::assert_eq!(input.query_integer_list, expected.query_integer_list, "Unexpected value for `query_integer_list`");
  891         -
        ::pretty_assertions::assert_eq!(input.query_integer_set, expected.query_integer_set, "Unexpected value for `query_integer_set`");
  892         -
        ::pretty_assertions::assert_eq!(input.query_long, expected.query_long, "Unexpected value for `query_long`");
  893         -
        assert!(input.query_float.float_equals(&expected.query_float),
  894         -
                                            "Unexpected value for `query_float` {:?} vs. {:?}", expected.query_float, input.query_float);
  895         -
        assert!(input.query_double.float_equals(&expected.query_double),
  896         -
                                            "Unexpected value for `query_double` {:?} vs. {:?}", expected.query_double, input.query_double);
  897         -
        ::pretty_assertions::assert_eq!(input.query_double_list, expected.query_double_list, "Unexpected value for `query_double_list`");
  898         -
        ::pretty_assertions::assert_eq!(input.query_boolean, expected.query_boolean, "Unexpected value for `query_boolean`");
  899         -
        ::pretty_assertions::assert_eq!(input.query_boolean_list, expected.query_boolean_list, "Unexpected value for `query_boolean_list`");
  900         -
        ::pretty_assertions::assert_eq!(input.query_timestamp, expected.query_timestamp, "Unexpected value for `query_timestamp`");
  901         -
        ::pretty_assertions::assert_eq!(input.query_timestamp_list, expected.query_timestamp_list, "Unexpected value for `query_timestamp_list`");
  902         -
        ::pretty_assertions::assert_eq!(input.query_enum, expected.query_enum, "Unexpected value for `query_enum`");
  903         -
        ::pretty_assertions::assert_eq!(input.query_enum_list, expected.query_enum_list, "Unexpected value for `query_enum_list`");
  904         -
        ::pretty_assertions::assert_eq!(input.query_integer_enum, expected.query_integer_enum, "Unexpected value for `query_integer_enum`");
  905         -
        ::pretty_assertions::assert_eq!(input.query_integer_enum_list, expected.query_integer_enum_list, "Unexpected value for `query_integer_enum_list`");
  906         -
        ::pretty_assertions::assert_eq!(input.query_params_map_of_string_list, expected.query_params_map_of_string_list, "Unexpected value for `query_params_map_of_string_list`");
  907         -
        let response =
  908         -
            crate::output::AllQueryStringTypesOutput {
  909         -
            }
  910         -
        ;
  911         -
        Ok(response) };
         772  +
                    let result = {
         773  +
                        let expected = crate::input::TestPayloadStructureInput {
         774  +
                            payload_config: ::std::option::Option::Some(
         775  +
                                crate::model::PayloadConfig {
         776  +
                                    data: ::std::option::Option::Some(25),
         777  +
                                },
         778  +
                            ),
         779  +
                            test_id: ::std::option::Option::None,
         780  +
                        };
         781  +
                        ::pretty_assertions::assert_eq!(input, expected);
         782  +
                        let response = crate::output::TestPayloadStructureOutput {
         783  +
                            payload_config: ::std::option::Option::Some(
         784  +
                                crate::model::PayloadConfig {
         785  +
                                    data: ::std::option::Option::None,
         786  +
                                },
         787  +
                            ),
         788  +
                            test_id: ::std::option::Option::None,
         789  +
                        };
         790  +
                        response
         791  +
                    };
  912    792   
                    sender.send(()).await.expect("receiver dropped early");
  913    793   
                    result
  914    794   
                }
  915    795   
            })
  916    796   
            .build_unchecked();
  917    797   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  918    798   
            .await
  919    799   
            .expect("unable to make an HTTP request");
  920         -
        assert!(receiver.recv().await.is_some());
         800  +
        assert!(
         801  +
            receiver.recv().await.is_some(),
         802  +
            "we expected operation handler to be invoked but it was not entered"
         803  +
        );
  921    804   
    }
  922         -
    /// Supports handling -Infinity float query values.
  923         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatQueryValues
         805  +
    /// Serializes an request with header members but no payload
         806  +
    /// Test ID: RestJsonHttpWithHeadersButNoPayload
  924    807   
    #[::tokio::test]
  925         -
    async fn rest_json_supports_negative_infinity_float_query_values_request() {
         808  +
    #[::tracing_test::traced_test]
         809  +
    async fn rest_json_http_with_headers_but_no_payload_request() {
  926    810   
        #[allow(unused_mut)]
  927    811   
        let mut http_request = http::Request::builder()
  928         -
            .uri("/AllQueryStringTypesInput")
  929         -
            .method("GET")
         812  +
            .uri("/payload")
         813  +
            .method("POST")
         814  +
            .header("Content-Type", "application/json")
         815  +
            .header("X-Amz-Test-Id", "t-12345")
  930    816   
            .body(::aws_smithy_http_server::body::Body::from(
  931         -
                ::bytes::Bytes::from_static("".as_bytes()),
         817  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
  932    818   
            ))
  933    819   
            .unwrap();
  934         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=-Infinity&Double=-Infinity"
  935         -
            .parse()
  936         -
            .unwrap();
  937    820   
        #[allow(unused_mut)]
  938    821   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  939    822   
        let config = crate::service::RestJsonConfig::builder().build();
  940    823   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
  941         -
                        .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         824  +
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
  942    825   
                let sender = sender.clone();
  943    826   
                async move {
  944         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
  945         -
        let expected =
  946         -
            crate::input::AllQueryStringTypesInput {
  947         -
                query_float:
  948         -
                    ::std::option::Option::Some(
  949         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
  950         -
                    )
  951         -
                ,
  952         -
                query_double:
  953         -
                    ::std::option::Option::Some(
  954         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
  955         -
                    )
  956         -
                ,
  957         -
                query_params_map_of_string_list:
  958         -
                    ::std::option::Option::Some(
  959         -
                         {
  960         -
                            let mut ret = ::std::collections::HashMap::new();
  961         -
                            ret.insert(
  962         -
                                "Float".to_owned()
  963         -
                                ,
  964         -
                                vec![
  965         -
                                    "-Infinity".to_owned()
  966         -
                                    ,
  967         -
                                ]
  968         -
                            );
  969         -
                            ret.insert(
  970         -
                                "Double".to_owned()
  971         -
                                ,
  972         -
                                vec![
  973         -
                                    "-Infinity".to_owned()
  974         -
                                    ,
  975         -
                                ]
  976         -
                            );
  977         -
                            ret
  978         -
                        }
  979         -
                    )
  980         -
                ,
  981         -
                query_string:
  982         -
                    ::std::option::Option::None
  983         -
                ,
  984         -
                query_string_list:
  985         -
                    ::std::option::Option::None
  986         -
                ,
  987         -
                query_string_set:
  988         -
                    ::std::option::Option::None
  989         -
                ,
  990         -
                query_byte:
  991         -
                    ::std::option::Option::None
  992         -
                ,
  993         -
                query_short:
  994         -
                    ::std::option::Option::None
  995         -
                ,
  996         -
                query_integer:
  997         -
                    ::std::option::Option::None
  998         -
                ,
  999         -
                query_integer_list:
 1000         -
                    ::std::option::Option::None
 1001         -
                ,
 1002         -
                query_integer_set:
 1003         -
                    ::std::option::Option::None
 1004         -
                ,
 1005         -
                query_long:
 1006         -
                    ::std::option::Option::None
 1007         -
                ,
 1008         -
                query_double_list:
 1009         -
                    ::std::option::Option::None
 1010         -
                ,
 1011         -
                query_boolean:
 1012         -
                    ::std::option::Option::None
 1013         -
                ,
 1014         -
                query_boolean_list:
 1015         -
                    ::std::option::Option::None
 1016         -
                ,
 1017         -
                query_timestamp:
 1018         -
                    ::std::option::Option::None
 1019         -
                ,
 1020         -
                query_timestamp_list:
 1021         -
                    ::std::option::Option::None
 1022         -
                ,
 1023         -
                query_enum:
 1024         -
                    ::std::option::Option::None
 1025         -
                ,
 1026         -
                query_enum_list:
 1027         -
                    ::std::option::Option::None
 1028         -
                ,
 1029         -
                query_integer_enum:
 1030         -
                    ::std::option::Option::None
 1031         -
                ,
 1032         -
                query_integer_enum_list:
 1033         -
                    ::std::option::Option::None
 1034         -
                ,
 1035         -
            }
 1036         -
        ;
 1037         -
        ::pretty_assertions::assert_eq!(input.query_string, expected.query_string, "Unexpected value for `query_string`");
 1038         -
        ::pretty_assertions::assert_eq!(input.query_string_list, expected.query_string_list, "Unexpected value for `query_string_list`");
 1039         -
        ::pretty_assertions::assert_eq!(input.query_string_set, expected.query_string_set, "Unexpected value for `query_string_set`");
 1040         -
        ::pretty_assertions::assert_eq!(input.query_byte, expected.query_byte, "Unexpected value for `query_byte`");
 1041         -
        ::pretty_assertions::assert_eq!(input.query_short, expected.query_short, "Unexpected value for `query_short`");
 1042         -
        ::pretty_assertions::assert_eq!(input.query_integer, expected.query_integer, "Unexpected value for `query_integer`");
 1043         -
        ::pretty_assertions::assert_eq!(input.query_integer_list, expected.query_integer_list, "Unexpected value for `query_integer_list`");
 1044         -
        ::pretty_assertions::assert_eq!(input.query_integer_set, expected.query_integer_set, "Unexpected value for `query_integer_set`");
 1045         -
        ::pretty_assertions::assert_eq!(input.query_long, expected.query_long, "Unexpected value for `query_long`");
 1046         -
        assert!(input.query_float.float_equals(&expected.query_float),
 1047         -
                                            "Unexpected value for `query_float` {:?} vs. {:?}", expected.query_float, input.query_float);
 1048         -
        assert!(input.query_double.float_equals(&expected.query_double),
 1049         -
                                            "Unexpected value for `query_double` {:?} vs. {:?}", expected.query_double, input.query_double);
 1050         -
        ::pretty_assertions::assert_eq!(input.query_double_list, expected.query_double_list, "Unexpected value for `query_double_list`");
 1051         -
        ::pretty_assertions::assert_eq!(input.query_boolean, expected.query_boolean, "Unexpected value for `query_boolean`");
 1052         -
        ::pretty_assertions::assert_eq!(input.query_boolean_list, expected.query_boolean_list, "Unexpected value for `query_boolean_list`");
 1053         -
        ::pretty_assertions::assert_eq!(input.query_timestamp, expected.query_timestamp, "Unexpected value for `query_timestamp`");
 1054         -
        ::pretty_assertions::assert_eq!(input.query_timestamp_list, expected.query_timestamp_list, "Unexpected value for `query_timestamp_list`");
 1055         -
        ::pretty_assertions::assert_eq!(input.query_enum, expected.query_enum, "Unexpected value for `query_enum`");
 1056         -
        ::pretty_assertions::assert_eq!(input.query_enum_list, expected.query_enum_list, "Unexpected value for `query_enum_list`");
 1057         -
        ::pretty_assertions::assert_eq!(input.query_integer_enum, expected.query_integer_enum, "Unexpected value for `query_integer_enum`");
 1058         -
        ::pretty_assertions::assert_eq!(input.query_integer_enum_list, expected.query_integer_enum_list, "Unexpected value for `query_integer_enum_list`");
 1059         -
        ::pretty_assertions::assert_eq!(input.query_params_map_of_string_list, expected.query_params_map_of_string_list, "Unexpected value for `query_params_map_of_string_list`");
 1060         -
        let response =
 1061         -
            crate::output::AllQueryStringTypesOutput {
 1062         -
            }
 1063         -
        ;
 1064         -
        Ok(response) };
 1065         -
                                sender.send(()).await.expect("receiver dropped early");
 1066         -
                                result
         827  +
                    let result = {
         828  +
                        let expected = crate::input::TestPayloadStructureInput {
         829  +
                            test_id: ::std::option::Option::Some("t-12345".to_owned()),
         830  +
                            payload_config: ::std::option::Option::Some(
         831  +
                                crate::model::PayloadConfig {
         832  +
                                    data: ::std::option::Option::None,
         833  +
                                },
         834  +
                            ),
         835  +
                        };
         836  +
                        ::pretty_assertions::assert_eq!(input, expected);
         837  +
                        let response = crate::output::TestPayloadStructureOutput {
         838  +
                            payload_config: ::std::option::Option::Some(
         839  +
                                crate::model::PayloadConfig {
         840  +
                                    data: ::std::option::Option::None,
         841  +
                                },
         842  +
                            ),
         843  +
                            test_id: ::std::option::Option::None,
         844  +
                        };
         845  +
                        response
         846  +
                    };
         847  +
                    sender.send(()).await.expect("receiver dropped early");
         848  +
                    result
 1067    849   
                }
 1068    850   
            })
 1069    851   
            .build_unchecked();
 1070    852   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1071    853   
            .await
 1072    854   
            .expect("unable to make an HTTP request");
 1073         -
        assert!(receiver.recv().await.is_some());
         855  +
        assert!(
         856  +
            receiver.recv().await.is_some(),
         857  +
            "we expected operation handler to be invoked but it was not entered"
         858  +
        );
 1074    859   
    }
 1075         -
    /// Query values of 0 and false are serialized
 1076         -
    /// Test ID: RestJsonZeroAndFalseQueryValues
         860  +
}
         861  +
         862  +
const CONTENT_TYPE_TESTBODYSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
         863  +
::pin_project_lite::pin_project! {
         864  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
         865  +
    /// [`TestBodyStructureInput`](crate::input::TestBodyStructureInput) using modelled bindings.
         866  +
    pub struct TestBodyStructureInputFuture {
         867  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestBodyStructureInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
         868  +
    }
         869  +
}
         870  +
         871  +
impl std::future::Future for TestBodyStructureInputFuture {
         872  +
    type Output = Result<
         873  +
        crate::input::TestBodyStructureInput,
         874  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
         875  +
    >;
         876  +
         877  +
    fn poll(
         878  +
        self: std::pin::Pin<&mut Self>,
         879  +
        cx: &mut std::task::Context<'_>,
         880  +
    ) -> std::task::Poll<Self::Output> {
         881  +
        let this = self.project();
         882  +
        this.inner.as_mut().poll(cx)
         883  +
    }
         884  +
}
         885  +
         886  +
impl<B>
         887  +
    ::aws_smithy_http_server::request::FromRequest<
         888  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         889  +
        B,
         890  +
    > for crate::input::TestBodyStructureInput
         891  +
where
         892  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
         893  +
    B: 'static,
         894  +
         895  +
    B::Data: Send,
         896  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
         897  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
         898  +
{
         899  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
         900  +
    type Future = TestBodyStructureInputFuture;
         901  +
         902  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
         903  +
        let fut = async move {
         904  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
         905  +
                request.headers(),
         906  +
                &CONTENT_TYPE_TESTBODYSTRUCTURE,
         907  +
            ) {
         908  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
         909  +
            }
         910  +
            crate::protocol_serde::shape_test_body_structure::de_test_body_structure_http_request(
         911  +
                request,
         912  +
            )
         913  +
            .await
         914  +
            .map_err(Into::into)
         915  +
        };
         916  +
        use ::futures_util::future::TryFutureExt;
         917  +
        let fut = fut.map_err(
         918  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
         919  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
         920  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
         921  +
                    e,
         922  +
                )
         923  +
            },
         924  +
        );
         925  +
        TestBodyStructureInputFuture {
         926  +
            inner: Box::pin(fut),
         927  +
        }
         928  +
    }
         929  +
}
         930  +
impl
         931  +
    ::aws_smithy_http_server::response::IntoResponse<
         932  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
         933  +
    > for crate::output::TestBodyStructureOutput
         934  +
{
         935  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
         936  +
        match crate::protocol_serde::shape_test_body_structure::ser_test_body_structure_http_response(self) {
         937  +
                        Ok(response) => response,
         938  +
                        Err(e) => {
         939  +
                            ::tracing::error!(error = %e, "failed to serialize response");
         940  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
         941  +
                        }
         942  +
                    }
         943  +
    }
         944  +
}
         945  +
         946  +
#[allow(unreachable_code, unused_variables)]
         947  +
#[cfg(test)]
         948  +
mod test_body_structure_test {
         949  +
         950  +
    /// Serializes a structure
         951  +
    /// Test ID: RestJsonTestBodyStructure
 1077    952   
    #[::tokio::test]
 1078         -
    async fn rest_json_zero_and_false_query_values_request() {
         953  +
    #[::tracing_test::traced_test]
         954  +
    async fn rest_json_test_body_structure_request() {
 1079    955   
        #[allow(unused_mut)]
 1080    956   
        let mut http_request = http::Request::builder()
 1081         -
            .uri("/AllQueryStringTypesInput")
 1082         -
            .method("GET")
         957  +
            .uri("/body")
         958  +
            .method("POST")
         959  +
            .header("Content-Type", "application/json")
 1083    960   
            .body(::aws_smithy_http_server::body::Body::from(
 1084         -
                ::bytes::Bytes::from_static("".as_bytes()),
         961  +
                ::bytes::Bytes::from_static(
         962  +
                    "{\"testConfig\":\n    {\"timeout\": 10}\n}".as_bytes(),
         963  +
                ),
 1085    964   
            ))
 1086    965   
            .unwrap();
 1087         -
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Integer=0&Boolean=false"
 1088         -
            .parse()
 1089         -
            .unwrap();
 1090    966   
        #[allow(unused_mut)]
 1091    967   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1092    968   
        let config = crate::service::RestJsonConfig::builder().build();
 1093    969   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1094         -
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
         970  +
            .test_body_structure(move |input: crate::input::TestBodyStructureInput| {
 1095    971   
                let sender = sender.clone();
 1096    972   
                async move {
 1097    973   
                    let result = {
 1098         -
                        use ::aws_smithy_protocol_test::FloatEquals;
 1099         -
                        let expected = crate::input::AllQueryStringTypesInput {
 1100         -
                            query_integer: ::std::option::Option::Some(0),
 1101         -
                            query_boolean: ::std::option::Option::Some(false),
 1102         -
                            query_params_map_of_string_list: ::std::option::Option::Some({
 1103         -
                                let mut ret = ::std::collections::HashMap::new();
 1104         -
                                ret.insert("Integer".to_owned(), vec!["0".to_owned()]);
 1105         -
                                ret.insert("Boolean".to_owned(), vec!["false".to_owned()]);
 1106         -
                                ret
         974  +
                        let expected = crate::input::TestBodyStructureInput {
         975  +
                            test_config: ::std::option::Option::Some(crate::model::TestConfig {
         976  +
                                timeout: ::std::option::Option::Some(10),
 1107    977   
                            }),
 1108         -
                            query_string: ::std::option::Option::None,
 1109         -
                            query_string_list: ::std::option::Option::None,
 1110         -
                            query_string_set: ::std::option::Option::None,
 1111         -
                            query_byte: ::std::option::Option::None,
 1112         -
                            query_short: ::std::option::Option::None,
 1113         -
                            query_integer_list: ::std::option::Option::None,
 1114         -
                            query_integer_set: ::std::option::Option::None,
 1115         -
                            query_long: ::std::option::Option::None,
 1116         -
                            query_float: ::std::option::Option::None,
 1117         -
                            query_double: ::std::option::Option::None,
 1118         -
                            query_double_list: ::std::option::Option::None,
 1119         -
                            query_boolean_list: ::std::option::Option::None,
 1120         -
                            query_timestamp: ::std::option::Option::None,
 1121         -
                            query_timestamp_list: ::std::option::Option::None,
 1122         -
                            query_enum: ::std::option::Option::None,
 1123         -
                            query_enum_list: ::std::option::Option::None,
 1124         -
                            query_integer_enum: ::std::option::Option::None,
 1125         -
                            query_integer_enum_list: ::std::option::Option::None,
         978  +
                            test_id: ::std::option::Option::None,
 1126    979   
                        };
 1127         -
                        ::pretty_assertions::assert_eq!(
 1128         -
                            input.query_string,
 1129         -
                            expected.query_string,
 1130         -
                            "Unexpected value for `query_string`"
 1131         -
                        );
 1132         -
                        ::pretty_assertions::assert_eq!(
 1133         -
                            input.query_string_list,
 1134         -
                            expected.query_string_list,
 1135         -
                            "Unexpected value for `query_string_list`"
 1136         -
                        );
 1137         -
                        ::pretty_assertions::assert_eq!(
 1138         -
                            input.query_string_set,
 1139         -
                            expected.query_string_set,
 1140         -
                            "Unexpected value for `query_string_set`"
 1141         -
                        );
 1142         -
                        ::pretty_assertions::assert_eq!(
 1143         -
                            input.query_byte,
 1144         -
                            expected.query_byte,
 1145         -
                            "Unexpected value for `query_byte`"
 1146         -
                        );
 1147         -
                        ::pretty_assertions::assert_eq!(
 1148         -
                            input.query_short,
 1149         -
                            expected.query_short,
 1150         -
                            "Unexpected value for `query_short`"
 1151         -
                        );
 1152         -
                        ::pretty_assertions::assert_eq!(
 1153         -
                            input.query_integer,
 1154         -
                            expected.query_integer,
 1155         -
                            "Unexpected value for `query_integer`"
 1156         -
                        );
 1157         -
                        ::pretty_assertions::assert_eq!(
 1158         -
                            input.query_integer_list,
 1159         -
                            expected.query_integer_list,
 1160         -
                            "Unexpected value for `query_integer_list`"
 1161         -
                        );
 1162         -
                        ::pretty_assertions::assert_eq!(
 1163         -
                            input.query_integer_set,
 1164         -
                            expected.query_integer_set,
 1165         -
                            "Unexpected value for `query_integer_set`"
 1166         -
                        );
 1167         -
                        ::pretty_assertions::assert_eq!(
 1168         -
                            input.query_long,
 1169         -
                            expected.query_long,
 1170         -
                            "Unexpected value for `query_long`"
 1171         -
                        );
 1172         -
                        assert!(
 1173         -
                            input.query_float.float_equals(&expected.query_float),
 1174         -
                            "Unexpected value for `query_float` {:?} vs. {:?}",
 1175         -
                            expected.query_float,
 1176         -
                            input.query_float
 1177         -
                        );
 1178         -
                        assert!(
 1179         -
                            input.query_double.float_equals(&expected.query_double),
 1180         -
                            "Unexpected value for `query_double` {:?} vs. {:?}",
 1181         -
                            expected.query_double,
 1182         -
                            input.query_double
 1183         -
                        );
 1184         -
                        ::pretty_assertions::assert_eq!(
 1185         -
                            input.query_double_list,
 1186         -
                            expected.query_double_list,
 1187         -
                            "Unexpected value for `query_double_list`"
 1188         -
                        );
 1189         -
                        ::pretty_assertions::assert_eq!(
 1190         -
                            input.query_boolean,
 1191         -
                            expected.query_boolean,
 1192         -
                            "Unexpected value for `query_boolean`"
 1193         -
                        );
 1194         -
                        ::pretty_assertions::assert_eq!(
 1195         -
                            input.query_boolean_list,
 1196         -
                            expected.query_boolean_list,
 1197         -
                            "Unexpected value for `query_boolean_list`"
 1198         -
                        );
 1199         -
                        ::pretty_assertions::assert_eq!(
 1200         -
                            input.query_timestamp,
 1201         -
                            expected.query_timestamp,
 1202         -
                            "Unexpected value for `query_timestamp`"
 1203         -
                        );
 1204         -
                        ::pretty_assertions::assert_eq!(
 1205         -
                            input.query_timestamp_list,
 1206         -
                            expected.query_timestamp_list,
 1207         -
                            "Unexpected value for `query_timestamp_list`"
 1208         -
                        );
 1209         -
                        ::pretty_assertions::assert_eq!(
 1210         -
                            input.query_enum,
 1211         -
                            expected.query_enum,
 1212         -
                            "Unexpected value for `query_enum`"
 1213         -
                        );
 1214         -
                        ::pretty_assertions::assert_eq!(
 1215         -
                            input.query_enum_list,
 1216         -
                            expected.query_enum_list,
 1217         -
                            "Unexpected value for `query_enum_list`"
 1218         -
                        );
 1219         -
                        ::pretty_assertions::assert_eq!(
 1220         -
                            input.query_integer_enum,
 1221         -
                            expected.query_integer_enum,
 1222         -
                            "Unexpected value for `query_integer_enum`"
 1223         -
                        );
 1224         -
                        ::pretty_assertions::assert_eq!(
 1225         -
                            input.query_integer_enum_list,
 1226         -
                            expected.query_integer_enum_list,
 1227         -
                            "Unexpected value for `query_integer_enum_list`"
 1228         -
                        );
 1229         -
                        ::pretty_assertions::assert_eq!(
 1230         -
                            input.query_params_map_of_string_list,
 1231         -
                            expected.query_params_map_of_string_list,
 1232         -
                            "Unexpected value for `query_params_map_of_string_list`"
 1233         -
                        );
 1234         -
                        let response = crate::output::AllQueryStringTypesOutput {};
 1235         -
                        Ok(response)
         980  +
                        ::pretty_assertions::assert_eq!(input, expected);
         981  +
                        let response = crate::output::TestBodyStructureOutput {
         982  +
                            test_id: ::std::option::Option::None,
         983  +
                            test_config: ::std::option::Option::None,
         984  +
                        };
         985  +
                        response
 1236    986   
                    };
 1237    987   
                    sender.send(()).await.expect("receiver dropped early");
 1238    988   
                    result
 1239    989   
                }
 1240    990   
            })
 1241    991   
            .build_unchecked();
 1242    992   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1243    993   
            .await
 1244    994   
            .expect("unable to make an HTTP request");
 1245         -
        assert!(receiver.recv().await.is_some());
         995  +
        assert!(
         996  +
            receiver.recv().await.is_some(),
         997  +
            "we expected operation handler to be invoked but it was not entered"
         998  +
        );
 1246    999   
    }
 1247         -
}
 1248         -
#[cfg(test)]
 1249         -
#[allow(unreachable_code, unused_variables)]
 1250         -
mod server_constant_and_variable_query_string_test {
 1251         -
    /// Mixes constant and variable query string parameters
 1252         -
    /// Test ID: RestJsonConstantAndVariableQueryStringMissingOneValue
        1000  +
    /// Serializes an empty structure in the body
        1001  +
    /// Test ID: RestJsonHttpWithEmptyBody
 1253   1002   
    #[::tokio::test]
 1254         -
    async fn rest_json_constant_and_variable_query_string_missing_one_value_request() {
        1003  +
    #[::tracing_test::traced_test]
        1004  +
    async fn rest_json_http_with_empty_body_request() {
 1255   1005   
        #[allow(unused_mut)]
 1256   1006   
        let mut http_request = http::Request::builder()
 1257         -
            .uri("/ConstantAndVariableQueryString")
 1258         -
            .method("GET")
        1007  +
            .uri("/body")
        1008  +
            .method("POST")
        1009  +
            .header("Content-Type", "application/json")
 1259   1010   
            .body(::aws_smithy_http_server::body::Body::from(
 1260         -
                ::bytes::Bytes::from_static("".as_bytes()),
        1011  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
 1261   1012   
            ))
 1262   1013   
            .unwrap();
 1263         -
        *http_request.uri_mut() = "/ConstantAndVariableQueryString?foo=bar&baz=bam"
 1264         -
            .parse()
 1265         -
            .unwrap();
 1266   1014   
        #[allow(unused_mut)]
 1267   1015   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1268   1016   
        let config = crate::service::RestJsonConfig::builder().build();
 1269   1017   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1270         -
            .constant_and_variable_query_string(
 1271         -
                move |input: crate::input::ConstantAndVariableQueryStringInput| {
        1018  +
            .test_body_structure(move |input: crate::input::TestBodyStructureInput| {
 1272   1019   
                let sender = sender.clone();
 1273   1020   
                async move {
 1274   1021   
                    let result = {
 1275         -
                            let expected = crate::input::ConstantAndVariableQueryStringInput {
 1276         -
                                baz: ::std::option::Option::Some("bam".to_owned()),
 1277         -
                                maybe_set: ::std::option::Option::None,
        1022  +
                        let expected = crate::input::TestBodyStructureInput {
        1023  +
                            test_id: ::std::option::Option::None,
        1024  +
                            test_config: ::std::option::Option::None,
 1278   1025   
                        };
 1279   1026   
                        ::pretty_assertions::assert_eq!(input, expected);
 1280         -
                            let response = crate::output::ConstantAndVariableQueryStringOutput {};
        1027  +
                        let response = crate::output::TestBodyStructureOutput {
        1028  +
                            test_id: ::std::option::Option::None,
        1029  +
                            test_config: ::std::option::Option::None,
        1030  +
                        };
 1281   1031   
                        response
 1282   1032   
                    };
 1283   1033   
                    sender.send(()).await.expect("receiver dropped early");
 1284   1034   
                    result
 1285   1035   
                }
 1286         -
                },
 1287         -
            )
        1036  +
            })
 1288   1037   
            .build_unchecked();
 1289   1038   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1290   1039   
            .await
 1291   1040   
            .expect("unable to make an HTTP request");
 1292         -
        assert!(receiver.recv().await.is_some());
        1041  +
        assert!(
        1042  +
            receiver.recv().await.is_some(),
        1043  +
            "we expected operation handler to be invoked but it was not entered"
        1044  +
        );
 1293   1045   
    }
 1294         -
    /// Mixes constant and variable query string parameters
 1295         -
    /// Test ID: RestJsonConstantAndVariableQueryStringAllValues
        1046  +
}
        1047  +
        1048  +
static CONTENT_TYPE_MALFORMEDACCEPTWITHGENERICSTRING: ::once_cell::sync::Lazy<::mime::Mime> =
        1049  +
    ::once_cell::sync::Lazy::new(|| {
        1050  +
        "text/plain"
        1051  +
            .parse::<::mime::Mime>()
        1052  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
        1053  +
    });
        1054  +
::pin_project_lite::pin_project! {
        1055  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1056  +
    /// [`MalformedAcceptWithGenericStringInput`](crate::input::MalformedAcceptWithGenericStringInput) using modelled bindings.
        1057  +
    pub struct MalformedAcceptWithGenericStringInputFuture {
        1058  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedAcceptWithGenericStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1059  +
    }
        1060  +
}
        1061  +
        1062  +
impl std::future::Future for MalformedAcceptWithGenericStringInputFuture {
        1063  +
    type Output = Result<
        1064  +
        crate::input::MalformedAcceptWithGenericStringInput,
        1065  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1066  +
    >;
        1067  +
        1068  +
    fn poll(
        1069  +
        self: std::pin::Pin<&mut Self>,
        1070  +
        cx: &mut std::task::Context<'_>,
        1071  +
    ) -> std::task::Poll<Self::Output> {
        1072  +
        let this = self.project();
        1073  +
        this.inner.as_mut().poll(cx)
        1074  +
    }
        1075  +
}
        1076  +
        1077  +
impl<B>
        1078  +
    ::aws_smithy_http_server::request::FromRequest<
        1079  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1080  +
        B,
        1081  +
    > for crate::input::MalformedAcceptWithGenericStringInput
        1082  +
where
        1083  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1084  +
    B: 'static,
        1085  +
        1086  +
    B::Data: Send,
        1087  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1088  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1089  +
{
        1090  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1091  +
    type Future = MalformedAcceptWithGenericStringInputFuture;
        1092  +
        1093  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1094  +
        let fut = async move {
        1095  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1096  +
                request.headers(),
        1097  +
                &CONTENT_TYPE_MALFORMEDACCEPTWITHGENERICSTRING,
        1098  +
            ) {
        1099  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        1100  +
            }
        1101  +
            crate::protocol_serde::shape_malformed_accept_with_generic_string::de_malformed_accept_with_generic_string_http_request(request)
        1102  +
                            .await
        1103  +
                            .map_err(Into::into)
        1104  +
        };
        1105  +
        use ::futures_util::future::TryFutureExt;
        1106  +
        let fut = fut.map_err(
        1107  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        1108  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1109  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        1110  +
                    e,
        1111  +
                )
        1112  +
            },
        1113  +
        );
        1114  +
        MalformedAcceptWithGenericStringInputFuture {
        1115  +
            inner: Box::pin(fut),
        1116  +
        }
        1117  +
    }
        1118  +
}
        1119  +
impl
        1120  +
    ::aws_smithy_http_server::response::IntoResponse<
        1121  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1122  +
    > for crate::output::MalformedAcceptWithGenericStringOutput
        1123  +
{
        1124  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1125  +
        match crate::protocol_serde::shape_malformed_accept_with_generic_string::ser_malformed_accept_with_generic_string_http_response(self) {
        1126  +
                        Ok(response) => response,
        1127  +
                        Err(e) => {
        1128  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1129  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        1130  +
                        }
        1131  +
                    }
        1132  +
    }
        1133  +
}
        1134  +
        1135  +
#[allow(unreachable_code, unused_variables)]
        1136  +
#[cfg(test)]
        1137  +
mod malformed_accept_with_generic_string_test {
        1138  +
        1139  +
    /// When there is a payload without a mediaType trait, the accept must match the
        1140  +
    /// implied content type of the shape.
        1141  +
    /// Test ID: RestJsonWithPayloadExpectsImpliedAccept
 1296   1142   
    #[::tokio::test]
 1297         -
    async fn rest_json_constant_and_variable_query_string_all_values_request() {
        1143  +
    #[::tracing_test::traced_test]
        1144  +
    async fn rest_json_with_payload_expects_implied_accept_malformed_request() {
        1145  +
        {
 1298   1146   
            #[allow(unused_mut)]
 1299   1147   
            let mut http_request = http::Request::builder()
 1300         -
            .uri("/ConstantAndVariableQueryString")
 1301         -
            .method("GET")
 1302         -
            .body(::aws_smithy_http_server::body::Body::from(
 1303         -
                ::bytes::Bytes::from_static("".as_bytes()),
 1304         -
            ))
 1305         -
            .unwrap();
 1306         -
        *http_request.uri_mut() = "/ConstantAndVariableQueryString?foo=bar&baz=bam&maybeSet=yes"
 1307         -
            .parse()
        1148  +
                .uri("/MalformedAcceptWithGenericString")
        1149  +
                .method("POST")
        1150  +
                .header("accept", "application/json")
        1151  +
                .body(::aws_smithy_http_server::body::Body::empty())
 1308   1152   
                .unwrap();
 1309   1153   
            #[allow(unused_mut)]
 1310   1154   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1311   1155   
            let config = crate::service::RestJsonConfig::builder().build();
 1312   1156   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1313         -
            .constant_and_variable_query_string(
 1314         -
                move |input: crate::input::ConstantAndVariableQueryStringInput| {
        1157  +
                            .malformed_accept_with_generic_string(move |input: crate::input::MalformedAcceptWithGenericStringInput| {
 1315   1158   
                                let sender = sender.clone();
 1316   1159   
                                async move {
 1317         -
                        let result = {
 1318         -
                            let expected = crate::input::ConstantAndVariableQueryStringInput {
 1319         -
                                baz: ::std::option::Option::Some("bam".to_owned()),
 1320         -
                                maybe_set: ::std::option::Option::Some("yes".to_owned()),
 1321         -
                            };
 1322         -
                            ::pretty_assertions::assert_eq!(input, expected);
 1323         -
                            let response = crate::output::ConstantAndVariableQueryStringOutput {};
 1324         -
                            response
 1325         -
                        };
        1160  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithGenericStringOutput };
 1326   1161   
                                    sender.send(()).await.expect("receiver dropped early");
 1327   1162   
                                    result
 1328   1163   
                                }
 1329         -
                },
 1330         -
            )
        1164  +
                            })
 1331   1165   
                            .build_unchecked();
 1332   1166   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1333   1167   
                .await
 1334   1168   
                .expect("unable to make an HTTP request");
 1335         -
        assert!(receiver.recv().await.is_some());
        1169  +
            ::pretty_assertions::assert_eq!(
        1170  +
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
        1171  +
                http_response.status()
        1172  +
            );
        1173  +
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
        1174  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1175  +
                http_response.headers(),
        1176  +
                expected_headers,
        1177  +
            ));
        1178  +
        }
 1336   1179   
    }
 1337   1180   
}
 1338         -
#[cfg(test)]
        1181  +
        1182  +
static CONTENT_TYPE_MALFORMEDACCEPTWITHPAYLOAD: ::once_cell::sync::Lazy<::mime::Mime> =
        1183  +
    ::once_cell::sync::Lazy::new(|| {
        1184  +
        "image/jpeg"
        1185  +
            .parse::<::mime::Mime>()
        1186  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
        1187  +
    });
        1188  +
::pin_project_lite::pin_project! {
        1189  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1190  +
    /// [`MalformedAcceptWithPayloadInput`](crate::input::MalformedAcceptWithPayloadInput) using modelled bindings.
        1191  +
    pub struct MalformedAcceptWithPayloadInputFuture {
        1192  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedAcceptWithPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1193  +
    }
        1194  +
}
        1195  +
        1196  +
impl std::future::Future for MalformedAcceptWithPayloadInputFuture {
        1197  +
    type Output = Result<
        1198  +
        crate::input::MalformedAcceptWithPayloadInput,
        1199  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1200  +
    >;
        1201  +
        1202  +
    fn poll(
        1203  +
        self: std::pin::Pin<&mut Self>,
        1204  +
        cx: &mut std::task::Context<'_>,
        1205  +
    ) -> std::task::Poll<Self::Output> {
        1206  +
        let this = self.project();
        1207  +
        this.inner.as_mut().poll(cx)
        1208  +
    }
        1209  +
}
        1210  +
        1211  +
impl<B>
        1212  +
    ::aws_smithy_http_server::request::FromRequest<
        1213  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1214  +
        B,
        1215  +
    > for crate::input::MalformedAcceptWithPayloadInput
        1216  +
where
        1217  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1218  +
    B: 'static,
        1219  +
        1220  +
    B::Data: Send,
        1221  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1222  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1223  +
{
        1224  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1225  +
    type Future = MalformedAcceptWithPayloadInputFuture;
        1226  +
        1227  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1228  +
        let fut = async move {
        1229  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1230  +
                request.headers(),
        1231  +
                &CONTENT_TYPE_MALFORMEDACCEPTWITHPAYLOAD,
        1232  +
            ) {
        1233  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        1234  +
            }
        1235  +
            crate::protocol_serde::shape_malformed_accept_with_payload::de_malformed_accept_with_payload_http_request(request)
        1236  +
                            .await
        1237  +
                            .map_err(Into::into)
        1238  +
        };
        1239  +
        use ::futures_util::future::TryFutureExt;
        1240  +
        let fut = fut.map_err(
        1241  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        1242  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1243  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        1244  +
                    e,
        1245  +
                )
        1246  +
            },
        1247  +
        );
        1248  +
        MalformedAcceptWithPayloadInputFuture {
        1249  +
            inner: Box::pin(fut),
        1250  +
        }
        1251  +
    }
        1252  +
}
        1253  +
impl
        1254  +
    ::aws_smithy_http_server::response::IntoResponse<
        1255  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1256  +
    > for crate::output::MalformedAcceptWithPayloadOutput
        1257  +
{
        1258  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1259  +
        match crate::protocol_serde::shape_malformed_accept_with_payload::ser_malformed_accept_with_payload_http_response(self) {
        1260  +
                        Ok(response) => response,
        1261  +
                        Err(e) => {
        1262  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1263  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        1264  +
                        }
        1265  +
                    }
        1266  +
    }
        1267  +
}
        1268  +
 1339   1269   
#[allow(unreachable_code, unused_variables)]
 1340         -
mod server_constant_query_string_test {
 1341         -
    /// Includes constant query string parameters
 1342         -
    /// Test ID: RestJsonConstantQueryString
        1270  +
#[cfg(test)]
        1271  +
mod malformed_accept_with_payload_test {
        1272  +
        1273  +
    /// When there is a payload with a mediaType trait, the accept must match.
        1274  +
    /// Test ID: RestJsonWithPayloadExpectsModeledAccept
 1343   1275   
    #[::tokio::test]
 1344         -
    async fn rest_json_constant_query_string_request() {
        1276  +
    #[::tracing_test::traced_test]
        1277  +
    async fn rest_json_with_payload_expects_modeled_accept_malformed_request() {
        1278  +
        {
 1345   1279   
            #[allow(unused_mut)]
 1346   1280   
            let mut http_request = http::Request::builder()
 1347         -
            .uri("/ConstantQueryString/hi")
 1348         -
            .method("GET")
 1349         -
            .body(::aws_smithy_http_server::body::Body::from(
 1350         -
                ::bytes::Bytes::from_static("".as_bytes()),
 1351         -
            ))
        1281  +
                .uri("/MalformedAcceptWithPayload")
        1282  +
                .method("POST")
        1283  +
                .header("accept", "application/json")
        1284  +
                .body(::aws_smithy_http_server::body::Body::empty())
 1352   1285   
                .unwrap();
 1353         -
        *http_request.uri_mut() = "/ConstantQueryString/hi?foo=bar&hello".parse().unwrap();
 1354   1286   
            #[allow(unused_mut)]
 1355   1287   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1356   1288   
            let config = crate::service::RestJsonConfig::builder().build();
 1357   1289   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1358         -
            .constant_query_string(move |input: crate::input::ConstantQueryStringInput| {
        1290  +
                            .malformed_accept_with_payload(move |input: crate::input::MalformedAcceptWithPayloadInput| {
 1359   1291   
                                let sender = sender.clone();
 1360   1292   
                                async move {
 1361         -
                    let result = {
 1362         -
                        let expected = crate::input::ConstantQueryStringInput {
 1363         -
                            hello: "hi".to_owned(),
 1364         -
                        };
 1365         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1366         -
                        let response = crate::output::ConstantQueryStringOutput {};
 1367         -
                        Ok(response)
 1368         -
                    };
        1293  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithPayloadOutput };
 1369   1294   
                                    sender.send(()).await.expect("receiver dropped early");
 1370   1295   
                                    result
 1371   1296   
                                }
 1372   1297   
                            })
 1373   1298   
                            .build_unchecked();
 1374   1299   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1375   1300   
                .await
 1376   1301   
                .expect("unable to make an HTTP request");
 1377         -
        assert!(receiver.recv().await.is_some());
        1302  +
            ::pretty_assertions::assert_eq!(
        1303  +
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
        1304  +
                http_response.status()
        1305  +
            );
        1306  +
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
        1307  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1308  +
                http_response.headers(),
        1309  +
                expected_headers,
        1310  +
            ));
        1311  +
        }
 1378   1312   
    }
 1379   1313   
}
 1380         -
#[cfg(test)]
        1314  +
        1315  +
const CONTENT_TYPE_MALFORMEDACCEPTWITHBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
        1316  +
::pin_project_lite::pin_project! {
        1317  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1318  +
    /// [`MalformedAcceptWithBodyInput`](crate::input::MalformedAcceptWithBodyInput) using modelled bindings.
        1319  +
    pub struct MalformedAcceptWithBodyInputFuture {
        1320  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedAcceptWithBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1321  +
    }
        1322  +
}
        1323  +
        1324  +
impl std::future::Future for MalformedAcceptWithBodyInputFuture {
        1325  +
    type Output = Result<
        1326  +
        crate::input::MalformedAcceptWithBodyInput,
        1327  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1328  +
    >;
        1329  +
        1330  +
    fn poll(
        1331  +
        self: std::pin::Pin<&mut Self>,
        1332  +
        cx: &mut std::task::Context<'_>,
        1333  +
    ) -> std::task::Poll<Self::Output> {
        1334  +
        let this = self.project();
        1335  +
        this.inner.as_mut().poll(cx)
        1336  +
    }
        1337  +
}
        1338  +
        1339  +
impl<B>
        1340  +
    ::aws_smithy_http_server::request::FromRequest<
        1341  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1342  +
        B,
        1343  +
    > for crate::input::MalformedAcceptWithBodyInput
        1344  +
where
        1345  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1346  +
    B: 'static,
        1347  +
        1348  +
    B::Data: Send,
        1349  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1350  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1351  +
{
        1352  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1353  +
    type Future = MalformedAcceptWithBodyInputFuture;
        1354  +
        1355  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1356  +
        let fut = async move {
        1357  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1358  +
                request.headers(),
        1359  +
                &CONTENT_TYPE_MALFORMEDACCEPTWITHBODY,
        1360  +
            ) {
        1361  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        1362  +
            }
        1363  +
            crate::protocol_serde::shape_malformed_accept_with_body::de_malformed_accept_with_body_http_request(request)
        1364  +
                            .await
        1365  +
                            .map_err(Into::into)
        1366  +
        };
        1367  +
        use ::futures_util::future::TryFutureExt;
        1368  +
        let fut = fut.map_err(
        1369  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        1370  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1371  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        1372  +
                    e,
        1373  +
                )
        1374  +
            },
        1375  +
        );
        1376  +
        MalformedAcceptWithBodyInputFuture {
        1377  +
            inner: Box::pin(fut),
        1378  +
        }
        1379  +
    }
        1380  +
}
        1381  +
impl
        1382  +
    ::aws_smithy_http_server::response::IntoResponse<
        1383  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1384  +
    > for crate::output::MalformedAcceptWithBodyOutput
        1385  +
{
        1386  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1387  +
        match crate::protocol_serde::shape_malformed_accept_with_body::ser_malformed_accept_with_body_http_response(self) {
        1388  +
                        Ok(response) => response,
        1389  +
                        Err(e) => {
        1390  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1391  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        1392  +
                        }
        1393  +
                    }
        1394  +
    }
        1395  +
}
        1396  +
 1381   1397   
#[allow(unreachable_code, unused_variables)]
 1382         -
mod server_document_type_test {
 1383         -
    /// Serializes document types as part of the JSON request payload with no escaping.
 1384         -
    /// Test ID: DocumentTypeInputWithObject
        1398  +
#[cfg(test)]
        1399  +
mod malformed_accept_with_body_test {
        1400  +
        1401  +
    /// When there is modeled output, the accept must be application/json
        1402  +
    /// Test ID: RestJsonWithBodyExpectsApplicationJsonAccept
 1385   1403   
    #[::tokio::test]
 1386         -
    async fn document_type_input_with_object_request() {
        1404  +
    #[::tracing_test::traced_test]
        1405  +
    async fn rest_json_with_body_expects_application_json_accept_malformed_request() {
        1406  +
        {
 1387   1407   
            #[allow(unused_mut)]
 1388   1408   
            let mut http_request = http::Request::builder()
 1389         -
                        .uri("/DocumentType")
 1390         -
                        .method("PUT")
 1391         -
        .header("Content-Type", "application/json")
 1392         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"stringValue\": \"string\",\n    \"documentValue\": {\n        \"foo\": \"bar\"\n    }\n}".as_bytes()))).unwrap();
        1409  +
                .uri("/MalformedAcceptWithBody")
        1410  +
                .method("POST")
        1411  +
                .header("accept", "application/hal+json")
        1412  +
                .body(::aws_smithy_http_server::body::Body::empty())
        1413  +
                .unwrap();
 1393   1414   
            #[allow(unused_mut)]
 1394   1415   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1395   1416   
            let config = crate::service::RestJsonConfig::builder().build();
 1396   1417   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1397         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
        1418  +
                            .malformed_accept_with_body(move |input: crate::input::MalformedAcceptWithBodyInput| {
 1398   1419   
                                let sender = sender.clone();
 1399   1420   
                                async move {
 1400         -
                    let result = {
 1401         -
                        let expected = crate::input::DocumentTypeInput {
 1402         -
                            string_value: ::std::option::Option::Some("string".to_owned()),
 1403         -
                            document_value: ::std::option::Option::Some({
 1404         -
                                let json_bytes = br#"{
 1405         -
                                "foo": "bar"
 1406         -
                            }"#;
 1407         -
                                let mut tokens =
 1408         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1409         -
                                        .peekable();
 1410         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1411         -
                                    .expect("well formed json")
 1412         -
                            }),
 1413         -
                        };
 1414         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1415         -
                        let response = crate::output::DocumentTypeOutput {
 1416         -
                            string_value: ::std::option::Option::None,
 1417         -
                            document_value: ::std::option::Option::Some({
 1418         -
                                let json_bytes = br#"null"#;
 1419         -
                                let mut tokens =
 1420         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1421         -
                                        .peekable();
 1422         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1423         -
                                    .expect("well formed json")
 1424         -
                            }),
 1425         -
                        };
 1426         -
                        response
 1427         -
                    };
        1421  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithBodyOutput };
 1428   1422   
                                    sender.send(()).await.expect("receiver dropped early");
 1429   1423   
                                    result
 1430   1424   
                                }
 1431   1425   
                            })
 1432   1426   
                            .build_unchecked();
 1433   1427   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1434   1428   
                .await
 1435   1429   
                .expect("unable to make an HTTP request");
 1436         -
        assert!(receiver.recv().await.is_some());
        1430  +
            ::pretty_assertions::assert_eq!(
        1431  +
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
        1432  +
                http_response.status()
        1433  +
            );
        1434  +
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
        1435  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1436  +
                http_response.headers(),
        1437  +
                expected_headers,
        1438  +
            ));
 1437   1439   
        }
 1438         -
    /// Serializes document types using a string.
 1439         -
    /// Test ID: DocumentInputWithString
        1440  +
    }
        1441  +
}
        1442  +
        1443  +
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHGENERICSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
        1444  +
::pin_project_lite::pin_project! {
        1445  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1446  +
    /// [`MalformedContentTypeWithGenericStringInput`](crate::input::MalformedContentTypeWithGenericStringInput) using modelled bindings.
        1447  +
    pub struct MalformedContentTypeWithGenericStringInputFuture {
        1448  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithGenericStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1449  +
    }
        1450  +
}
        1451  +
        1452  +
impl std::future::Future for MalformedContentTypeWithGenericStringInputFuture {
        1453  +
    type Output = Result<
        1454  +
        crate::input::MalformedContentTypeWithGenericStringInput,
        1455  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1456  +
    >;
        1457  +
        1458  +
    fn poll(
        1459  +
        self: std::pin::Pin<&mut Self>,
        1460  +
        cx: &mut std::task::Context<'_>,
        1461  +
    ) -> std::task::Poll<Self::Output> {
        1462  +
        let this = self.project();
        1463  +
        this.inner.as_mut().poll(cx)
        1464  +
    }
        1465  +
}
        1466  +
        1467  +
impl<B>
        1468  +
    ::aws_smithy_http_server::request::FromRequest<
        1469  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1470  +
        B,
        1471  +
    > for crate::input::MalformedContentTypeWithGenericStringInput
        1472  +
where
        1473  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1474  +
    B: 'static,
        1475  +
        1476  +
    B::Data: Send,
        1477  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1478  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1479  +
{
        1480  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1481  +
    type Future = MalformedContentTypeWithGenericStringInputFuture;
        1482  +
        1483  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1484  +
        let fut = async move {
        1485  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1486  +
                request.headers(),
        1487  +
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHGENERICSTRING,
        1488  +
            ) {
        1489  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        1490  +
            }
        1491  +
            crate::protocol_serde::shape_malformed_content_type_with_generic_string::de_malformed_content_type_with_generic_string_http_request(request)
        1492  +
                            .await
        1493  +
                            .map_err(Into::into)
        1494  +
        };
        1495  +
        use ::futures_util::future::TryFutureExt;
        1496  +
        let fut = fut.map_err(
        1497  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        1498  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1499  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        1500  +
                    e,
        1501  +
                )
        1502  +
            },
        1503  +
        );
        1504  +
        MalformedContentTypeWithGenericStringInputFuture {
        1505  +
            inner: Box::pin(fut),
        1506  +
        }
        1507  +
    }
        1508  +
}
        1509  +
impl
        1510  +
    ::aws_smithy_http_server::response::IntoResponse<
        1511  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1512  +
    > for crate::output::MalformedContentTypeWithGenericStringOutput
        1513  +
{
        1514  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1515  +
        match crate::protocol_serde::shape_malformed_content_type_with_generic_string::ser_malformed_content_type_with_generic_string_http_response(self) {
        1516  +
                        Ok(response) => response,
        1517  +
                        Err(e) => {
        1518  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1519  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        1520  +
                        }
        1521  +
                    }
        1522  +
    }
        1523  +
}
        1524  +
        1525  +
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
        1526  +
::pin_project_lite::pin_project! {
        1527  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1528  +
    /// [`MalformedContentTypeWithPayloadInput`](crate::input::MalformedContentTypeWithPayloadInput) using modelled bindings.
        1529  +
    pub struct MalformedContentTypeWithPayloadInputFuture {
        1530  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1531  +
    }
        1532  +
}
        1533  +
        1534  +
impl std::future::Future for MalformedContentTypeWithPayloadInputFuture {
        1535  +
    type Output = Result<
        1536  +
        crate::input::MalformedContentTypeWithPayloadInput,
        1537  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1538  +
    >;
        1539  +
        1540  +
    fn poll(
        1541  +
        self: std::pin::Pin<&mut Self>,
        1542  +
        cx: &mut std::task::Context<'_>,
        1543  +
    ) -> std::task::Poll<Self::Output> {
        1544  +
        let this = self.project();
        1545  +
        this.inner.as_mut().poll(cx)
        1546  +
    }
        1547  +
}
        1548  +
        1549  +
impl<B>
        1550  +
    ::aws_smithy_http_server::request::FromRequest<
        1551  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1552  +
        B,
        1553  +
    > for crate::input::MalformedContentTypeWithPayloadInput
        1554  +
where
        1555  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1556  +
    B: 'static,
        1557  +
        1558  +
    B::Data: Send,
        1559  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1560  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1561  +
{
        1562  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1563  +
    type Future = MalformedContentTypeWithPayloadInputFuture;
        1564  +
        1565  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1566  +
        let fut = async move {
        1567  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1568  +
                request.headers(),
        1569  +
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHPAYLOAD,
        1570  +
            ) {
        1571  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        1572  +
            }
        1573  +
            crate::protocol_serde::shape_malformed_content_type_with_payload::de_malformed_content_type_with_payload_http_request(request)
        1574  +
                            .await
        1575  +
                            .map_err(Into::into)
        1576  +
        };
        1577  +
        use ::futures_util::future::TryFutureExt;
        1578  +
        let fut = fut.map_err(
        1579  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        1580  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1581  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        1582  +
                    e,
        1583  +
                )
        1584  +
            },
        1585  +
        );
        1586  +
        MalformedContentTypeWithPayloadInputFuture {
        1587  +
            inner: Box::pin(fut),
        1588  +
        }
        1589  +
    }
        1590  +
}
        1591  +
impl
        1592  +
    ::aws_smithy_http_server::response::IntoResponse<
        1593  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1594  +
    > for crate::output::MalformedContentTypeWithPayloadOutput
        1595  +
{
        1596  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1597  +
        match crate::protocol_serde::shape_malformed_content_type_with_payload::ser_malformed_content_type_with_payload_http_response(self) {
        1598  +
                        Ok(response) => response,
        1599  +
                        Err(e) => {
        1600  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1601  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        1602  +
                        }
        1603  +
                    }
        1604  +
    }
        1605  +
}
        1606  +
        1607  +
#[allow(unreachable_code, unused_variables)]
        1608  +
#[cfg(test)]
        1609  +
mod malformed_content_type_with_payload_test {
        1610  +
        1611  +
    /// When there is a payload with a mediaType trait, the content type must match.
        1612  +
    /// Test ID: RestJsonWithPayloadExpectsModeledContentType
 1440   1613   
    #[::tokio::test]
 1441         -
    async fn document_input_with_string_request() {
        1614  +
    #[::tracing_test::traced_test]
        1615  +
    async fn rest_json_with_payload_expects_modeled_content_type_malformed_request() {
        1616  +
        {
 1442   1617   
            #[allow(unused_mut)]
 1443   1618   
            let mut http_request = http::Request::builder()
 1444         -
            .uri("/DocumentType")
 1445         -
            .method("PUT")
 1446         -
            .header("Content-Type", "application/json")
        1619  +
                .uri("/MalformedContentTypeWithPayload")
        1620  +
                .method("POST")
        1621  +
                .header("content-type", "application/json")
 1447   1622   
                .body(::aws_smithy_http_server::body::Body::from(
 1448         -
                ::bytes::Bytes::from_static(
 1449         -
                    "{\n    \"stringValue\": \"string\",\n    \"documentValue\": \"hello\"\n}"
 1450         -
                        .as_bytes(),
 1451         -
                ),
        1623  +
                    ::bytes::Bytes::from_static("{}".as_bytes()),
 1452   1624   
                ))
 1453   1625   
                .unwrap();
 1454   1626   
            #[allow(unused_mut)]
 1455   1627   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1456   1628   
            let config = crate::service::RestJsonConfig::builder().build();
 1457   1629   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1458         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
        1630  +
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
 1459   1631   
                                let sender = sender.clone();
 1460   1632   
                                async move {
 1461         -
                    let result = {
 1462         -
                        let expected = crate::input::DocumentTypeInput {
 1463         -
                            string_value: ::std::option::Option::Some("string".to_owned()),
 1464         -
                            document_value: ::std::option::Option::Some({
 1465         -
                                let json_bytes = br#""hello""#;
 1466         -
                                let mut tokens =
 1467         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1468         -
                                        .peekable();
 1469         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1470         -
                                    .expect("well formed json")
 1471         -
                            }),
 1472         -
                        };
 1473         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1474         -
                        let response = crate::output::DocumentTypeOutput {
 1475         -
                            string_value: ::std::option::Option::None,
 1476         -
                            document_value: ::std::option::Option::Some({
 1477         -
                                let json_bytes = br#"null"#;
 1478         -
                                let mut tokens =
 1479         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1480         -
                                        .peekable();
 1481         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1482         -
                                    .expect("well formed json")
 1483         -
                            }),
 1484         -
                        };
 1485         -
                        response
 1486         -
                    };
        1633  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
 1487   1634   
                                    sender.send(()).await.expect("receiver dropped early");
 1488   1635   
                                    result
 1489   1636   
                                }
 1490   1637   
                            })
 1491   1638   
                            .build_unchecked();
 1492   1639   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1493   1640   
                .await
 1494   1641   
                .expect("unable to make an HTTP request");
 1495         -
        assert!(receiver.recv().await.is_some());
        1642  +
            ::pretty_assertions::assert_eq!(
        1643  +
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        1644  +
                http_response.status()
        1645  +
            );
        1646  +
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        1647  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1648  +
                http_response.headers(),
        1649  +
                expected_headers,
        1650  +
            ));
 1496   1651   
        }
 1497         -
    /// Serializes document types using a number.
 1498         -
    /// Test ID: DocumentInputWithNumber
 1499         -
    #[::tokio::test]
 1500         -
    async fn document_input_with_number_request() {
        1652  +
    }
        1653  +
    /// When there is a payload without a mediaType trait, the content type must match the
        1654  +
    /// implied content type of the shape.
        1655  +
    /// Test ID: RestJsonWithPayloadExpectsImpliedContentType
        1656  +
    #[::tokio::test]
        1657  +
    #[::tracing_test::traced_test]
        1658  +
    async fn rest_json_with_payload_expects_implied_content_type_malformed_request() {
        1659  +
        {
 1501   1660   
            #[allow(unused_mut)]
 1502   1661   
            let mut http_request = http::Request::builder()
 1503         -
            .uri("/DocumentType")
 1504         -
            .method("PUT")
 1505         -
            .header("Content-Type", "application/json")
        1662  +
                .uri("/MalformedContentTypeWithPayload")
        1663  +
                .method("POST")
        1664  +
                .header("content-type", "application/json")
 1506   1665   
                .body(::aws_smithy_http_server::body::Body::from(
 1507         -
                ::bytes::Bytes::from_static(
 1508         -
                    "{\n    \"stringValue\": \"string\",\n    \"documentValue\": 10\n}".as_bytes(),
 1509         -
                ),
        1666  +
                    ::bytes::Bytes::from_static("{}".as_bytes()),
 1510   1667   
                ))
 1511   1668   
                .unwrap();
 1512   1669   
            #[allow(unused_mut)]
 1513   1670   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1514   1671   
            let config = crate::service::RestJsonConfig::builder().build();
 1515   1672   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1516         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
        1673  +
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
 1517   1674   
                                let sender = sender.clone();
 1518   1675   
                                async move {
 1519         -
                    let result = {
 1520         -
                        let expected = crate::input::DocumentTypeInput {
 1521         -
                            string_value: ::std::option::Option::Some("string".to_owned()),
 1522         -
                            document_value: ::std::option::Option::Some({
 1523         -
                                let json_bytes = br#"10"#;
 1524         -
                                let mut tokens =
 1525         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1526         -
                                        .peekable();
 1527         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1528         -
                                    .expect("well formed json")
 1529         -
                            }),
 1530         -
                        };
 1531         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1532         -
                        let response = crate::output::DocumentTypeOutput {
 1533         -
                            string_value: ::std::option::Option::None,
 1534         -
                            document_value: ::std::option::Option::Some({
 1535         -
                                let json_bytes = br#"null"#;
 1536         -
                                let mut tokens =
 1537         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1538         -
                                        .peekable();
 1539         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1540         -
                                    .expect("well formed json")
 1541         -
                            }),
 1542         -
                        };
 1543         -
                        response
 1544         -
                    };
        1676  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
 1545   1677   
                                    sender.send(()).await.expect("receiver dropped early");
 1546   1678   
                                    result
 1547   1679   
                                }
 1548   1680   
                            })
 1549   1681   
                            .build_unchecked();
 1550   1682   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1551   1683   
                .await
 1552   1684   
                .expect("unable to make an HTTP request");
 1553         -
        assert!(receiver.recv().await.is_some());
        1685  +
            ::pretty_assertions::assert_eq!(
        1686  +
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        1687  +
                http_response.status()
        1688  +
            );
        1689  +
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        1690  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1691  +
                http_response.headers(),
        1692  +
                expected_headers,
        1693  +
            ));
 1554   1694   
        }
 1555         -
    /// Serializes document types using a boolean.
 1556         -
    /// Test ID: DocumentInputWithBoolean
        1695  +
    }
        1696  +
}
        1697  +
        1698  +
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
        1699  +
::pin_project_lite::pin_project! {
        1700  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1701  +
    /// [`MalformedContentTypeWithBodyInput`](crate::input::MalformedContentTypeWithBodyInput) using modelled bindings.
        1702  +
    pub struct MalformedContentTypeWithBodyInputFuture {
        1703  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1704  +
    }
        1705  +
}
        1706  +
        1707  +
impl std::future::Future for MalformedContentTypeWithBodyInputFuture {
        1708  +
    type Output = Result<
        1709  +
        crate::input::MalformedContentTypeWithBodyInput,
        1710  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1711  +
    >;
        1712  +
        1713  +
    fn poll(
        1714  +
        self: std::pin::Pin<&mut Self>,
        1715  +
        cx: &mut std::task::Context<'_>,
        1716  +
    ) -> std::task::Poll<Self::Output> {
        1717  +
        let this = self.project();
        1718  +
        this.inner.as_mut().poll(cx)
        1719  +
    }
        1720  +
}
        1721  +
        1722  +
impl<B>
        1723  +
    ::aws_smithy_http_server::request::FromRequest<
        1724  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1725  +
        B,
        1726  +
    > for crate::input::MalformedContentTypeWithBodyInput
        1727  +
where
        1728  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1729  +
    B: 'static,
        1730  +
        1731  +
    B::Data: Send,
        1732  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1733  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1734  +
{
        1735  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1736  +
    type Future = MalformedContentTypeWithBodyInputFuture;
        1737  +
        1738  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1739  +
        let fut = async move {
        1740  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1741  +
                request.headers(),
        1742  +
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY,
        1743  +
            ) {
        1744  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        1745  +
            }
        1746  +
            crate::protocol_serde::shape_malformed_content_type_with_body::de_malformed_content_type_with_body_http_request(request)
        1747  +
                            .await
        1748  +
                            .map_err(Into::into)
        1749  +
        };
        1750  +
        use ::futures_util::future::TryFutureExt;
        1751  +
        let fut = fut.map_err(
        1752  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        1753  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1754  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        1755  +
                    e,
        1756  +
                )
        1757  +
            },
        1758  +
        );
        1759  +
        MalformedContentTypeWithBodyInputFuture {
        1760  +
            inner: Box::pin(fut),
        1761  +
        }
        1762  +
    }
        1763  +
}
        1764  +
impl
        1765  +
    ::aws_smithy_http_server::response::IntoResponse<
        1766  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1767  +
    > for crate::output::MalformedContentTypeWithBodyOutput
        1768  +
{
        1769  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1770  +
        match crate::protocol_serde::shape_malformed_content_type_with_body::ser_malformed_content_type_with_body_http_response(self) {
        1771  +
                        Ok(response) => response,
        1772  +
                        Err(e) => {
        1773  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1774  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        1775  +
                        }
        1776  +
                    }
        1777  +
    }
        1778  +
}
        1779  +
        1780  +
#[allow(unreachable_code, unused_variables)]
        1781  +
#[cfg(test)]
        1782  +
mod malformed_content_type_with_body_test {
        1783  +
        1784  +
    /// When there is modeled input, they content type must be application/json
        1785  +
    /// Test ID: RestJsonWithBodyExpectsApplicationJsonContentType
 1557   1786   
    #[::tokio::test]
 1558         -
    async fn document_input_with_boolean_request() {
        1787  +
    #[::tracing_test::traced_test]
        1788  +
    async fn rest_json_with_body_expects_application_json_content_type_malformed_request() {
        1789  +
        {
 1559   1790   
            #[allow(unused_mut)]
 1560   1791   
            let mut http_request = http::Request::builder()
 1561         -
            .uri("/DocumentType")
 1562         -
            .method("PUT")
 1563         -
            .header("Content-Type", "application/json")
        1792  +
                .uri("/MalformedContentTypeWithBody")
        1793  +
                .method("POST")
        1794  +
                .header("content-type", "application/hal+json")
 1564   1795   
                .body(::aws_smithy_http_server::body::Body::from(
 1565         -
                ::bytes::Bytes::from_static(
 1566         -
                    "{\n    \"stringValue\": \"string\",\n    \"documentValue\": true\n}"
 1567         -
                        .as_bytes(),
 1568         -
                ),
        1796  +
                    ::bytes::Bytes::from_static("{}".as_bytes()),
 1569   1797   
                ))
 1570   1798   
                .unwrap();
 1571   1799   
            #[allow(unused_mut)]
 1572   1800   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1573   1801   
            let config = crate::service::RestJsonConfig::builder().build();
 1574   1802   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1575         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
        1803  +
                            .malformed_content_type_with_body(move |input: crate::input::MalformedContentTypeWithBodyInput| {
 1576   1804   
                                let sender = sender.clone();
 1577   1805   
                                async move {
 1578         -
                    let result = {
 1579         -
                        let expected = crate::input::DocumentTypeInput {
 1580         -
                            string_value: ::std::option::Option::Some("string".to_owned()),
 1581         -
                            document_value: ::std::option::Option::Some({
 1582         -
                                let json_bytes = br#"true"#;
 1583         -
                                let mut tokens =
 1584         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1585         -
                                        .peekable();
 1586         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1587         -
                                    .expect("well formed json")
 1588         -
                            }),
 1589         -
                        };
 1590         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1591         -
                        let response = crate::output::DocumentTypeOutput {
 1592         -
                            string_value: ::std::option::Option::None,
 1593         -
                            document_value: ::std::option::Option::Some({
 1594         -
                                let json_bytes = br#"null"#;
 1595         -
                                let mut tokens =
 1596         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1597         -
                                        .peekable();
 1598         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1599         -
                                    .expect("well formed json")
 1600         -
                            }),
 1601         -
                        };
 1602         -
                        response
 1603         -
                    };
        1806  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithBodyOutput };
 1604   1807   
                                    sender.send(()).await.expect("receiver dropped early");
 1605   1808   
                                    result
 1606   1809   
                                }
 1607   1810   
                            })
 1608   1811   
                            .build_unchecked();
 1609   1812   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1610   1813   
                .await
 1611   1814   
                .expect("unable to make an HTTP request");
 1612         -
        assert!(receiver.recv().await.is_some());
        1815  +
            ::pretty_assertions::assert_eq!(
        1816  +
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
        1817  +
                http_response.status()
        1818  +
            );
        1819  +
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
        1820  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        1821  +
                http_response.headers(),
        1822  +
                expected_headers,
        1823  +
            ));
 1613   1824   
        }
 1614         -
    /// Serializes document types using a list.
 1615         -
    /// Test ID: DocumentInputWithList
        1825  +
    }
        1826  +
}
        1827  +
        1828  +
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHOUTBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
        1829  +
::pin_project_lite::pin_project! {
        1830  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1831  +
    /// [`MalformedContentTypeWithoutBodyInput`](crate::input::MalformedContentTypeWithoutBodyInput) using modelled bindings.
        1832  +
    pub struct MalformedContentTypeWithoutBodyInputFuture {
        1833  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithoutBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1834  +
    }
        1835  +
}
        1836  +
        1837  +
impl std::future::Future for MalformedContentTypeWithoutBodyInputFuture {
        1838  +
    type Output = Result<
        1839  +
        crate::input::MalformedContentTypeWithoutBodyInput,
        1840  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1841  +
    >;
        1842  +
        1843  +
    fn poll(
        1844  +
        self: std::pin::Pin<&mut Self>,
        1845  +
        cx: &mut std::task::Context<'_>,
        1846  +
    ) -> std::task::Poll<Self::Output> {
        1847  +
        let this = self.project();
        1848  +
        this.inner.as_mut().poll(cx)
        1849  +
    }
        1850  +
}
        1851  +
        1852  +
impl<B>
        1853  +
    ::aws_smithy_http_server::request::FromRequest<
        1854  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1855  +
        B,
        1856  +
    > for crate::input::MalformedContentTypeWithoutBodyInput
        1857  +
where
        1858  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1859  +
    B: 'static,
        1860  +
        1861  +
    B::Data: Send,
        1862  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1863  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1864  +
{
        1865  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1866  +
    type Future = MalformedContentTypeWithoutBodyInputFuture;
        1867  +
        1868  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1869  +
        let fut = async move {
        1870  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        1871  +
                request.headers(),
        1872  +
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHOUTBODY,
        1873  +
            ) {
        1874  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        1875  +
            }
        1876  +
            crate::protocol_serde::shape_malformed_content_type_without_body::de_malformed_content_type_without_body_http_request(request)
        1877  +
                            .await
        1878  +
                            .map_err(Into::into)
        1879  +
        };
        1880  +
        use ::futures_util::future::TryFutureExt;
        1881  +
        let fut = fut.map_err(
        1882  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        1883  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        1884  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        1885  +
                    e,
        1886  +
                )
        1887  +
            },
        1888  +
        );
        1889  +
        MalformedContentTypeWithoutBodyInputFuture {
        1890  +
            inner: Box::pin(fut),
        1891  +
        }
        1892  +
    }
        1893  +
}
        1894  +
impl
        1895  +
    ::aws_smithy_http_server::response::IntoResponse<
        1896  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1897  +
    > for crate::output::MalformedContentTypeWithoutBodyOutput
        1898  +
{
        1899  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        1900  +
        match crate::protocol_serde::shape_malformed_content_type_without_body::ser_malformed_content_type_without_body_http_response(self) {
        1901  +
                        Ok(response) => response,
        1902  +
                        Err(e) => {
        1903  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        1904  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        1905  +
                        }
        1906  +
                    }
        1907  +
    }
        1908  +
}
        1909  +
        1910  +
#[allow(unreachable_code, unused_variables)]
        1911  +
#[cfg(test)]
        1912  +
mod malformed_content_type_without_body_test {
        1913  +
        1914  +
    /// When there is no modeled input, content type must not be set and the body must be empty.
        1915  +
    /// Test ID: RestJsonWithoutBodyExpectsEmptyContentType
 1616   1916   
    #[::tokio::test]
 1617         -
    async fn document_input_with_list_request() {
        1917  +
    #[::tracing_test::traced_test]
        1918  +
    async fn rest_json_without_body_expects_empty_content_type_malformed_request() {
        1919  +
        {
 1618   1920   
            #[allow(unused_mut)]
 1619   1921   
            let mut http_request = http::Request::builder()
 1620         -
                        .uri("/DocumentType")
 1621         -
                        .method("PUT")
 1622         -
        .header("Content-Type", "application/json")
 1623         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"stringValue\": \"string\",\n    \"documentValue\": [\n        true,\n        \"hi\",\n        [\n            1,\n            2\n        ],\n        {\n            \"foo\": {\n                \"baz\": [\n                    3,\n                    4\n                ]\n            }\n        }\n    ]\n}".as_bytes()))).unwrap();
        1922  +
                .uri("/MalformedContentTypeWithoutBody")
        1923  +
                .method("POST")
        1924  +
                .header("content-type", "application/json")
        1925  +
                .body(::aws_smithy_http_server::body::Body::from(
        1926  +
                    ::bytes::Bytes::from_static("{}".as_bytes()),
        1927  +
                ))
        1928  +
                .unwrap();
 1624   1929   
            #[allow(unused_mut)]
 1625   1930   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1626   1931   
            let config = crate::service::RestJsonConfig::builder().build();
 1627   1932   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1628         -
            .document_type(move |input: crate::input::DocumentTypeInput| {
        1933  +
                            .malformed_content_type_without_body(move |input: crate::input::MalformedContentTypeWithoutBodyInput| {
 1629   1934   
                                let sender = sender.clone();
 1630   1935   
                                async move {
 1631         -
                    let result = {
 1632         -
                        let expected = crate::input::DocumentTypeInput {
 1633         -
                            string_value: ::std::option::Option::Some("string".to_owned()),
 1634         -
                            document_value: ::std::option::Option::Some({
 1635         -
                                let json_bytes = br#"[
 1636         -
                                true,
 1637         -
                                "hi",
 1638         -
                                [
 1639         -
                                    1,
 1640         -
                                    2
 1641         -
                                ],
 1642         -
                                {
 1643         -
                                    "foo": {
 1644         -
                                        "baz": [
 1645         -
                                            3,
 1646         -
                                            4
 1647         -
                                        ]
 1648         -
                                    }
 1649         -
                                }
 1650         -
                            ]"#;
 1651         -
                                let mut tokens =
 1652         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1653         -
                                        .peekable();
 1654         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1655         -
                                    .expect("well formed json")
 1656         -
                            }),
 1657         -
                        };
 1658         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1659         -
                        let response = crate::output::DocumentTypeOutput {
 1660         -
                            string_value: ::std::option::Option::None,
 1661         -
                            document_value: ::std::option::Option::Some({
 1662         -
                                let json_bytes = br#"null"#;
 1663         -
                                let mut tokens =
 1664         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1665         -
                                        .peekable();
 1666         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1667         -
                                    .expect("well formed json")
 1668         -
                            }),
 1669         -
                        };
 1670         -
                        response
 1671         -
                    };
        1936  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithoutBodyOutput };
 1672   1937   
                                    sender.send(()).await.expect("receiver dropped early");
 1673   1938   
                                    result
 1674   1939   
                                }
 1675   1940   
                            })
 1676   1941   
                            .build_unchecked();
 1677   1942   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1678   1943   
                .await
 1679   1944   
                .expect("unable to make an HTTP request");
 1680         -
        assert!(receiver.recv().await.is_some());
 1681         -
    }
 1682         -
    /// Serializes documents as part of the JSON response payload with no escaping.
 1683         -
    /// Test ID: DocumentOutput
 1684         -
    #[::tokio::test]
 1685         -
    async fn document_output_response() {
 1686         -
        let output = crate::output::DocumentTypeOutput {
 1687         -
            string_value: ::std::option::Option::Some("string".to_owned()),
 1688         -
            document_value: ::std::option::Option::Some({
 1689         -
                let json_bytes = br#"{
 1690         -
                            "foo": "bar"
 1691         -
                        }"#;
 1692         -
                let mut tokens =
 1693         -
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1694         -
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1695         -
                    .expect("well formed json")
 1696         -
            }),
 1697         -
        };
 1698         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1699         -
        let http_response = output.into_response();
 1700   1945   
            ::pretty_assertions::assert_eq!(
 1701         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        1946  +
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
 1702   1947   
                http_response.status()
 1703   1948   
            );
 1704         -
        let expected_headers = [("Content-Type", "application/json")];
        1949  +
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
 1705   1950   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1706   1951   
                http_response.headers(),
 1707   1952   
                expected_headers,
 1708   1953   
            ));
 1709         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1710         -
            .await
 1711         -
            .expect("unable to extract body to bytes");
 1712         -
        ::aws_smithy_protocol_test::assert_ok(
 1713         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"stringValue\": \"string\",\n    \"documentValue\": {\n        \"foo\": \"bar\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 1714         -
        );
 1715   1954   
        }
 1716         -
    /// Document types can be JSON scalars too.
 1717         -
    /// Test ID: DocumentOutputString
 1718         -
    #[::tokio::test]
 1719         -
    async fn document_output_string_response() {
 1720         -
        let output = crate::output::DocumentTypeOutput {
 1721         -
            string_value: ::std::option::Option::Some("string".to_owned()),
 1722         -
            document_value: ::std::option::Option::Some({
 1723         -
                let json_bytes = br#""hello""#;
 1724         -
                let mut tokens =
 1725         -
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1726         -
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1727         -
                    .expect("well formed json")
 1728         -
            }),
 1729         -
        };
 1730         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1731         -
        let http_response = output.into_response();
 1732         -
        ::pretty_assertions::assert_eq!(
 1733         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1734         -
            http_response.status()
 1735         -
        );
 1736         -
        let expected_headers = [("Content-Type", "application/json")];
 1737         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1738         -
            http_response.headers(),
 1739         -
            expected_headers,
 1740         -
        ));
 1741         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1742         -
            .await
 1743         -
            .expect("unable to extract body to bytes");
 1744         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1745         -
            &body,
 1746         -
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": \"hello\"\n}",
 1747         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1748         -
        ));
 1749   1955   
    }
 1750         -
    /// Document types can be JSON scalars too.
 1751         -
    /// Test ID: DocumentOutputNumber
 1752         -
    #[::tokio::test]
 1753         -
    async fn document_output_number_response() {
 1754         -
        let output = crate::output::DocumentTypeOutput {
 1755         -
            string_value: ::std::option::Option::Some("string".to_owned()),
 1756         -
            document_value: ::std::option::Option::Some({
 1757         -
                let json_bytes = br#"10"#;
 1758         -
                let mut tokens =
 1759         -
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1760         -
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1761         -
                    .expect("well formed json")
 1762         -
            }),
        1956  +
}
        1957  +
        1958  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
        1959  +
::pin_project_lite::pin_project! {
        1960  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        1961  +
    /// [`MalformedTimestampBodyHttpDateInput`](crate::input::MalformedTimestampBodyHttpDateInput) using modelled bindings.
        1962  +
    pub struct MalformedTimestampBodyHttpDateInputFuture {
        1963  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampBodyHttpDateInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        1964  +
    }
        1965  +
}
        1966  +
        1967  +
impl std::future::Future for MalformedTimestampBodyHttpDateInputFuture {
        1968  +
    type Output = Result<
        1969  +
        crate::input::MalformedTimestampBodyHttpDateInput,
        1970  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        1971  +
    >;
        1972  +
        1973  +
    fn poll(
        1974  +
        self: std::pin::Pin<&mut Self>,
        1975  +
        cx: &mut std::task::Context<'_>,
        1976  +
    ) -> std::task::Poll<Self::Output> {
        1977  +
        let this = self.project();
        1978  +
        this.inner.as_mut().poll(cx)
        1979  +
    }
        1980  +
}
        1981  +
        1982  +
impl<B>
        1983  +
    ::aws_smithy_http_server::request::FromRequest<
        1984  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        1985  +
        B,
        1986  +
    > for crate::input::MalformedTimestampBodyHttpDateInput
        1987  +
where
        1988  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        1989  +
    B: 'static,
        1990  +
        1991  +
    B::Data: Send,
        1992  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        1993  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        1994  +
{
        1995  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        1996  +
    type Future = MalformedTimestampBodyHttpDateInputFuture;
        1997  +
        1998  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        1999  +
        let fut = async move {
        2000  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        2001  +
                request.headers(),
        2002  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYHTTPDATE,
        2003  +
            ) {
        2004  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        2005  +
            }
        2006  +
            crate::protocol_serde::shape_malformed_timestamp_body_http_date::de_malformed_timestamp_body_http_date_http_request(request)
        2007  +
                            .await
        2008  +
                            .map_err(Into::into)
 1763   2009   
        };
 1764         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1765         -
        let http_response = output.into_response();
 1766         -
        ::pretty_assertions::assert_eq!(
 1767         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1768         -
            http_response.status()
        2010  +
        use ::futures_util::future::TryFutureExt;
        2011  +
        let fut = fut.map_err(
        2012  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        2013  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        2014  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        2015  +
                    e,
        2016  +
                )
        2017  +
            },
 1769   2018   
        );
 1770         -
        let expected_headers = [("Content-Type", "application/json")];
 1771         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1772         -
            http_response.headers(),
 1773         -
            expected_headers,
 1774         -
        ));
 1775         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1776         -
            .await
 1777         -
            .expect("unable to extract body to bytes");
 1778         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1779         -
            &body,
 1780         -
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": 10\n}",
 1781         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1782         -
        ));
        2019  +
        MalformedTimestampBodyHttpDateInputFuture {
        2020  +
            inner: Box::pin(fut),
        2021  +
        }
        2022  +
    }
        2023  +
}
        2024  +
impl
        2025  +
    ::aws_smithy_http_server::response::IntoResponse<
        2026  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        2027  +
    > for crate::output::MalformedTimestampBodyHttpDateOutput
        2028  +
{
        2029  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        2030  +
        match crate::protocol_serde::shape_malformed_timestamp_body_http_date::ser_malformed_timestamp_body_http_date_http_response(self) {
        2031  +
                        Ok(response) => response,
        2032  +
                        Err(e) => {
        2033  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        2034  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 1783   2035   
                        }
 1784         -
    /// Document types can be JSON scalars too.
 1785         -
    /// Test ID: DocumentOutputBoolean
 1786         -
    #[::tokio::test]
 1787         -
    async fn document_output_boolean_response() {
 1788         -
        let output = crate::output::DocumentTypeOutput {
 1789         -
            string_value: ::std::option::Option::Some("string".to_owned()),
 1790         -
            document_value: ::std::option::Option::Some({
 1791         -
                let json_bytes = br#"false"#;
 1792         -
                let mut tokens =
 1793         -
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1794         -
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1795         -
                    .expect("well formed json")
 1796         -
            }),
 1797         -
        };
 1798         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1799         -
        let http_response = output.into_response();
 1800         -
        ::pretty_assertions::assert_eq!(
 1801         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1802         -
            http_response.status()
 1803         -
        );
 1804         -
        let expected_headers = [("Content-Type", "application/json")];
 1805         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1806         -
            http_response.headers(),
 1807         -
            expected_headers,
 1808         -
        ));
 1809         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1810         -
            .await
 1811         -
            .expect("unable to extract body to bytes");
 1812         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 1813         -
            &body,
 1814         -
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": false\n}",
 1815         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 1816         -
        ));
 1817   2036   
                    }
 1818         -
    /// Document types can be JSON arrays.
 1819         -
    /// Test ID: DocumentOutputArray
 1820         -
    #[::tokio::test]
 1821         -
    async fn document_output_array_response() {
 1822         -
        let output = crate::output::DocumentTypeOutput {
 1823         -
            string_value: ::std::option::Option::Some("string".to_owned()),
 1824         -
            document_value: ::std::option::Option::Some({
 1825         -
                let json_bytes = br#"[
 1826         -
                            true,
 1827         -
                            false
 1828         -
                        ]"#;
 1829         -
                let mut tokens =
 1830         -
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1831         -
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1832         -
                    .expect("well formed json")
 1833         -
            }),
 1834         -
        };
 1835         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1836         -
        let http_response = output.into_response();
 1837         -
        ::pretty_assertions::assert_eq!(
 1838         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1839         -
            http_response.status()
 1840         -
        );
 1841         -
        let expected_headers = [("Content-Type", "application/json")];
 1842         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1843         -
            http_response.headers(),
 1844         -
            expected_headers,
 1845         -
        ));
 1846         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1847         -
            .await
 1848         -
            .expect("unable to extract body to bytes");
 1849         -
        ::aws_smithy_protocol_test::assert_ok(
 1850         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"stringValue\": \"string\",\n    \"documentValue\": [\n        true,\n        false\n    ]\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 1851         -
        );
 1852   2037   
    }
 1853   2038   
}
 1854         -
#[cfg(test)]
 1855         -
#[allow(unreachable_code, unused_variables)]
 1856         -
mod server_document_type_as_map_value_test {
 1857         -
    /// Serializes a map that uses documents as the value.
 1858         -
    /// Test ID: DocumentTypeAsMapValueInput
 1859         -
    #[::tokio::test]
 1860         -
    async fn document_type_as_map_value_input_request() {
 1861         -
        #[allow(unused_mut)]
 1862         -
                    let mut http_request = http::Request::builder()
 1863         -
                        .uri("/DocumentTypeAsMapValue")
 1864         -
                        .method("PUT")
 1865         -
        .header("Content-Type", "application/json")
 1866         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"docValuedMap\": {\n        \"foo\": { \"f\": 1, \"o\": 2 },\n        \"bar\": [ \"b\", \"a\", \"r\" ],\n        \"baz\": \"BAZ\"\n    }\n}".as_bytes()))).unwrap();
 1867         -
        #[allow(unused_mut)]
 1868         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 1869         -
        let config = crate::service::RestJsonConfig::builder().build();
 1870         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 1871         -
            .document_type_as_map_value(move |input: crate::input::DocumentTypeAsMapValueInput| {
 1872         -
                let sender = sender.clone();
 1873         -
                async move {
 1874         -
                    let result = {
 1875         -
                        let expected = crate::input::DocumentTypeAsMapValueInput {
 1876         -
                            doc_valued_map: ::std::option::Option::Some({
 1877         -
                                let mut ret = ::std::collections::HashMap::new();
 1878         -
                                ret.insert("foo".to_owned(), {
 1879         -
                                    let json_bytes = br#"{
 1880         -
                                        "f": 1,
 1881         -
                                        "o": 2
 1882         -
                                    }"#;
 1883         -
                                    let mut tokens =
 1884         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1885         -
                                            .peekable();
 1886         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1887         -
                                        &mut tokens,
 1888         -
                                    )
 1889         -
                                    .expect("well formed json")
 1890         -
                                });
 1891         -
                                ret.insert("bar".to_owned(), {
 1892         -
                                    let json_bytes = br#"[
 1893         -
                                        "b",
 1894         -
                                        "a",
 1895         -
                                        "r"
 1896         -
                                    ]"#;
 1897         -
                                    let mut tokens =
 1898         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1899         -
                                            .peekable();
 1900         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1901         -
                                        &mut tokens,
 1902         -
                                    )
 1903         -
                                    .expect("well formed json")
 1904         -
                                });
 1905         -
                                ret.insert("baz".to_owned(), {
 1906         -
                                    let json_bytes = br#""BAZ""#;
 1907         -
                                    let mut tokens =
 1908         -
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 1909         -
                                            .peekable();
 1910         -
                                    ::aws_smithy_json::deserialize::token::expect_document(
 1911         -
                                        &mut tokens,
 1912         -
                                    )
 1913         -
                                    .expect("well formed json")
 1914         -
                                });
 1915         -
                                ret
 1916         -
                            }),
 1917         -
                        };
 1918         -
                        ::pretty_assertions::assert_eq!(input, expected);
 1919         -
                        let response = crate::output::DocumentTypeAsMapValueOutput {
 1920         -
                            doc_valued_map: ::std::option::Option::None,
 1921         -
                        };
        2039  +
impl
        2040  +
    ::aws_smithy_http_server::response::IntoResponse<
        2041  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        2042  +
    > for crate::error::MalformedTimestampBodyHttpDateError
        2043  +
{
        2044  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        2045  +
        match crate::protocol_serde::shape_malformed_timestamp_body_http_date::ser_malformed_timestamp_body_http_date_http_error(&self) {
        2046  +
            Ok(mut response) => {
        2047  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 1922   2048   
                response
 1923         -
                    };
 1924         -
                    sender.send(()).await.expect("receiver dropped early");
 1925         -
                    result
        2049  +
            },
        2050  +
            Err(e) => {
        2051  +
                ::tracing::error!(error = %e, "failed to serialize response");
        2052  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 1926   2053   
            }
 1927         -
            })
 1928         -
            .build_unchecked();
 1929         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 1930         -
            .await
 1931         -
            .expect("unable to make an HTTP request");
 1932         -
        assert!(receiver.recv().await.is_some());
 1933   2054   
        }
 1934         -
    /// Serializes a map that uses documents as the value.
 1935         -
    /// Test ID: DocumentTypeAsMapValueOutput
 1936         -
    #[::tokio::test]
 1937         -
    async fn document_type_as_map_value_output_response() {
 1938         -
        let output = crate::output::DocumentTypeAsMapValueOutput {
 1939         -
            doc_valued_map: ::std::option::Option::Some({
 1940         -
                let mut ret = ::std::collections::HashMap::new();
 1941         -
                ret.insert("foo".to_owned(), {
 1942         -
                    let json_bytes = br#"{
 1943         -
                                    "f": 1,
 1944         -
                                    "o": 2
 1945         -
                                }"#;
 1946         -
                    let mut tokens =
 1947         -
                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1948         -
                    ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1949         -
                        .expect("well formed json")
 1950         -
                });
 1951         -
                ret.insert("bar".to_owned(), {
 1952         -
                    let json_bytes = br#"[
 1953         -
                                    "b",
 1954         -
                                    "a",
 1955         -
                                    "r"
 1956         -
                                ]"#;
 1957         -
                    let mut tokens =
 1958         -
                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1959         -
                    ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1960         -
                        .expect("well formed json")
 1961         -
                });
 1962         -
                ret.insert("baz".to_owned(), {
 1963         -
                    let json_bytes = br#""BAZ""#;
 1964         -
                    let mut tokens =
 1965         -
                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 1966         -
                    ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 1967         -
                        .expect("well formed json")
 1968         -
                });
 1969         -
                ret
 1970         -
            }),
 1971         -
        };
 1972         -
        use ::aws_smithy_http_server::response::IntoResponse;
 1973         -
        let http_response = output.into_response();
 1974         -
        ::pretty_assertions::assert_eq!(
 1975         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 1976         -
            http_response.status()
 1977         -
        );
 1978         -
        let expected_headers = [("Content-Type", "application/json")];
 1979         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 1980         -
            http_response.headers(),
 1981         -
            expected_headers,
 1982         -
        ));
 1983         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 1984         -
            .await
 1985         -
            .expect("unable to extract body to bytes");
 1986         -
        ::aws_smithy_protocol_test::assert_ok(
 1987         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"docValuedMap\": {\n        \"foo\": { \"f\": 1, \"o\": 2 },\n        \"bar\": [ \"b\", \"a\", \"r\" ],\n        \"baz\": \"BAZ\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 1988         -
        );
 1989   2055   
    }
 1990   2056   
}
 1991         -
#[cfg(test)]
        2057  +
 1992   2058   
#[allow(unreachable_code, unused_variables)]
 1993         -
mod server_document_type_as_payload_test {
 1994         -
    /// Serializes a document as the target of the httpPayload trait.
 1995         -
    /// Test ID: DocumentTypeAsPayloadInput
        2059  +
#[cfg(test)]
        2060  +
mod malformed_timestamp_body_http_date_test {
        2061  +
        2062  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        2063  +
    /// 400 SerializationException
        2064  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case0
 1996   2065   
    #[::tokio::test]
 1997         -
    async fn document_type_as_payload_input_request() {
        2066  +
    #[::tracing_test::traced_test]
        2067  +
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case0_malformed_request() {
        2068  +
        {
 1998   2069   
            #[allow(unused_mut)]
 1999   2070   
            let mut http_request = http::Request::builder()
 2000         -
            .uri("/DocumentTypeAsPayload")
 2001         -
            .method("PUT")
 2002         -
            .header("Content-Type", "application/json")
        2071  +
                .uri("/MalformedTimestampBodyHttpDate")
        2072  +
                .method("POST")
        2073  +
                .header("content-type", "application/json")
 2003   2074   
                .body(::aws_smithy_http_server::body::Body::from(
 2004         -
                ::bytes::Bytes::from_static("{\n    \"foo\": \"bar\"\n}".as_bytes()),
        2075  +
                    ::bytes::Bytes::from_static(
        2076  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
        2077  +
                    ),
 2005   2078   
                ))
 2006   2079   
                .unwrap();
 2007   2080   
            #[allow(unused_mut)]
 2008   2081   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2009   2082   
            let config = crate::service::RestJsonConfig::builder().build();
 2010   2083   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2011         -
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
        2084  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
 2012   2085   
                                let sender = sender.clone();
 2013   2086   
                                async move {
 2014         -
                    let result = {
 2015         -
                        let expected = crate::input::DocumentTypeAsPayloadInput {
 2016         -
                            document_value: ::std::option::Option::Some({
 2017         -
                                let json_bytes = br#"{
 2018         -
                                "foo": "bar"
 2019         -
                            }"#;
 2020         -
                                let mut tokens =
 2021         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 2022         -
                                        .peekable();
 2023         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 2024         -
                                    .expect("well formed json")
 2025         -
                            }),
 2026         -
                        };
 2027         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2028         -
                        let response = crate::output::DocumentTypeAsPayloadOutput {
 2029         -
                            document_value: ::std::option::Option::Some({
 2030         -
                                let json_bytes = br#"null"#;
 2031         -
                                let mut tokens =
 2032         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 2033         -
                                        .peekable();
 2034         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 2035         -
                                    .expect("well formed json")
 2036         -
                            }),
 2037         -
                        };
 2038         -
                        response
 2039         -
                    };
        2087  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
 2040   2088   
                                    sender.send(()).await.expect("receiver dropped early");
 2041   2089   
                                    result
 2042   2090   
                                }
 2043   2091   
                            })
 2044   2092   
                            .build_unchecked();
 2045   2093   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2046   2094   
                .await
 2047   2095   
                .expect("unable to make an HTTP request");
 2048         -
        assert!(receiver.recv().await.is_some());
        2096  +
            ::pretty_assertions::assert_eq!(
        2097  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2098  +
                http_response.status()
        2099  +
            );
        2100  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2101  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2102  +
                http_response.headers(),
        2103  +
                expected_headers,
        2104  +
            ));
 2049   2105   
        }
 2050         -
    /// Serializes a document as the target of the httpPayload trait using a string.
 2051         -
    /// Test ID: DocumentTypeAsPayloadInputString
        2106  +
    }
        2107  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        2108  +
    /// 400 SerializationException
        2109  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case1
 2052   2110   
    #[::tokio::test]
 2053         -
    async fn document_type_as_payload_input_string_request() {
        2111  +
    #[::tracing_test::traced_test]
        2112  +
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case1_malformed_request() {
        2113  +
        {
 2054   2114   
            #[allow(unused_mut)]
 2055   2115   
            let mut http_request = http::Request::builder()
 2056         -
            .uri("/DocumentTypeAsPayload")
 2057         -
            .method("PUT")
 2058         -
            .header("Content-Type", "application/json")
        2116  +
                .uri("/MalformedTimestampBodyHttpDate")
        2117  +
                .method("POST")
        2118  +
                .header("content-type", "application/json")
 2059   2119   
                .body(::aws_smithy_http_server::body::Body::from(
 2060         -
                ::bytes::Bytes::from_static("\"hello\"".as_bytes()),
        2120  +
                    ::bytes::Bytes::from_static(
        2121  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
        2122  +
                    ),
 2061   2123   
                ))
 2062   2124   
                .unwrap();
 2063   2125   
            #[allow(unused_mut)]
 2064   2126   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2065   2127   
            let config = crate::service::RestJsonConfig::builder().build();
 2066   2128   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2067         -
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
        2129  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
 2068   2130   
                                let sender = sender.clone();
 2069   2131   
                                async move {
 2070         -
                    let result = {
 2071         -
                        let expected = crate::input::DocumentTypeAsPayloadInput {
 2072         -
                            document_value: ::std::option::Option::Some({
 2073         -
                                let json_bytes = br#""hello""#;
 2074         -
                                let mut tokens =
 2075         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 2076         -
                                        .peekable();
 2077         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 2078         -
                                    .expect("well formed json")
 2079         -
                            }),
 2080         -
                        };
 2081         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2082         -
                        let response = crate::output::DocumentTypeAsPayloadOutput {
 2083         -
                            document_value: ::std::option::Option::Some({
 2084         -
                                let json_bytes = br#"null"#;
 2085         -
                                let mut tokens =
 2086         -
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
 2087         -
                                        .peekable();
 2088         -
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 2089         -
                                    .expect("well formed json")
 2090         -
                            }),
 2091         -
                        };
 2092         -
                        response
 2093         -
                    };
        2132  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
 2094   2133   
                                    sender.send(()).await.expect("receiver dropped early");
 2095   2134   
                                    result
 2096   2135   
                                }
 2097   2136   
                            })
 2098   2137   
                            .build_unchecked();
 2099   2138   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2100   2139   
                .await
 2101   2140   
                .expect("unable to make an HTTP request");
 2102         -
        assert!(receiver.recv().await.is_some());
 2103         -
    }
 2104         -
    /// Serializes a document as the target of the httpPayload trait.
 2105         -
    /// Test ID: DocumentTypeAsPayloadOutput
 2106         -
    #[::tokio::test]
 2107         -
    async fn document_type_as_payload_output_response() {
 2108         -
        let output = crate::output::DocumentTypeAsPayloadOutput {
 2109         -
            document_value: ::std::option::Option::Some({
 2110         -
                let json_bytes = br#"{
 2111         -
                            "foo": "bar"
 2112         -
                        }"#;
 2113         -
                let mut tokens =
 2114         -
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 2115         -
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 2116         -
                    .expect("well formed json")
 2117         -
            }),
 2118         -
        };
 2119         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2120         -
        let http_response = output.into_response();
 2121   2141   
            ::pretty_assertions::assert_eq!(
 2122         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2142  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 2123   2143   
                http_response.status()
 2124   2144   
            );
 2125         -
        let expected_headers = [("Content-Type", "application/json")];
        2145  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 2126   2146   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2127   2147   
                http_response.headers(),
 2128   2148   
                expected_headers,
 2129   2149   
            ));
 2130         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2131         -
            .await
 2132         -
            .expect("unable to extract body to bytes");
 2133         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2134         -
            &body,
 2135         -
            "{\n    \"foo\": \"bar\"\n}",
 2136         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2137         -
        ));
 2138   2150   
        }
 2139         -
    /// Serializes a document as a payload string.
 2140         -
    /// Test ID: DocumentTypeAsPayloadOutputString
 2141         -
    #[::tokio::test]
 2142         -
    async fn document_type_as_payload_output_string_response() {
 2143         -
        let output = crate::output::DocumentTypeAsPayloadOutput {
 2144         -
            document_value: ::std::option::Option::Some({
 2145         -
                let json_bytes = br#""hello""#;
 2146         -
                let mut tokens =
 2147         -
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
 2148         -
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
 2149         -
                    .expect("well formed json")
 2150         -
            }),
 2151         -
        };
 2152         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2153         -
        let http_response = output.into_response();
 2154         -
        ::pretty_assertions::assert_eq!(
 2155         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2156         -
            http_response.status()
 2157         -
        );
 2158         -
        let expected_headers = [("Content-Type", "application/json")];
 2159         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2160         -
            http_response.headers(),
 2161         -
            expected_headers,
 2162         -
        ));
 2163         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2164         -
            .await
 2165         -
            .expect("unable to extract body to bytes");
 2166         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2167         -
            &body,
 2168         -
            "\"hello\"",
 2169         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2170         -
        ));
 2171   2151   
    }
 2172         -
}
 2173         -
#[cfg(test)]
 2174         -
#[allow(unreachable_code, unused_variables)]
 2175         -
mod server_empty_input_and_empty_output_test {
 2176         -
    /// Clients should not serialize a JSON payload when no parameters
 2177         -
    /// are given that are sent in the body. A service will tolerate
 2178         -
    /// clients that omit a payload or that send a JSON object.
 2179         -
    /// Test ID: RestJsonEmptyInputAndEmptyOutput
        2152  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        2153  +
    /// 400 SerializationException
        2154  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case2
 2180   2155   
    #[::tokio::test]
 2181         -
    async fn rest_json_empty_input_and_empty_output_request() {
        2156  +
    #[::tracing_test::traced_test]
        2157  +
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case2_malformed_request() {
        2158  +
        {
 2182   2159   
            #[allow(unused_mut)]
 2183   2160   
            let mut http_request = http::Request::builder()
 2184         -
            .uri("/EmptyInputAndEmptyOutput")
        2161  +
                .uri("/MalformedTimestampBodyHttpDate")
 2185   2162   
                .method("POST")
        2163  +
                .header("content-type", "application/json")
 2186   2164   
                .body(::aws_smithy_http_server::body::Body::from(
 2187         -
                ::bytes::Bytes::from_static("".as_bytes()),
        2165  +
                    ::bytes::Bytes::from_static(
        2166  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
        2167  +
                    ),
 2188   2168   
                ))
 2189   2169   
                .unwrap();
 2190   2170   
            #[allow(unused_mut)]
 2191   2171   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2192   2172   
            let config = crate::service::RestJsonConfig::builder().build();
 2193   2173   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2194         -
            .empty_input_and_empty_output(
 2195         -
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
        2174  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
 2196   2175   
                                let sender = sender.clone();
 2197   2176   
                                async move {
 2198         -
                        let result = {
 2199         -
                            let expected = crate::input::EmptyInputAndEmptyOutputInput {};
 2200         -
                            ::pretty_assertions::assert_eq!(input, expected);
 2201         -
                            let response = crate::output::EmptyInputAndEmptyOutputOutput {};
 2202         -
                            response
 2203         -
                        };
        2177  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
 2204   2178   
                                    sender.send(()).await.expect("receiver dropped early");
 2205   2179   
                                    result
 2206   2180   
                                }
 2207         -
                },
 2208         -
            )
        2181  +
                            })
 2209   2182   
                            .build_unchecked();
 2210   2183   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2211   2184   
                .await
 2212   2185   
                .expect("unable to make an HTTP request");
 2213         -
        assert!(receiver.recv().await.is_some());
        2186  +
            ::pretty_assertions::assert_eq!(
        2187  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2188  +
                http_response.status()
        2189  +
            );
        2190  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2191  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2192  +
                http_response.headers(),
        2193  +
                expected_headers,
        2194  +
            ));
 2214   2195   
        }
 2215         -
    /// Similar to RestJsonEmptyInputAndEmptyOutput, but ensures that
 2216         -
    /// services gracefully handles receiving a JSON object.
 2217         -
    /// Test ID: RestJsonEmptyInputAndEmptyOutputWithJson
        2196  +
    }
        2197  +
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
        2198  +
    /// 400 SerializationException
        2199  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case0
 2218   2200   
    #[::tokio::test]
 2219         -
    async fn rest_json_empty_input_and_empty_output_with_json_request() {
        2201  +
    #[::tracing_test::traced_test]
        2202  +
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case0_malformed_request() {
        2203  +
        {
 2220   2204   
            #[allow(unused_mut)]
 2221   2205   
            let mut http_request = http::Request::builder()
 2222         -
            .uri("/EmptyInputAndEmptyOutput")
        2206  +
                .uri("/MalformedTimestampBodyHttpDate")
 2223   2207   
                .method("POST")
 2224         -
            .header("Content-Type", "application/json")
        2208  +
                .header("content-type", "application/json")
 2225   2209   
                .body(::aws_smithy_http_server::body::Body::from(
 2226         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
        2210  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
 2227   2211   
                ))
 2228   2212   
                .unwrap();
 2229   2213   
            #[allow(unused_mut)]
 2230   2214   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2231   2215   
            let config = crate::service::RestJsonConfig::builder().build();
 2232   2216   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2233         -
            .empty_input_and_empty_output(
 2234         -
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
        2217  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
 2235   2218   
                                let sender = sender.clone();
 2236   2219   
                                async move {
 2237         -
                        let result = {
 2238         -
                            let expected = crate::input::EmptyInputAndEmptyOutputInput {};
 2239         -
                            ::pretty_assertions::assert_eq!(input, expected);
 2240         -
                            let response = crate::output::EmptyInputAndEmptyOutputOutput {};
 2241         -
                            response
 2242         -
                        };
        2220  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
 2243   2221   
                                    sender.send(()).await.expect("receiver dropped early");
 2244   2222   
                                    result
 2245   2223   
                                }
 2246         -
                },
 2247         -
            )
        2224  +
                            })
 2248   2225   
                            .build_unchecked();
 2249   2226   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2250   2227   
                .await
 2251   2228   
                .expect("unable to make an HTTP request");
 2252         -
        assert!(receiver.recv().await.is_some());
 2253         -
    }
 2254         -
    /// As of January 2021, server implementations are expected to
 2255         -
    /// respond with a JSON object regardless of if the output
 2256         -
    /// parameters are empty.
 2257         -
    /// Test ID: RestJsonEmptyInputAndEmptyOutput
 2258         -
    #[::tokio::test]
 2259         -
    async fn rest_json_empty_input_and_empty_output_response() {
 2260         -
        let output = crate::output::EmptyInputAndEmptyOutputOutput {};
 2261         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2262         -
        let http_response = output.into_response();
 2263   2229   
            ::pretty_assertions::assert_eq!(
 2264         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2230  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 2265   2231   
                http_response.status()
 2266   2232   
            );
 2267         -
        let expected_headers = [("Content-Type", "application/json")];
        2233  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 2268   2234   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2269   2235   
                http_response.headers(),
 2270   2236   
                expected_headers,
 2271   2237   
            ));
 2272         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2273         -
            .await
 2274         -
            .expect("unable to extract body to bytes");
 2275         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2276         -
            &body,
 2277         -
            "{}",
 2278         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2279         -
        ));
 2280   2238   
        }
 2281         -
}
 2282         -
#[cfg(test)]
 2283         -
#[allow(unreachable_code, unused_variables)]
 2284         -
mod server_endpoint_operation_test {
 2285         -
    /// Operations can prepend to the given host if they define the
 2286         -
    /// endpoint trait.
 2287         -
    /// Test ID: RestJsonEndpointTrait
        2239  +
    }
        2240  +
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
        2241  +
    /// 400 SerializationException
        2242  +
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case1
 2288   2243   
    #[::tokio::test]
 2289         -
    #[should_panic]
 2290         -
    async fn rest_json_endpoint_trait_request() {
        2244  +
    #[::tracing_test::traced_test]
        2245  +
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case1_malformed_request() {
        2246  +
        {
 2291   2247   
            #[allow(unused_mut)]
 2292   2248   
            let mut http_request = http::Request::builder()
 2293         -
            .uri("/EndpointOperation")
        2249  +
                .uri("/MalformedTimestampBodyHttpDate")
 2294   2250   
                .method("POST")
        2251  +
                .header("content-type", "application/json")
 2295   2252   
                .body(::aws_smithy_http_server::body::Body::from(
 2296         -
                ::bytes::Bytes::from_static("".as_bytes()),
        2253  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
 2297   2254   
                ))
 2298   2255   
                .unwrap();
 2299         -
        todo!("endpoint trait not supported yet");
 2300   2256   
            #[allow(unused_mut)]
 2301   2257   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2302   2258   
            let config = crate::service::RestJsonConfig::builder().build();
 2303   2259   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2304         -
            .endpoint_operation(move |input: crate::input::EndpointOperationInput| {
        2260  +
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
 2305   2261   
                                let sender = sender.clone();
 2306   2262   
                                async move {
 2307         -
                    let result = {
 2308         -
                        let expected = crate::input::EndpointOperationInput {};
 2309         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2310         -
                        let response = crate::output::EndpointOperationOutput {};
 2311         -
                        response
 2312         -
                    };
        2263  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
 2313   2264   
                                    sender.send(()).await.expect("receiver dropped early");
 2314   2265   
                                    result
 2315   2266   
                                }
 2316   2267   
                            })
 2317   2268   
                            .build_unchecked();
 2318   2269   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2319   2270   
                .await
 2320   2271   
                .expect("unable to make an HTTP request");
 2321         -
        assert!(receiver.recv().await.is_some());
 2322         -
    }
 2323         -
}
 2324         -
#[cfg(test)]
 2325         -
#[allow(unreachable_code, unused_variables)]
 2326         -
mod server_endpoint_with_host_label_operation_test {
 2327         -
    /// Operations can prepend to the given host if they define the
 2328         -
    /// endpoint trait, and can use the host label trait to define
 2329         -
    /// further customization based on user input.
 2330         -
    /// Test ID: RestJsonEndpointTraitWithHostLabel
        2272  +
            ::pretty_assertions::assert_eq!(
        2273  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2274  +
                http_response.status()
        2275  +
            );
        2276  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2277  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2278  +
                http_response.headers(),
        2279  +
                expected_headers,
        2280  +
            ));
        2281  +
        }
        2282  +
    }
        2283  +
}
        2284  +
        2285  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDATETIME: ::mime::Mime = ::mime::APPLICATION_JSON;
        2286  +
::pin_project_lite::pin_project! {
        2287  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        2288  +
    /// [`MalformedTimestampBodyDateTimeInput`](crate::input::MalformedTimestampBodyDateTimeInput) using modelled bindings.
        2289  +
    pub struct MalformedTimestampBodyDateTimeInputFuture {
        2290  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampBodyDateTimeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        2291  +
    }
        2292  +
}
        2293  +
        2294  +
impl std::future::Future for MalformedTimestampBodyDateTimeInputFuture {
        2295  +
    type Output = Result<
        2296  +
        crate::input::MalformedTimestampBodyDateTimeInput,
        2297  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        2298  +
    >;
        2299  +
        2300  +
    fn poll(
        2301  +
        self: std::pin::Pin<&mut Self>,
        2302  +
        cx: &mut std::task::Context<'_>,
        2303  +
    ) -> std::task::Poll<Self::Output> {
        2304  +
        let this = self.project();
        2305  +
        this.inner.as_mut().poll(cx)
        2306  +
    }
        2307  +
}
        2308  +
        2309  +
impl<B>
        2310  +
    ::aws_smithy_http_server::request::FromRequest<
        2311  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        2312  +
        B,
        2313  +
    > for crate::input::MalformedTimestampBodyDateTimeInput
        2314  +
where
        2315  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        2316  +
    B: 'static,
        2317  +
        2318  +
    B::Data: Send,
        2319  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        2320  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        2321  +
{
        2322  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        2323  +
    type Future = MalformedTimestampBodyDateTimeInputFuture;
        2324  +
        2325  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        2326  +
        let fut = async move {
        2327  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        2328  +
                request.headers(),
        2329  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDATETIME,
        2330  +
            ) {
        2331  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        2332  +
            }
        2333  +
            crate::protocol_serde::shape_malformed_timestamp_body_date_time::de_malformed_timestamp_body_date_time_http_request(request)
        2334  +
                            .await
        2335  +
                            .map_err(Into::into)
        2336  +
        };
        2337  +
        use ::futures_util::future::TryFutureExt;
        2338  +
        let fut = fut.map_err(
        2339  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        2340  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        2341  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        2342  +
                    e,
        2343  +
                )
        2344  +
            },
        2345  +
        );
        2346  +
        MalformedTimestampBodyDateTimeInputFuture {
        2347  +
            inner: Box::pin(fut),
        2348  +
        }
        2349  +
    }
        2350  +
}
        2351  +
impl
        2352  +
    ::aws_smithy_http_server::response::IntoResponse<
        2353  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        2354  +
    > for crate::output::MalformedTimestampBodyDateTimeOutput
        2355  +
{
        2356  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        2357  +
        match crate::protocol_serde::shape_malformed_timestamp_body_date_time::ser_malformed_timestamp_body_date_time_http_response(self) {
        2358  +
                        Ok(response) => response,
        2359  +
                        Err(e) => {
        2360  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        2361  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        2362  +
                        }
        2363  +
                    }
        2364  +
    }
        2365  +
}
        2366  +
impl
        2367  +
    ::aws_smithy_http_server::response::IntoResponse<
        2368  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        2369  +
    > for crate::error::MalformedTimestampBodyDateTimeError
        2370  +
{
        2371  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        2372  +
        match crate::protocol_serde::shape_malformed_timestamp_body_date_time::ser_malformed_timestamp_body_date_time_http_error(&self) {
        2373  +
            Ok(mut response) => {
        2374  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        2375  +
                response
        2376  +
            },
        2377  +
            Err(e) => {
        2378  +
                ::tracing::error!(error = %e, "failed to serialize response");
        2379  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        2380  +
            }
        2381  +
        }
        2382  +
    }
        2383  +
}
        2384  +
        2385  +
#[allow(unreachable_code, unused_variables)]
        2386  +
#[cfg(test)]
        2387  +
mod malformed_timestamp_body_date_time_test {
        2388  +
        2389  +
    /// When the format is date-time, IMF-fixdate timestamps are rejected with a
        2390  +
    /// 400 SerializationException
        2391  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsHttpDate_case0
 2331   2392   
    #[::tokio::test]
 2332         -
    #[should_panic]
 2333         -
    async fn rest_json_endpoint_trait_with_host_label_request() {
        2393  +
    #[::tracing_test::traced_test]
        2394  +
    async fn rest_json_body_timestamp_date_time_rejects_http_date_case0_malformed_request() {
        2395  +
        {
 2334   2396   
            #[allow(unused_mut)]
 2335   2397   
            let mut http_request = http::Request::builder()
 2336         -
            .uri("/EndpointWithHostLabelOperation")
        2398  +
                .uri("/MalformedTimestampBodyDateTime")
 2337   2399   
                .method("POST")
        2400  +
                .header("content-type", "application/json")
 2338   2401   
                .body(::aws_smithy_http_server::body::Body::from(
 2339         -
                ::bytes::Bytes::from_static("{\"label\": \"bar\"}".as_bytes()),
        2402  +
                    ::bytes::Bytes::from_static(
        2403  +
                        "{ \"timestamp\": \"Tue, 29 Apr 2014 18:30:38 GMT\" }".as_bytes(),
        2404  +
                    ),
 2340   2405   
                ))
 2341   2406   
                .unwrap();
 2342         -
        todo!("endpoint trait not supported yet");
 2343   2407   
            #[allow(unused_mut)]
 2344   2408   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2345   2409   
            let config = crate::service::RestJsonConfig::builder().build();
 2346   2410   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2347         -
            .endpoint_with_host_label_operation(
 2348         -
                move |input: crate::input::EndpointWithHostLabelOperationInput| {
        2411  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2349   2412   
                                let sender = sender.clone();
 2350   2413   
                                async move {
 2351         -
                        let result = {
 2352         -
                            let expected = crate::input::EndpointWithHostLabelOperationInput {
 2353         -
                                label: "bar".to_owned(),
 2354         -
                            };
 2355         -
                            ::pretty_assertions::assert_eq!(input, expected);
 2356         -
                            let response = crate::output::EndpointWithHostLabelOperationOutput {};
 2357         -
                            Ok(response)
 2358         -
                        };
        2414  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2359   2415   
                                    sender.send(()).await.expect("receiver dropped early");
 2360   2416   
                                    result
 2361   2417   
                                }
 2362         -
                },
 2363         -
            )
        2418  +
                            })
 2364   2419   
                            .build_unchecked();
 2365   2420   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2366   2421   
                .await
 2367   2422   
                .expect("unable to make an HTTP request");
 2368         -
        assert!(receiver.recv().await.is_some());
 2369         -
    }
 2370         -
}
 2371         -
#[cfg(test)]
 2372         -
#[allow(unreachable_code, unused_variables)]
 2373         -
mod server_greeting_with_errors_test {
 2374         -
    /// Ensures that operations with errors successfully know how
 2375         -
    /// to deserialize a successful response. As of January 2021,
 2376         -
    /// server implementations are expected to respond with a
 2377         -
    /// JSON object regardless of if the output parameters are
 2378         -
    /// empty.
 2379         -
    /// Test ID: RestJsonGreetingWithErrors
 2380         -
    #[::tokio::test]
 2381         -
    async fn rest_json_greeting_with_errors_response() {
 2382         -
        let output = crate::output::GreetingWithErrorsOutput {
 2383         -
            greeting: ::std::option::Option::Some("Hello".to_owned()),
 2384         -
        };
 2385         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2386         -
        let http_response = output.into_response();
 2387         -
        ::pretty_assertions::assert_eq!(
 2388         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2389         -
            http_response.status()
 2390         -
        );
 2391         -
        let expected_headers = [("X-Greeting", "Hello")];
 2392         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2393         -
            http_response.headers(),
 2394         -
            expected_headers,
 2395         -
        ));
 2396         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2397         -
            .await
 2398         -
            .expect("unable to extract body to bytes");
 2399         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2400         -
            &body,
 2401         -
            "{}",
 2402         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2403         -
        ));
 2404         -
    }
 2405         -
    /// Parses simple JSON errors
 2406         -
    /// Test ID: RestJsonInvalidGreetingError
 2407         -
    #[::tokio::test]
 2408         -
    async fn rest_json_invalid_greeting_error_response() {
 2409         -
        let output = crate::error::InvalidGreeting {
 2410         -
            message: ::std::option::Option::Some("Hi".to_owned()),
 2411         -
        };
 2412         -
        let output = crate::error::GreetingWithErrorsError::InvalidGreeting(output);
 2413         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2414         -
        let http_response = output.into_response();
 2415   2423   
            ::pretty_assertions::assert_eq!(
 2416   2424   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 2417   2425   
                http_response.status()
 2418   2426   
            );
 2419         -
        let expected_headers = [
 2420         -
            ("Content-Type", "application/json"),
 2421         -
            ("X-Amzn-Errortype", "InvalidGreeting"),
 2422         -
        ];
 2423         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2424         -
            http_response.headers(),
 2425         -
            expected_headers,
 2426         -
        ));
 2427         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2428         -
            .await
 2429         -
            .expect("unable to extract body to bytes");
 2430         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2431         -
            &body,
 2432         -
            "{\n    \"Message\": \"Hi\"\n}",
 2433         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2434         -
        ));
 2435         -
    }
 2436         -
    /// Serializes a complex error with no message member
 2437         -
    /// Test ID: RestJsonComplexErrorWithNoMessage
 2438         -
    #[::tokio::test]
 2439         -
    async fn rest_json_complex_error_with_no_message_response() {
 2440         -
        let output = crate::error::ComplexError {
 2441         -
            header: ::std::option::Option::Some("Header".to_owned()),
 2442         -
            top_level: ::std::option::Option::Some("Top level".to_owned()),
 2443         -
            nested: ::std::option::Option::Some(crate::model::ComplexNestedErrorData {
 2444         -
                foo: ::std::option::Option::Some("bar".to_owned()),
 2445         -
            }),
 2446         -
        };
 2447         -
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
 2448         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2449         -
        let http_response = output.into_response();
 2450         -
        ::pretty_assertions::assert_eq!(
 2451         -
            http::StatusCode::from_u16(403).expect("invalid expected HTTP status code"),
 2452         -
            http_response.status()
 2453         -
        );
 2454         -
        let expected_headers = [
 2455         -
            ("Content-Type", "application/json"),
 2456         -
            ("X-Amzn-Errortype", "ComplexError"),
 2457         -
            ("X-Header", "Header"),
 2458         -
        ];
        2427  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 2459   2428   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2460   2429   
                http_response.headers(),
 2461   2430   
                expected_headers,
 2462   2431   
            ));
 2463         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2464         -
            .await
 2465         -
            .expect("unable to extract body to bytes");
 2466         -
        ::aws_smithy_protocol_test::assert_ok(
 2467         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"TopLevel\": \"Top level\",\n    \"Nested\": {\n        \"Fooooo\": \"bar\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 2468         -
        );
 2469   2432   
        }
 2470         -
    /// Test ID: RestJsonEmptyComplexErrorWithNoMessage
 2471         -
    #[::tokio::test]
 2472         -
    async fn rest_json_empty_complex_error_with_no_message_response() {
 2473         -
        let output = crate::error::ComplexError {
 2474         -
            header: ::std::option::Option::None,
 2475         -
            top_level: ::std::option::Option::None,
 2476         -
            nested: ::std::option::Option::None,
 2477         -
        };
 2478         -
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
 2479         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2480         -
        let http_response = output.into_response();
 2481         -
        ::pretty_assertions::assert_eq!(
 2482         -
            http::StatusCode::from_u16(403).expect("invalid expected HTTP status code"),
 2483         -
            http_response.status()
 2484         -
        );
 2485         -
        let expected_headers = [
 2486         -
            ("Content-Type", "application/json"),
 2487         -
            ("X-Amzn-Errortype", "ComplexError"),
 2488         -
        ];
 2489         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2490         -
            http_response.headers(),
 2491         -
            expected_headers,
 2492         -
        ));
 2493         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2494         -
            .await
 2495         -
            .expect("unable to extract body to bytes");
 2496         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2497         -
            &body,
 2498         -
            "{}",
 2499         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 2500         -
        ));
 2501   2433   
    }
 2502         -
}
 2503         -
#[cfg(test)]
 2504         -
#[allow(unreachable_code, unused_variables)]
 2505         -
mod server_http_checksum_required_test {
 2506         -
    /// Adds Content-MD5 header
 2507         -
    /// Test ID: RestJsonHttpChecksumRequired
        2434  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        2435  +
    /// 400 SerializationException
        2436  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case0
 2508   2437   
    #[::tokio::test]
 2509         -
    async fn rest_json_http_checksum_required_request() {
        2438  +
    #[::tracing_test::traced_test]
        2439  +
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
        2440  +
        {
 2510   2441   
            #[allow(unused_mut)]
 2511   2442   
            let mut http_request = http::Request::builder()
 2512         -
            .uri("/HttpChecksumRequired")
        2443  +
                .uri("/MalformedTimestampBodyDateTime")
 2513   2444   
                .method("POST")
 2514         -
            .header("Content-MD5", "iB0/3YSo7maijL0IGOgA9g==")
 2515         -
            .header("Content-Type", "application/json")
        2445  +
                .header("content-type", "application/json")
 2516   2446   
                .body(::aws_smithy_http_server::body::Body::from(
 2517         -
                ::bytes::Bytes::from_static(
 2518         -
                    "{\n    \"foo\":\"base64 encoded md5 checksum\"\n}\n".as_bytes(),
 2519         -
                ),
        2447  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
 2520   2448   
                ))
 2521   2449   
                .unwrap();
 2522   2450   
            #[allow(unused_mut)]
 2523   2451   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2524   2452   
            let config = crate::service::RestJsonConfig::builder().build();
 2525   2453   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2526         -
            .http_checksum_required(move |input: crate::input::HttpChecksumRequiredInput| {
        2454  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2527   2455   
                                let sender = sender.clone();
 2528   2456   
                                async move {
 2529         -
                    let result = {
 2530         -
                        let expected = crate::input::HttpChecksumRequiredInput {
 2531         -
                            foo: ::std::option::Option::Some(
 2532         -
                                "base64 encoded md5 checksum".to_owned(),
 2533         -
                            ),
 2534         -
                        };
 2535         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2536         -
                        let response = crate::output::HttpChecksumRequiredOutput {
 2537         -
                            foo: ::std::option::Option::None,
 2538         -
                        };
 2539         -
                        response
 2540         -
                    };
        2457  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2541   2458   
                                    sender.send(()).await.expect("receiver dropped early");
 2542   2459   
                                    result
 2543   2460   
                                }
 2544   2461   
                            })
 2545   2462   
                            .build_unchecked();
 2546   2463   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2547   2464   
                .await
 2548   2465   
                .expect("unable to make an HTTP request");
 2549         -
        assert!(receiver.recv().await.is_some());
        2466  +
            ::pretty_assertions::assert_eq!(
        2467  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2468  +
                http_response.status()
        2469  +
            );
        2470  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2471  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2472  +
                http_response.headers(),
        2473  +
                expected_headers,
        2474  +
            ));
 2550   2475   
        }
 2551         -
}
 2552         -
#[cfg(test)]
 2553         -
#[allow(unreachable_code, unused_variables)]
 2554         -
mod server_http_enum_payload_test {
 2555         -
    /// Test ID: RestJsonEnumPayloadRequest
        2476  +
    }
        2477  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        2478  +
    /// 400 SerializationException
        2479  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case1
 2556   2480   
    #[::tokio::test]
 2557         -
    #[should_panic]
 2558         -
    async fn rest_json_enum_payload_request_request() {
        2481  +
    #[::tracing_test::traced_test]
        2482  +
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
        2483  +
        {
 2559   2484   
            #[allow(unused_mut)]
 2560   2485   
            let mut http_request = http::Request::builder()
 2561         -
            .uri("/EnumPayload")
        2486  +
                .uri("/MalformedTimestampBodyDateTime")
 2562   2487   
                .method("POST")
        2488  +
                .header("content-type", "application/json")
 2563   2489   
                .body(::aws_smithy_http_server::body::Body::from(
 2564         -
                ::bytes::Bytes::from_static("enumvalue".as_bytes()),
        2490  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
 2565   2491   
                ))
 2566   2492   
                .unwrap();
 2567   2493   
            #[allow(unused_mut)]
 2568   2494   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2569   2495   
            let config = crate::service::RestJsonConfig::builder().build();
 2570   2496   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2571         -
            .http_enum_payload(move |input: crate::input::HttpEnumPayloadInput| {
        2497  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2572   2498   
                                let sender = sender.clone();
 2573   2499   
                                async move {
 2574         -
                    let result = {
 2575         -
                        let expected = crate::input::HttpEnumPayloadInput {
 2576         -
                            payload: ::std::option::Option::Some(
 2577         -
                                "enumvalue"
 2578         -
                                    .parse::<crate::model::StringEnum>()
 2579         -
                                    .expect("static value validated to member"),
 2580         -
                            ),
 2581         -
                        };
 2582         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2583         -
                        let response = crate::output::HttpEnumPayloadOutput {
 2584         -
                            payload: ::std::option::Option::None,
 2585         -
                        };
 2586         -
                        Ok(response)
 2587         -
                    };
        2500  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2588   2501   
                                    sender.send(()).await.expect("receiver dropped early");
 2589   2502   
                                    result
 2590   2503   
                                }
 2591   2504   
                            })
 2592   2505   
                            .build_unchecked();
 2593   2506   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2594   2507   
                .await
 2595   2508   
                .expect("unable to make an HTTP request");
 2596         -
        assert!(receiver.recv().await.is_some());
 2597         -
    }
 2598         -
    /// Test ID: RestJsonEnumPayloadResponse
 2599         -
    #[::tokio::test]
 2600         -
    async fn rest_json_enum_payload_response_response() {
 2601         -
        let output = crate::output::HttpEnumPayloadOutput {
 2602         -
            payload: ::std::option::Option::Some(
 2603         -
                "enumvalue"
 2604         -
                    .parse::<crate::model::StringEnum>()
 2605         -
                    .expect("static value validated to member"),
 2606         -
            ),
 2607         -
        };
 2608         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2609         -
        let http_response = output.into_response();
 2610   2509   
            ::pretty_assertions::assert_eq!(
 2611         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2510  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 2612   2511   
                http_response.status()
 2613   2512   
            );
 2614         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2615         -
            .await
 2616         -
            .expect("unable to extract body to bytes");
 2617         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2618         -
            &body,
 2619         -
            "enumvalue",
 2620         -
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
        2513  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2514  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2515  +
                http_response.headers(),
        2516  +
                expected_headers,
 2621   2517   
            ));
 2622   2518   
        }
 2623         -
}
 2624         -
#[cfg(test)]
 2625         -
#[allow(unreachable_code, unused_variables)]
 2626         -
mod server_http_payload_traits_test {
 2627         -
    /// Serializes a blob in the HTTP payload
 2628         -
    /// Test ID: RestJsonHttpPayloadTraitsWithBlob
        2519  +
    }
        2520  +
    /// When the format is date-time, RFC 3339 timestamps with a UTC offset are rejected with a
        2521  +
    /// 400 SerializationException
        2522  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsUTCOffsets_case0
 2629   2523   
    #[::tokio::test]
 2630         -
    async fn rest_json_http_payload_traits_with_blob_request() {
        2524  +
    #[::tracing_test::traced_test]
        2525  +
    async fn rest_json_body_timestamp_date_time_rejects_utc_offsets_case0_malformed_request() {
        2526  +
        {
 2631   2527   
            #[allow(unused_mut)]
 2632   2528   
            let mut http_request = http::Request::builder()
 2633         -
            .uri("/HttpPayloadTraits")
        2529  +
                .uri("/MalformedTimestampBodyDateTime")
 2634   2530   
                .method("POST")
 2635         -
            .header("Content-Type", "application/octet-stream")
 2636         -
            .header("X-Foo", "Foo")
        2531  +
                .header("content-type", "application/json")
 2637   2532   
                .body(::aws_smithy_http_server::body::Body::from(
 2638         -
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
        2533  +
                    ::bytes::Bytes::from_static(
        2534  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
        2535  +
                    ),
 2639   2536   
                ))
 2640   2537   
                .unwrap();
 2641   2538   
            #[allow(unused_mut)]
 2642   2539   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2643   2540   
            let config = crate::service::RestJsonConfig::builder().build();
 2644   2541   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2645         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
        2542  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2646   2543   
                                let sender = sender.clone();
 2647   2544   
                                async move {
 2648         -
                    let result = {
 2649         -
                        let expected = crate::input::HttpPayloadTraitsInput {
 2650         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
 2651         -
                            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
 2652         -
                                "blobby blob blob",
 2653         -
                            )),
 2654         -
                        };
 2655         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2656         -
                        let response = crate::output::HttpPayloadTraitsOutput {
 2657         -
                            foo: ::std::option::Option::None,
 2658         -
                            blob: ::std::option::Option::None,
 2659         -
                        };
 2660         -
                        response
 2661         -
                    };
        2545  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2662   2546   
                                    sender.send(()).await.expect("receiver dropped early");
 2663   2547   
                                    result
 2664   2548   
                                }
 2665   2549   
                            })
 2666   2550   
                            .build_unchecked();
 2667   2551   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2668   2552   
                .await
 2669   2553   
                .expect("unable to make an HTTP request");
 2670         -
        assert!(receiver.recv().await.is_some());
        2554  +
            ::pretty_assertions::assert_eq!(
        2555  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2556  +
                http_response.status()
        2557  +
            );
        2558  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2559  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2560  +
                http_response.headers(),
        2561  +
                expected_headers,
        2562  +
            ));
 2671   2563   
        }
 2672         -
    /// Serializes an empty blob in the HTTP payload
 2673         -
    /// Test ID: RestJsonHttpPayloadTraitsWithNoBlobBody
        2564  +
    }
        2565  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2566  +
    /// are rejected with a 400 SerializationException
        2567  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case0
 2674   2568   
    #[::tokio::test]
 2675         -
    async fn rest_json_http_payload_traits_with_no_blob_body_request() {
        2569  +
    #[::tracing_test::traced_test]
        2570  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
        2571  +
    ) {
        2572  +
        {
 2676   2573   
            #[allow(unused_mut)]
 2677   2574   
            let mut http_request = http::Request::builder()
 2678         -
            .uri("/HttpPayloadTraits")
        2575  +
                .uri("/MalformedTimestampBodyDateTime")
 2679   2576   
                .method("POST")
 2680         -
            .header("X-Foo", "Foo")
        2577  +
                .header("content-type", "application/json")
 2681   2578   
                .body(::aws_smithy_http_server::body::Body::from(
 2682         -
                ::bytes::Bytes::from_static("".as_bytes()),
        2579  +
                    ::bytes::Bytes::from_static(
        2580  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00\" }".as_bytes(),
        2581  +
                    ),
 2683   2582   
                ))
 2684   2583   
                .unwrap();
 2685   2584   
            #[allow(unused_mut)]
 2686   2585   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2687   2586   
            let config = crate::service::RestJsonConfig::builder().build();
 2688   2587   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2689         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
        2588  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2690   2589   
                                let sender = sender.clone();
 2691   2590   
                                async move {
 2692         -
                    let result = {
 2693         -
                        let expected = crate::input::HttpPayloadTraitsInput {
 2694         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
 2695         -
                            blob: ::std::option::Option::None,
 2696         -
                        };
 2697         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2698         -
                        let response = crate::output::HttpPayloadTraitsOutput {
 2699         -
                            foo: ::std::option::Option::None,
 2700         -
                            blob: ::std::option::Option::None,
 2701         -
                        };
 2702         -
                        response
 2703         -
                    };
        2591  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2704   2592   
                                    sender.send(()).await.expect("receiver dropped early");
 2705   2593   
                                    result
 2706   2594   
                                }
 2707   2595   
                            })
 2708   2596   
                            .build_unchecked();
 2709   2597   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2710   2598   
                .await
 2711   2599   
                .expect("unable to make an HTTP request");
 2712         -
        assert!(receiver.recv().await.is_some());
        2600  +
            ::pretty_assertions::assert_eq!(
        2601  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2602  +
                http_response.status()
        2603  +
            );
        2604  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2605  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2606  +
                http_response.headers(),
        2607  +
                expected_headers,
        2608  +
            ));
 2713   2609   
        }
 2714         -
    /// Servers must accept any content type for blob inputs
 2715         -
    /// without the media type trait.
 2716         -
    /// Test ID: RestJsonHttpPayloadTraitsWithBlobAcceptsAllContentTypes
        2610  +
    }
        2611  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2612  +
    /// are rejected with a 400 SerializationException
        2613  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case1
 2717   2614   
    #[::tokio::test]
 2718         -
    async fn rest_json_http_payload_traits_with_blob_accepts_all_content_types_request() {
        2615  +
    #[::tracing_test::traced_test]
        2616  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
        2617  +
    ) {
        2618  +
        {
 2719   2619   
            #[allow(unused_mut)]
 2720   2620   
            let mut http_request = http::Request::builder()
 2721         -
            .uri("/HttpPayloadTraits")
        2621  +
                .uri("/MalformedTimestampBodyDateTime")
 2722   2622   
                .method("POST")
 2723         -
            .header("Content-Type", "image/jpeg")
 2724         -
            .header("X-Foo", "Foo")
        2623  +
                .header("content-type", "application/json")
 2725   2624   
                .body(::aws_smithy_http_server::body::Body::from(
 2726         -
                ::bytes::Bytes::from_static("This is definitely a jpeg".as_bytes()),
        2625  +
                    ::bytes::Bytes::from_static(
        2626  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00Z\" }".as_bytes(),
        2627  +
                    ),
 2727   2628   
                ))
 2728   2629   
                .unwrap();
 2729   2630   
            #[allow(unused_mut)]
 2730   2631   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2731   2632   
            let config = crate::service::RestJsonConfig::builder().build();
 2732   2633   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2733         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
        2634  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2734   2635   
                                let sender = sender.clone();
 2735   2636   
                                async move {
 2736         -
                    let result = {
 2737         -
                        let expected = crate::input::HttpPayloadTraitsInput {
 2738         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
 2739         -
                            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
 2740         -
                                "This is definitely a jpeg",
 2741         -
                            )),
 2742         -
                        };
 2743         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2744         -
                        let response = crate::output::HttpPayloadTraitsOutput {
 2745         -
                            foo: ::std::option::Option::None,
 2746         -
                            blob: ::std::option::Option::None,
 2747         -
                        };
 2748         -
                        response
 2749         -
                    };
        2637  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2750   2638   
                                    sender.send(()).await.expect("receiver dropped early");
 2751   2639   
                                    result
 2752   2640   
                                }
 2753   2641   
                            })
 2754   2642   
                            .build_unchecked();
 2755   2643   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2756   2644   
                .await
 2757   2645   
                .expect("unable to make an HTTP request");
 2758         -
        assert!(receiver.recv().await.is_some());
        2646  +
            ::pretty_assertions::assert_eq!(
        2647  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2648  +
                http_response.status()
        2649  +
            );
        2650  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2651  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2652  +
                http_response.headers(),
        2653  +
                expected_headers,
        2654  +
            ));
 2759   2655   
        }
 2760         -
    /// Servers must accept any accept header for blob inputs
 2761         -
    /// without the media type trait.
 2762         -
    /// Test ID: RestJsonHttpPayloadTraitsWithBlobAcceptsAllAccepts
        2656  +
    }
        2657  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2658  +
    /// are rejected with a 400 SerializationException
        2659  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case2
 2763   2660   
    #[::tokio::test]
 2764         -
    async fn rest_json_http_payload_traits_with_blob_accepts_all_accepts_request() {
        2661  +
    #[::tracing_test::traced_test]
        2662  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
        2663  +
    ) {
        2664  +
        {
 2765   2665   
            #[allow(unused_mut)]
 2766   2666   
            let mut http_request = http::Request::builder()
 2767         -
            .uri("/HttpPayloadTraits")
        2667  +
                .uri("/MalformedTimestampBodyDateTime")
 2768   2668   
                .method("POST")
 2769         -
            .header("Accept", "image/jpeg")
 2770         -
            .header("X-Foo", "Foo")
        2669  +
                .header("content-type", "application/json")
 2771   2670   
                .body(::aws_smithy_http_server::body::Body::from(
 2772         -
                ::bytes::Bytes::from_static("This is definitely a jpeg".as_bytes()),
        2671  +
                    ::bytes::Bytes::from_static(
        2672  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57\" }".as_bytes(),
        2673  +
                    ),
 2773   2674   
                ))
 2774   2675   
                .unwrap();
 2775   2676   
            #[allow(unused_mut)]
 2776   2677   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2777   2678   
            let config = crate::service::RestJsonConfig::builder().build();
 2778   2679   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2779         -
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
        2680  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2780   2681   
                                let sender = sender.clone();
 2781   2682   
                                async move {
 2782         -
                    let result = {
 2783         -
                        let expected = crate::input::HttpPayloadTraitsInput {
 2784         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
 2785         -
                            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
 2786         -
                                "This is definitely a jpeg",
 2787         -
                            )),
 2788         -
                        };
 2789         -
                        ::pretty_assertions::assert_eq!(input, expected);
 2790         -
                        let response = crate::output::HttpPayloadTraitsOutput {
 2791         -
                            foo: ::std::option::Option::None,
 2792         -
                            blob: ::std::option::Option::None,
 2793         -
                        };
 2794         -
                        response
 2795         -
                    };
        2683  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2796   2684   
                                    sender.send(()).await.expect("receiver dropped early");
 2797   2685   
                                    result
 2798   2686   
                                }
 2799   2687   
                            })
 2800   2688   
                            .build_unchecked();
 2801   2689   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2802   2690   
                .await
 2803   2691   
                .expect("unable to make an HTTP request");
 2804         -
        assert!(receiver.recv().await.is_some());
 2805         -
    }
 2806         -
    /// Serializes a blob in the HTTP payload
 2807         -
    /// Test ID: RestJsonHttpPayloadTraitsWithBlob
 2808         -
    #[::tokio::test]
 2809         -
    async fn rest_json_http_payload_traits_with_blob_response() {
 2810         -
        let output = crate::output::HttpPayloadTraitsOutput {
 2811         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
 2812         -
            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")),
 2813         -
        };
 2814         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2815         -
        let http_response = output.into_response();
 2816   2692   
            ::pretty_assertions::assert_eq!(
 2817         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2693  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 2818   2694   
                http_response.status()
 2819   2695   
            );
 2820         -
        let expected_headers = [("X-Foo", "Foo")];
        2696  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 2821   2697   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2822   2698   
                http_response.headers(),
 2823   2699   
                expected_headers,
 2824   2700   
            ));
 2825         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2826         -
            .await
 2827         -
            .expect("unable to extract body to bytes");
 2828         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2829         -
            &body,
 2830         -
            "blobby blob blob",
 2831         -
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
 2832         -
        ));
 2833   2701   
        }
 2834         -
    /// Serializes an empty blob in the HTTP payload
 2835         -
    /// Test ID: RestJsonHttpPayloadTraitsWithNoBlobBody
 2836         -
    #[::tokio::test]
 2837         -
    async fn rest_json_http_payload_traits_with_no_blob_body_response() {
 2838         -
        let output = crate::output::HttpPayloadTraitsOutput {
 2839         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
 2840         -
            blob: ::std::option::Option::None,
 2841         -
        };
 2842         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2843         -
        let http_response = output.into_response();
 2844         -
        ::pretty_assertions::assert_eq!(
 2845         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 2846         -
            http_response.status()
 2847         -
        );
 2848         -
        let expected_headers = [("X-Foo", "Foo")];
 2849         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2850         -
            http_response.headers(),
 2851         -
            expected_headers,
 2852         -
        ));
 2853         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2854         -
            .await
 2855         -
            .expect("unable to extract body to bytes");
 2856         -
        // No body.
 2857         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
 2858   2702   
    }
 2859         -
}
 2860         -
#[cfg(test)]
 2861         -
#[allow(unreachable_code, unused_variables)]
 2862         -
mod server_http_payload_traits_with_media_type_test {
 2863         -
    /// Serializes a blob in the HTTP payload with a content-type
 2864         -
    /// Test ID: RestJsonHttpPayloadTraitsWithMediaTypeWithBlob
        2703  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2704  +
    /// are rejected with a 400 SerializationException
        2705  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case3
 2865   2706   
    #[::tokio::test]
 2866         -
    async fn rest_json_http_payload_traits_with_media_type_with_blob_request() {
        2707  +
    #[::tracing_test::traced_test]
        2708  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
        2709  +
    ) {
        2710  +
        {
 2867   2711   
            #[allow(unused_mut)]
 2868   2712   
            let mut http_request = http::Request::builder()
 2869         -
            .uri("/HttpPayloadTraitsWithMediaType")
        2713  +
                .uri("/MalformedTimestampBodyDateTime")
 2870   2714   
                .method("POST")
 2871         -
            .header("Content-Type", "text/plain")
 2872         -
            .header("X-Foo", "Foo")
        2715  +
                .header("content-type", "application/json")
 2873   2716   
                .body(::aws_smithy_http_server::body::Body::from(
 2874         -
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
        2717  +
                    ::bytes::Bytes::from_static(
        2718  +
                        "{ \"timestamp\": \"1996-12-19T163957\" }".as_bytes(),
        2719  +
                    ),
 2875   2720   
                ))
 2876   2721   
                .unwrap();
 2877   2722   
            #[allow(unused_mut)]
 2878   2723   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2879   2724   
            let config = crate::service::RestJsonConfig::builder().build();
 2880   2725   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2881         -
            .http_payload_traits_with_media_type(
 2882         -
                move |input: crate::input::HttpPayloadTraitsWithMediaTypeInput| {
        2726  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2883   2727   
                                let sender = sender.clone();
 2884   2728   
                                async move {
 2885         -
                        let result = {
 2886         -
                            let expected = crate::input::HttpPayloadTraitsWithMediaTypeInput {
 2887         -
                                foo: ::std::option::Option::Some("Foo".to_owned()),
 2888         -
                                blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
 2889         -
                                    "blobby blob blob",
 2890         -
                                )),
 2891         -
                            };
 2892         -
                            ::pretty_assertions::assert_eq!(input, expected);
 2893         -
                            let response = crate::output::HttpPayloadTraitsWithMediaTypeOutput {
 2894         -
                                foo: ::std::option::Option::None,
 2895         -
                                blob: ::std::option::Option::None,
 2896         -
                            };
 2897         -
                            response
 2898         -
                        };
        2729  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2899   2730   
                                    sender.send(()).await.expect("receiver dropped early");
 2900   2731   
                                    result
 2901   2732   
                                }
 2902         -
                },
 2903         -
            )
        2733  +
                            })
 2904   2734   
                            .build_unchecked();
 2905   2735   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2906   2736   
                .await
 2907   2737   
                .expect("unable to make an HTTP request");
 2908         -
        assert!(receiver.recv().await.is_some());
 2909         -
    }
 2910         -
    /// Serializes a blob in the HTTP payload with a content-type
 2911         -
    /// Test ID: RestJsonHttpPayloadTraitsWithMediaTypeWithBlob
 2912         -
    #[::tokio::test]
 2913         -
    async fn rest_json_http_payload_traits_with_media_type_with_blob_response() {
 2914         -
        let output = crate::output::HttpPayloadTraitsWithMediaTypeOutput {
 2915         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
 2916         -
            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")),
 2917         -
        };
 2918         -
        use ::aws_smithy_http_server::response::IntoResponse;
 2919         -
        let http_response = output.into_response();
 2920   2738   
            ::pretty_assertions::assert_eq!(
 2921         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2739  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 2922   2740   
                http_response.status()
 2923   2741   
            );
 2924         -
        let expected_headers = [("Content-Type", "text/plain"), ("X-Foo", "Foo")];
        2742  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 2925   2743   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 2926   2744   
                http_response.headers(),
 2927   2745   
                expected_headers,
 2928   2746   
            ));
 2929         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 2930         -
            .await
 2931         -
            .expect("unable to extract body to bytes");
 2932         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 2933         -
            &body,
 2934         -
            "blobby blob blob",
 2935         -
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
 2936         -
        ));
 2937   2747   
        }
 2938         -
}
 2939         -
#[cfg(test)]
 2940         -
#[allow(unreachable_code, unused_variables)]
 2941         -
mod server_http_payload_with_structure_test {
 2942         -
    /// Serializes a structure in the payload
 2943         -
    /// Test ID: RestJsonHttpPayloadWithStructure
        2748  +
    }
        2749  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2750  +
    /// are rejected with a 400 SerializationException
        2751  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case4
 2944   2752   
    #[::tokio::test]
 2945         -
    async fn rest_json_http_payload_with_structure_request() {
        2753  +
    #[::tracing_test::traced_test]
        2754  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
        2755  +
    ) {
        2756  +
        {
 2946   2757   
            #[allow(unused_mut)]
 2947   2758   
            let mut http_request = http::Request::builder()
 2948         -
            .uri("/HttpPayloadWithStructure")
 2949         -
            .method("PUT")
 2950         -
            .header("Content-Type", "application/json")
        2759  +
                .uri("/MalformedTimestampBodyDateTime")
        2760  +
                .method("POST")
        2761  +
                .header("content-type", "application/json")
 2951   2762   
                .body(::aws_smithy_http_server::body::Body::from(
 2952   2763   
                    ::bytes::Bytes::from_static(
 2953         -
                    "{\n    \"greeting\": \"hello\",\n    \"name\": \"Phreddy\"\n}".as_bytes(),
        2764  +
                        "{ \"timestamp\": \"19961219T163957Z\" }".as_bytes(),
 2954   2765   
                    ),
 2955   2766   
                ))
 2956   2767   
                .unwrap();
 2957   2768   
            #[allow(unused_mut)]
 2958   2769   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 2959   2770   
            let config = crate::service::RestJsonConfig::builder().build();
 2960   2771   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 2961         -
            .http_payload_with_structure(
 2962         -
                move |input: crate::input::HttpPayloadWithStructureInput| {
        2772  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 2963   2773   
                                let sender = sender.clone();
 2964   2774   
                                async move {
 2965         -
                        let result = {
 2966         -
                            let expected = crate::input::HttpPayloadWithStructureInput {
 2967         -
                                nested: ::std::option::Option::Some(crate::model::NestedPayload {
 2968         -
                                    greeting: ::std::option::Option::Some("hello".to_owned()),
 2969         -
                                    name: ::std::option::Option::Some("Phreddy".to_owned()),
 2970         -
                                }),
 2971         -
                            };
 2972         -
                            ::pretty_assertions::assert_eq!(input, expected);
 2973         -
                            let response = crate::output::HttpPayloadWithStructureOutput {
 2974         -
                                nested: ::std::option::Option::Some(crate::model::NestedPayload {
 2975         -
                                    greeting: ::std::option::Option::None,
 2976         -
                                    name: ::std::option::Option::None,
 2977         -
                                }),
 2978         -
                            };
 2979         -
                            response
 2980         -
                        };
        2775  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 2981   2776   
                                    sender.send(()).await.expect("receiver dropped early");
 2982   2777   
                                    result
 2983   2778   
                                }
 2984         -
                },
 2985         -
            )
        2779  +
                            })
 2986   2780   
                            .build_unchecked();
 2987   2781   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 2988   2782   
                .await
 2989   2783   
                .expect("unable to make an HTTP request");
 2990         -
        assert!(receiver.recv().await.is_some());
 2991         -
    }
 2992         -
    /// Serializes a structure in the payload
 2993         -
    /// Test ID: RestJsonHttpPayloadWithStructure
 2994         -
    #[::tokio::test]
 2995         -
    async fn rest_json_http_payload_with_structure_response() {
 2996         -
        let output = crate::output::HttpPayloadWithStructureOutput {
 2997         -
            nested: ::std::option::Option::Some(crate::model::NestedPayload {
 2998         -
                greeting: ::std::option::Option::Some("hello".to_owned()),
 2999         -
                name: ::std::option::Option::Some("Phreddy".to_owned()),
 3000         -
            }),
 3001         -
        };
 3002         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3003         -
        let http_response = output.into_response();
 3004   2784   
            ::pretty_assertions::assert_eq!(
 3005         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2785  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 3006   2786   
                http_response.status()
 3007   2787   
            );
 3008         -
        let expected_headers = [("Content-Type", "application/json")];
        2788  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 3009   2789   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3010   2790   
                http_response.headers(),
 3011   2791   
                expected_headers,
 3012   2792   
            ));
 3013         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 3014         -
            .await
 3015         -
            .expect("unable to extract body to bytes");
 3016         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 3017         -
            &body,
 3018         -
            "{\n    \"greeting\": \"hello\",\n    \"name\": \"Phreddy\"\n}",
 3019         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3020         -
        ));
 3021   2793   
        }
 3022         -
}
 3023         -
#[cfg(test)]
 3024         -
#[allow(unreachable_code, unused_variables)]
 3025         -
mod server_http_payload_with_union_test {
 3026         -
    /// Serializes a union in the payload.
 3027         -
    /// Test ID: RestJsonHttpPayloadWithUnion
        2794  +
    }
        2795  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2796  +
    /// are rejected with a 400 SerializationException
        2797  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case5
 3028   2798   
    #[::tokio::test]
 3029         -
    async fn rest_json_http_payload_with_union_request() {
        2799  +
    #[::tracing_test::traced_test]
        2800  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
        2801  +
    ) {
        2802  +
        {
 3030   2803   
            #[allow(unused_mut)]
 3031   2804   
            let mut http_request = http::Request::builder()
 3032         -
            .uri("/HttpPayloadWithUnion")
 3033         -
            .method("PUT")
 3034         -
            .header("Content-Type", "application/json")
        2805  +
                .uri("/MalformedTimestampBodyDateTime")
        2806  +
                .method("POST")
        2807  +
                .header("content-type", "application/json")
 3035   2808   
                .body(::aws_smithy_http_server::body::Body::from(
 3036         -
                ::bytes::Bytes::from_static("{\n    \"greeting\": \"hello\"\n}".as_bytes()),
        2809  +
                    ::bytes::Bytes::from_static(
        2810  +
                        "{ \"timestamp\": \"19961219T163957\" }".as_bytes(),
        2811  +
                    ),
 3037   2812   
                ))
 3038   2813   
                .unwrap();
 3039   2814   
            #[allow(unused_mut)]
 3040   2815   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3041   2816   
            let config = crate::service::RestJsonConfig::builder().build();
 3042   2817   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3043         -
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
        2818  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3044   2819   
                                let sender = sender.clone();
 3045   2820   
                                async move {
 3046         -
                    let result = {
 3047         -
                        let expected = crate::input::HttpPayloadWithUnionInput {
 3048         -
                            nested: ::std::option::Option::Some(
 3049         -
                                crate::model::UnionPayload::Greeting("hello".to_owned()),
 3050         -
                            ),
 3051         -
                        };
 3052         -
                        ::pretty_assertions::assert_eq!(input, expected);
 3053         -
                        let response = crate::output::HttpPayloadWithUnionOutput {
 3054         -
                            nested: ::std::option::Option::None,
 3055         -
                        };
 3056         -
                        response
 3057         -
                    };
        2821  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3058   2822   
                                    sender.send(()).await.expect("receiver dropped early");
 3059   2823   
                                    result
 3060   2824   
                                }
 3061   2825   
                            })
 3062   2826   
                            .build_unchecked();
 3063   2827   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3064   2828   
                .await
 3065   2829   
                .expect("unable to make an HTTP request");
 3066         -
        assert!(receiver.recv().await.is_some());
        2830  +
            ::pretty_assertions::assert_eq!(
        2831  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2832  +
                http_response.status()
        2833  +
            );
        2834  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2835  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2836  +
                http_response.headers(),
        2837  +
                expected_headers,
        2838  +
            ));
 3067   2839   
        }
 3068         -
    /// No payload is sent if the union has no value.
 3069         -
    /// Test ID: RestJsonHttpPayloadWithUnsetUnion
        2840  +
    }
        2841  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2842  +
    /// are rejected with a 400 SerializationException
        2843  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case6
 3070   2844   
    #[::tokio::test]
 3071         -
    async fn rest_json_http_payload_with_unset_union_request() {
        2845  +
    #[::tracing_test::traced_test]
        2846  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
        2847  +
    ) {
        2848  +
        {
 3072   2849   
            #[allow(unused_mut)]
 3073   2850   
            let mut http_request = http::Request::builder()
 3074         -
            .uri("/HttpPayloadWithUnion")
 3075         -
            .method("PUT")
        2851  +
                .uri("/MalformedTimestampBodyDateTime")
        2852  +
                .method("POST")
        2853  +
                .header("content-type", "application/json")
 3076   2854   
                .body(::aws_smithy_http_server::body::Body::from(
 3077         -
                ::bytes::Bytes::from_static("".as_bytes()),
        2855  +
                    ::bytes::Bytes::from_static(
        2856  +
                        "{ \"timestamp\": \"19961219T16:39:57Z\" }".as_bytes(),
        2857  +
                    ),
 3078   2858   
                ))
 3079   2859   
                .unwrap();
 3080   2860   
            #[allow(unused_mut)]
 3081   2861   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3082   2862   
            let config = crate::service::RestJsonConfig::builder().build();
 3083   2863   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3084         -
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
        2864  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3085   2865   
                                let sender = sender.clone();
 3086   2866   
                                async move {
 3087         -
                    let result = {
 3088         -
                        let expected = crate::input::HttpPayloadWithUnionInput {
 3089         -
                            nested: ::std::option::Option::None,
 3090         -
                        };
 3091         -
                        ::pretty_assertions::assert_eq!(input, expected);
 3092         -
                        let response = crate::output::HttpPayloadWithUnionOutput {
 3093         -
                            nested: ::std::option::Option::None,
 3094         -
                        };
 3095         -
                        response
 3096         -
                    };
        2867  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3097   2868   
                                    sender.send(()).await.expect("receiver dropped early");
 3098   2869   
                                    result
 3099   2870   
                                }
 3100   2871   
                            })
 3101   2872   
                            .build_unchecked();
 3102   2873   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3103   2874   
                .await
 3104   2875   
                .expect("unable to make an HTTP request");
 3105         -
        assert!(receiver.recv().await.is_some());
 3106         -
    }
 3107         -
    /// Serializes a union in the payload.
 3108         -
    /// Test ID: RestJsonHttpPayloadWithUnion
 3109         -
    #[::tokio::test]
 3110         -
    async fn rest_json_http_payload_with_union_response() {
 3111         -
        let output = crate::output::HttpPayloadWithUnionOutput {
 3112         -
            nested: ::std::option::Option::Some(crate::model::UnionPayload::Greeting(
 3113         -
                "hello".to_owned(),
 3114         -
            )),
 3115         -
        };
 3116         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3117         -
        let http_response = output.into_response();
 3118   2876   
            ::pretty_assertions::assert_eq!(
 3119         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2877  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 3120   2878   
                http_response.status()
 3121   2879   
            );
 3122         -
        let expected_headers = [("Content-Type", "application/json")];
        2880  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 3123   2881   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3124   2882   
                http_response.headers(),
 3125   2883   
                expected_headers,
 3126   2884   
            ));
 3127         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 3128         -
            .await
 3129         -
            .expect("unable to extract body to bytes");
 3130         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 3131         -
            &body,
 3132         -
            "{\n    \"greeting\": \"hello\"\n}",
 3133         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3134         -
        ));
 3135   2885   
        }
 3136         -
    /// No payload is sent if the union has no value.
 3137         -
    /// Test ID: RestJsonHttpPayloadWithUnsetUnion
 3138         -
    #[::tokio::test]
 3139         -
    async fn rest_json_http_payload_with_unset_union_response() {
 3140         -
        let output = crate::output::HttpPayloadWithUnionOutput {
 3141         -
            nested: ::std::option::Option::None,
 3142         -
        };
 3143         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3144         -
        let http_response = output.into_response();
 3145         -
        ::pretty_assertions::assert_eq!(
 3146         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3147         -
            http_response.status()
 3148         -
        );
 3149         -
        let expected_headers = [("Content-Length", "0")];
 3150         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3151         -
            http_response.headers(),
 3152         -
            expected_headers,
 3153         -
        ));
 3154         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 3155         -
            .await
 3156         -
            .expect("unable to extract body to bytes");
 3157         -
        // No body.
 3158         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
 3159   2886   
    }
 3160         -
}
 3161         -
#[cfg(test)]
 3162         -
#[allow(unreachable_code, unused_variables)]
 3163         -
mod server_http_prefix_headers_test {
 3164         -
    /// Adds headers by prefix
 3165         -
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
        2887  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2888  +
    /// are rejected with a 400 SerializationException
        2889  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case7
 3166   2890   
    #[::tokio::test]
 3167         -
    async fn rest_json_http_prefix_headers_are_present_request() {
        2891  +
    #[::tracing_test::traced_test]
        2892  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
        2893  +
    ) {
        2894  +
        {
 3168   2895   
            #[allow(unused_mut)]
 3169   2896   
            let mut http_request = http::Request::builder()
 3170         -
            .uri("/HttpPrefixHeaders")
 3171         -
            .method("GET")
 3172         -
            .header("X-Foo", "Foo")
 3173         -
            .header("X-Foo-Abc", "Abc value")
 3174         -
            .header("X-Foo-Def", "Def value")
        2897  +
                .uri("/MalformedTimestampBodyDateTime")
        2898  +
                .method("POST")
        2899  +
                .header("content-type", "application/json")
 3175   2900   
                .body(::aws_smithy_http_server::body::Body::from(
 3176         -
                ::bytes::Bytes::from_static("".as_bytes()),
        2901  +
                    ::bytes::Bytes::from_static(
        2902  +
                        "{ \"timestamp\": \"19961219T16:39:57\" }".as_bytes(),
        2903  +
                    ),
 3177   2904   
                ))
 3178   2905   
                .unwrap();
 3179   2906   
            #[allow(unused_mut)]
 3180   2907   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3181   2908   
            let config = crate::service::RestJsonConfig::builder().build();
 3182   2909   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3183         -
            .http_prefix_headers(move |input: crate::input::HttpPrefixHeadersInput| {
        2910  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3184   2911   
                                let sender = sender.clone();
 3185   2912   
                                async move {
 3186         -
                    let result = {
 3187         -
                        let expected = crate::input::HttpPrefixHeadersInput {
 3188         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
 3189         -
                            foo_map: ::std::option::Option::Some({
 3190         -
                                let mut ret = ::std::collections::HashMap::new();
 3191         -
                                ret.insert(
 3192         -
                                    "Abc".to_owned().to_ascii_lowercase(),
 3193         -
                                    "Abc value".to_owned(),
 3194         -
                                );
 3195         -
                                ret.insert(
 3196         -
                                    "Def".to_owned().to_ascii_lowercase(),
 3197         -
                                    "Def value".to_owned(),
 3198         -
                                );
 3199         -
                                ret
 3200         -
                            }),
 3201         -
                        };
 3202         -
                        ::pretty_assertions::assert_eq!(input, expected);
 3203         -
                        let response = crate::output::HttpPrefixHeadersOutput {
 3204         -
                            foo: ::std::option::Option::None,
 3205         -
                            foo_map: ::std::option::Option::None,
 3206         -
                        };
 3207         -
                        response
 3208         -
                    };
        2913  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3209   2914   
                                    sender.send(()).await.expect("receiver dropped early");
 3210   2915   
                                    result
 3211   2916   
                                }
 3212   2917   
                            })
 3213   2918   
                            .build_unchecked();
 3214   2919   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3215   2920   
                .await
 3216   2921   
                .expect("unable to make an HTTP request");
 3217         -
        assert!(receiver.recv().await.is_some());
 3218         -
    }
 3219         -
    /// Adds headers by prefix
 3220         -
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
 3221         -
    #[::tokio::test]
 3222         -
    async fn rest_json_http_prefix_headers_are_present_response() {
 3223         -
        let output = crate::output::HttpPrefixHeadersOutput {
 3224         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
 3225         -
            foo_map: ::std::option::Option::Some({
 3226         -
                let mut ret = ::std::collections::HashMap::new();
 3227         -
                ret.insert(
 3228         -
                    "Abc".to_owned().to_ascii_lowercase(),
 3229         -
                    "Abc value".to_owned(),
 3230         -
                );
 3231         -
                ret.insert(
 3232         -
                    "Def".to_owned().to_ascii_lowercase(),
 3233         -
                    "Def value".to_owned(),
 3234         -
                );
 3235         -
                ret
 3236         -
            }),
 3237         -
        };
 3238         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3239         -
        let http_response = output.into_response();
 3240   2922   
            ::pretty_assertions::assert_eq!(
 3241         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        2923  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 3242   2924   
                http_response.status()
 3243   2925   
            );
 3244         -
        let expected_headers = [
 3245         -
            ("X-Foo", "Foo"),
 3246         -
            ("X-Foo-Abc", "Abc value"),
 3247         -
            ("X-Foo-Def", "Def value"),
 3248         -
        ];
        2926  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 3249   2927   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3250   2928   
                http_response.headers(),
 3251   2929   
                expected_headers,
 3252   2930   
            ));
 3253   2931   
        }
 3254         -
}
 3255         -
#[cfg(test)]
 3256         -
#[allow(unreachable_code, unused_variables)]
 3257         -
mod server_http_prefix_headers_in_response_test {
 3258         -
    /// (de)serializes all response headers
 3259         -
    /// Test ID: HttpPrefixHeadersResponse
 3260         -
    #[::tokio::test]
 3261         -
    async fn http_prefix_headers_response_response() {
 3262         -
        let output = crate::output::HttpPrefixHeadersInResponseOutput {
 3263         -
            prefix_headers: ::std::option::Option::Some({
 3264         -
                let mut ret = ::std::collections::HashMap::new();
 3265         -
                ret.insert("X-Foo".to_owned().to_ascii_lowercase(), "Foo".to_owned());
 3266         -
                ret.insert("Hello".to_owned().to_ascii_lowercase(), "Hello".to_owned());
 3267         -
                ret
 3268         -
            }),
 3269         -
        };
 3270         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3271         -
        let http_response = output.into_response();
 3272         -
        ::pretty_assertions::assert_eq!(
 3273         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3274         -
            http_response.status()
 3275         -
        );
 3276         -
        let expected_headers = [("Hello", "Hello"), ("X-Foo", "Foo")];
 3277         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3278         -
            http_response.headers(),
 3279         -
            expected_headers,
 3280         -
        ));
 3281   2932   
    }
 3282         -
}
 3283         -
#[cfg(test)]
 3284         -
#[allow(unreachable_code, unused_variables)]
 3285         -
mod server_http_request_with_float_labels_test {
 3286         -
    /// Supports handling NaN float label values.
 3287         -
    /// Test ID: RestJsonSupportsNaNFloatLabels
        2933  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2934  +
    /// are rejected with a 400 SerializationException
        2935  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case8
 3288   2936   
    #[::tokio::test]
 3289         -
    async fn rest_json_supports_na_n_float_labels_request() {
        2937  +
    #[::tracing_test::traced_test]
        2938  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
        2939  +
    ) {
        2940  +
        {
 3290   2941   
            #[allow(unused_mut)]
 3291   2942   
            let mut http_request = http::Request::builder()
 3292         -
            .uri("/FloatHttpLabels/NaN/NaN")
 3293         -
            .method("GET")
        2943  +
                .uri("/MalformedTimestampBodyDateTime")
        2944  +
                .method("POST")
        2945  +
                .header("content-type", "application/json")
 3294   2946   
                .body(::aws_smithy_http_server::body::Body::from(
 3295         -
                ::bytes::Bytes::from_static("".as_bytes()),
        2947  +
                    ::bytes::Bytes::from_static(
        2948  +
                        "{ \"timestamp\": \"1996-12-19T16:39Z\" }".as_bytes(),
        2949  +
                    ),
 3296   2950   
                ))
 3297   2951   
                .unwrap();
 3298   2952   
            #[allow(unused_mut)]
 3299   2953   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3300   2954   
            let config = crate::service::RestJsonConfig::builder().build();
 3301   2955   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3302         -
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
        2956  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3303   2957   
                                let sender = sender.clone();
 3304   2958   
                                async move {
 3305         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 3306         -
        let expected =
 3307         -
            crate::input::HttpRequestWithFloatLabelsInput {
 3308         -
                float:
 3309         -
                    <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
 3310         -
                ,
 3311         -
                double:
 3312         -
                    <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
 3313         -
                ,
 3314         -
            }
 3315         -
        ;
 3316         -
        assert!(input.float.float_equals(&expected.float),
 3317         -
                                            "Unexpected value for `float` {:?} vs. {:?}", expected.float, input.float);
 3318         -
        assert!(input.double.float_equals(&expected.double),
 3319         -
                                            "Unexpected value for `double` {:?} vs. {:?}", expected.double, input.double);
 3320         -
        let response =
 3321         -
            crate::output::HttpRequestWithFloatLabelsOutput {
 3322         -
            }
 3323         -
        ;
 3324         -
        Ok(response) };
        2959  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3325   2960   
                                    sender.send(()).await.expect("receiver dropped early");
 3326   2961   
                                    result
 3327   2962   
                                }
 3328   2963   
                            })
 3329   2964   
                            .build_unchecked();
 3330   2965   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3331   2966   
                .await
 3332   2967   
                .expect("unable to make an HTTP request");
 3333         -
        assert!(receiver.recv().await.is_some());
        2968  +
            ::pretty_assertions::assert_eq!(
        2969  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        2970  +
                http_response.status()
        2971  +
            );
        2972  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        2973  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        2974  +
                http_response.headers(),
        2975  +
                expected_headers,
        2976  +
            ));
 3334   2977   
        }
 3335         -
    /// Supports handling Infinity float label values.
 3336         -
    /// Test ID: RestJsonSupportsInfinityFloatLabels
        2978  +
    }
        2979  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        2980  +
    /// are rejected with a 400 SerializationException
        2981  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case9
 3337   2982   
    #[::tokio::test]
 3338         -
    async fn rest_json_supports_infinity_float_labels_request() {
        2983  +
    #[::tracing_test::traced_test]
        2984  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
        2985  +
    ) {
        2986  +
        {
 3339   2987   
            #[allow(unused_mut)]
 3340   2988   
            let mut http_request = http::Request::builder()
 3341         -
            .uri("/FloatHttpLabels/Infinity/Infinity")
 3342         -
            .method("GET")
        2989  +
                .uri("/MalformedTimestampBodyDateTime")
        2990  +
                .method("POST")
        2991  +
                .header("content-type", "application/json")
 3343   2992   
                .body(::aws_smithy_http_server::body::Body::from(
 3344         -
                ::bytes::Bytes::from_static("".as_bytes()),
        2993  +
                    ::bytes::Bytes::from_static(
        2994  +
                        "{ \"timestamp\": \"1996-12-19T16:39\" }".as_bytes(),
        2995  +
                    ),
 3345   2996   
                ))
 3346   2997   
                .unwrap();
 3347   2998   
            #[allow(unused_mut)]
 3348   2999   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3349   3000   
            let config = crate::service::RestJsonConfig::builder().build();
 3350   3001   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3351         -
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
        3002  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3352   3003   
                                let sender = sender.clone();
 3353   3004   
                                async move {
 3354         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 3355         -
        let expected =
 3356         -
            crate::input::HttpRequestWithFloatLabelsInput {
 3357         -
                float:
 3358         -
                    <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
 3359         -
                ,
 3360         -
                double:
 3361         -
                    <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
 3362         -
                ,
 3363         -
            }
 3364         -
        ;
 3365         -
        assert!(input.float.float_equals(&expected.float),
 3366         -
                                            "Unexpected value for `float` {:?} vs. {:?}", expected.float, input.float);
 3367         -
        assert!(input.double.float_equals(&expected.double),
 3368         -
                                            "Unexpected value for `double` {:?} vs. {:?}", expected.double, input.double);
 3369         -
        let response =
 3370         -
            crate::output::HttpRequestWithFloatLabelsOutput {
 3371         -
            }
 3372         -
        ;
 3373         -
        Ok(response) };
        3005  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3374   3006   
                                    sender.send(()).await.expect("receiver dropped early");
 3375   3007   
                                    result
 3376   3008   
                                }
 3377   3009   
                            })
 3378   3010   
                            .build_unchecked();
 3379   3011   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3380   3012   
                .await
 3381   3013   
                .expect("unable to make an HTTP request");
 3382         -
        assert!(receiver.recv().await.is_some());
        3014  +
            ::pretty_assertions::assert_eq!(
        3015  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3016  +
                http_response.status()
        3017  +
            );
        3018  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3019  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3020  +
                http_response.headers(),
        3021  +
                expected_headers,
        3022  +
            ));
 3383   3023   
        }
 3384         -
    /// Supports handling -Infinity float label values.
 3385         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatLabels
        3024  +
    }
        3025  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        3026  +
    /// are rejected with a 400 SerializationException
        3027  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case10
 3386   3028   
    #[::tokio::test]
 3387         -
    async fn rest_json_supports_negative_infinity_float_labels_request() {
        3029  +
    #[::tracing_test::traced_test]
        3030  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
        3031  +
    ) {
        3032  +
        {
 3388   3033   
            #[allow(unused_mut)]
 3389   3034   
            let mut http_request = http::Request::builder()
 3390         -
            .uri("/FloatHttpLabels/-Infinity/-Infinity")
 3391         -
            .method("GET")
        3035  +
                .uri("/MalformedTimestampBodyDateTime")
        3036  +
                .method("POST")
        3037  +
                .header("content-type", "application/json")
 3392   3038   
                .body(::aws_smithy_http_server::body::Body::from(
 3393         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3039  +
                    ::bytes::Bytes::from_static(
        3040  +
                        "{ \"timestamp\": \"1996-12-19T1639\" }".as_bytes(),
        3041  +
                    ),
 3394   3042   
                ))
 3395   3043   
                .unwrap();
 3396   3044   
            #[allow(unused_mut)]
 3397   3045   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3398   3046   
            let config = crate::service::RestJsonConfig::builder().build();
 3399   3047   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3400         -
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
        3048  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3401   3049   
                                let sender = sender.clone();
 3402   3050   
                                async move {
 3403         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 3404         -
        let expected =
 3405         -
            crate::input::HttpRequestWithFloatLabelsInput {
 3406         -
                float:
 3407         -
                    <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
 3408         -
                ,
 3409         -
                double:
 3410         -
                    <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
 3411         -
                ,
 3412         -
            }
 3413         -
        ;
 3414         -
        assert!(input.float.float_equals(&expected.float),
 3415         -
                                            "Unexpected value for `float` {:?} vs. {:?}", expected.float, input.float);
 3416         -
        assert!(input.double.float_equals(&expected.double),
 3417         -
                                            "Unexpected value for `double` {:?} vs. {:?}", expected.double, input.double);
 3418         -
        let response =
 3419         -
            crate::output::HttpRequestWithFloatLabelsOutput {
 3420         -
            }
 3421         -
        ;
 3422         -
        Ok(response) };
        3051  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3423   3052   
                                    sender.send(()).await.expect("receiver dropped early");
 3424   3053   
                                    result
 3425   3054   
                                }
 3426   3055   
                            })
 3427   3056   
                            .build_unchecked();
 3428   3057   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3429   3058   
                .await
 3430   3059   
                .expect("unable to make an HTTP request");
 3431         -
        assert!(receiver.recv().await.is_some());
        3060  +
            ::pretty_assertions::assert_eq!(
        3061  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3062  +
                http_response.status()
        3063  +
            );
        3064  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3065  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3066  +
                http_response.headers(),
        3067  +
                expected_headers,
        3068  +
            ));
 3432   3069   
        }
 3433         -
}
 3434         -
#[cfg(test)]
 3435         -
#[allow(unreachable_code, unused_variables)]
 3436         -
mod server_http_request_with_greedy_label_in_path_test {
 3437         -
    /// Serializes greedy labels and normal labels
 3438         -
    /// Test ID: RestJsonHttpRequestWithGreedyLabelInPath
        3070  +
    }
        3071  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        3072  +
    /// are rejected with a 400 SerializationException
        3073  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case11
 3439   3074   
    #[::tokio::test]
 3440         -
    async fn rest_json_http_request_with_greedy_label_in_path_request() {
        3075  +
    #[::tracing_test::traced_test]
        3076  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
        3077  +
    ) {
        3078  +
        {
 3441   3079   
            #[allow(unused_mut)]
 3442   3080   
            let mut http_request = http::Request::builder()
 3443         -
            .uri("/HttpRequestWithGreedyLabelInPath/foo/hello%2Fescape/baz/there/guy")
 3444         -
            .method("GET")
        3081  +
                .uri("/MalformedTimestampBodyDateTime")
        3082  +
                .method("POST")
        3083  +
                .header("content-type", "application/json")
 3445   3084   
                .body(::aws_smithy_http_server::body::Body::from(
 3446         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3085  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16Z\" }".as_bytes()),
 3447   3086   
                ))
 3448   3087   
                .unwrap();
 3449   3088   
            #[allow(unused_mut)]
 3450   3089   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3451   3090   
            let config = crate::service::RestJsonConfig::builder().build();
 3452   3091   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3453         -
            .http_request_with_greedy_label_in_path(
 3454         -
                move |input: crate::input::HttpRequestWithGreedyLabelInPathInput| {
        3092  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3455   3093   
                                let sender = sender.clone();
 3456   3094   
                                async move {
 3457         -
                        let result = {
 3458         -
                            let expected = crate::input::HttpRequestWithGreedyLabelInPathInput {
 3459         -
                                foo: "hello/escape".to_owned(),
 3460         -
                                baz: "there/guy".to_owned(),
 3461         -
                            };
 3462         -
                            ::pretty_assertions::assert_eq!(input, expected);
 3463         -
                            let response = crate::output::HttpRequestWithGreedyLabelInPathOutput {};
 3464         -
                            Ok(response)
 3465         -
                        };
        3095  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3466   3096   
                                    sender.send(()).await.expect("receiver dropped early");
 3467   3097   
                                    result
 3468   3098   
                                }
 3469         -
                },
 3470         -
            )
        3099  +
                            })
 3471   3100   
                            .build_unchecked();
 3472   3101   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3473   3102   
                .await
 3474   3103   
                .expect("unable to make an HTTP request");
 3475         -
        assert!(receiver.recv().await.is_some());
        3104  +
            ::pretty_assertions::assert_eq!(
        3105  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3106  +
                http_response.status()
        3107  +
            );
        3108  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3109  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3110  +
                http_response.headers(),
        3111  +
                expected_headers,
        3112  +
            ));
 3476   3113   
        }
 3477         -
}
 3478         -
#[cfg(test)]
 3479         -
#[allow(unreachable_code, unused_variables)]
 3480         -
mod server_http_request_with_labels_test {
 3481         -
    /// Sends a GET request that uses URI label bindings
 3482         -
    /// Test ID: RestJsonInputWithHeadersAndAllParams
        3114  +
    }
        3115  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        3116  +
    /// are rejected with a 400 SerializationException
        3117  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case12
 3483   3118   
    #[::tokio::test]
 3484         -
    async fn rest_json_input_with_headers_and_all_params_request() {
        3119  +
    #[::tracing_test::traced_test]
        3120  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
        3121  +
    ) {
        3122  +
        {
 3485   3123   
            #[allow(unused_mut)]
 3486   3124   
            let mut http_request = http::Request::builder()
 3487         -
            .uri("/HttpRequestWithLabels/string/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z")
 3488         -
            .method("GET")
        3125  +
                .uri("/MalformedTimestampBodyDateTime")
        3126  +
                .method("POST")
        3127  +
                .header("content-type", "application/json")
 3489   3128   
                .body(::aws_smithy_http_server::body::Body::from(
 3490         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3129  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16\" }".as_bytes()),
 3491   3130   
                ))
 3492   3131   
                .unwrap();
 3493   3132   
            #[allow(unused_mut)]
 3494   3133   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3495   3134   
            let config = crate::service::RestJsonConfig::builder().build();
 3496   3135   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3497         -
            .http_request_with_labels(move |input: crate::input::HttpRequestWithLabelsInput| {
        3136  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3498   3137   
                                let sender = sender.clone();
 3499   3138   
                                async move {
 3500         -
                    let result = {
 3501         -
                        use ::aws_smithy_protocol_test::FloatEquals;
 3502         -
                        let expected = crate::input::HttpRequestWithLabelsInput {
 3503         -
                            string: "string".to_owned(),
 3504         -
                            short: 1,
 3505         -
                            integer: 2,
 3506         -
                            long: 3,
 3507         -
                            float: 4.1_f32,
 3508         -
                            double: 5.1_f64,
 3509         -
                            boolean: true,
 3510         -
                            timestamp: ::aws_smithy_types::DateTime::from_fractional_secs(
 3511         -
                                1576540098, 0_f64,
 3512         -
                            ),
 3513         -
                        };
 3514         -
                        ::pretty_assertions::assert_eq!(
 3515         -
                            input.string,
 3516         -
                            expected.string,
 3517         -
                            "Unexpected value for `string`"
 3518         -
                        );
 3519         -
                        ::pretty_assertions::assert_eq!(
 3520         -
                            input.short,
 3521         -
                            expected.short,
 3522         -
                            "Unexpected value for `short`"
 3523         -
                        );
 3524         -
                        ::pretty_assertions::assert_eq!(
 3525         -
                            input.integer,
 3526         -
                            expected.integer,
 3527         -
                            "Unexpected value for `integer`"
 3528         -
                        );
 3529         -
                        ::pretty_assertions::assert_eq!(
 3530         -
                            input.long,
 3531         -
                            expected.long,
 3532         -
                            "Unexpected value for `long`"
 3533         -
                        );
 3534         -
                        assert!(
 3535         -
                            input.float.float_equals(&expected.float),
 3536         -
                            "Unexpected value for `float` {:?} vs. {:?}",
 3537         -
                            expected.float,
 3538         -
                            input.float
 3539         -
                        );
 3540         -
                        assert!(
 3541         -
                            input.double.float_equals(&expected.double),
 3542         -
                            "Unexpected value for `double` {:?} vs. {:?}",
 3543         -
                            expected.double,
 3544         -
                            input.double
 3545         -
                        );
 3546         -
                        ::pretty_assertions::assert_eq!(
 3547         -
                            input.boolean,
 3548         -
                            expected.boolean,
 3549         -
                            "Unexpected value for `boolean`"
 3550         -
                        );
 3551         -
                        ::pretty_assertions::assert_eq!(
 3552         -
                            input.timestamp,
 3553         -
                            expected.timestamp,
 3554         -
                            "Unexpected value for `timestamp`"
 3555         -
                        );
 3556         -
                        let response = crate::output::HttpRequestWithLabelsOutput {};
 3557         -
                        Ok(response)
 3558         -
                    };
        3139  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3559   3140   
                                    sender.send(()).await.expect("receiver dropped early");
 3560   3141   
                                    result
 3561   3142   
                                }
 3562   3143   
                            })
 3563   3144   
                            .build_unchecked();
 3564   3145   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3565   3146   
                .await
 3566   3147   
                .expect("unable to make an HTTP request");
 3567         -
        assert!(receiver.recv().await.is_some());
 3568         -
    }
 3569         -
    /// Sends a GET request that uses URI label bindings
 3570         -
    /// Test ID: RestJsonHttpRequestLabelEscaping
 3571         -
    #[::tokio::test]
 3572         -
    async fn rest_json_http_request_label_escaping_request() {
 3573         -
        #[allow(unused_mut)]
 3574         -
                    let mut http_request = http::Request::builder()
 3575         -
                        .uri("/HttpRequestWithLabels/%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z")
 3576         -
                        .method("GET")
 3577         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("".as_bytes()))).unwrap();
 3578         -
        #[allow(unused_mut)]
 3579         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3580         -
        let config = crate::service::RestJsonConfig::builder().build();
 3581         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3582         -
            .http_request_with_labels(move |input: crate::input::HttpRequestWithLabelsInput| {
 3583         -
                let sender = sender.clone();
 3584         -
                async move {
 3585         -
                    let result = {
 3586         -
                        use ::aws_smithy_protocol_test::FloatEquals;
 3587         -
                        let expected = crate::input::HttpRequestWithLabelsInput {
 3588         -
                            string: " %:/?#[]@!$&'()*+,;=😹".to_owned(),
 3589         -
                            short: 1,
 3590         -
                            integer: 2,
 3591         -
                            long: 3,
 3592         -
                            float: 4.1_f32,
 3593         -
                            double: 5.1_f64,
 3594         -
                            boolean: true,
 3595         -
                            timestamp: ::aws_smithy_types::DateTime::from_fractional_secs(
 3596         -
                                1576540098, 0_f64,
 3597         -
                            ),
 3598         -
                        };
 3599         -
                        ::pretty_assertions::assert_eq!(
 3600         -
                            input.string,
 3601         -
                            expected.string,
 3602         -
                            "Unexpected value for `string`"
 3603         -
                        );
 3604         -
                        ::pretty_assertions::assert_eq!(
 3605         -
                            input.short,
 3606         -
                            expected.short,
 3607         -
                            "Unexpected value for `short`"
 3608         -
                        );
 3609         -
                        ::pretty_assertions::assert_eq!(
 3610         -
                            input.integer,
 3611         -
                            expected.integer,
 3612         -
                            "Unexpected value for `integer`"
 3613         -
                        );
 3614         -
                        ::pretty_assertions::assert_eq!(
 3615         -
                            input.long,
 3616         -
                            expected.long,
 3617         -
                            "Unexpected value for `long`"
 3618         -
                        );
 3619         -
                        assert!(
 3620         -
                            input.float.float_equals(&expected.float),
 3621         -
                            "Unexpected value for `float` {:?} vs. {:?}",
 3622         -
                            expected.float,
 3623         -
                            input.float
 3624         -
                        );
 3625         -
                        assert!(
 3626         -
                            input.double.float_equals(&expected.double),
 3627         -
                            "Unexpected value for `double` {:?} vs. {:?}",
 3628         -
                            expected.double,
 3629         -
                            input.double
 3630         -
                        );
 3631         -
                        ::pretty_assertions::assert_eq!(
 3632         -
                            input.boolean,
 3633         -
                            expected.boolean,
 3634         -
                            "Unexpected value for `boolean`"
 3635         -
                        );
 3636   3148   
            ::pretty_assertions::assert_eq!(
 3637         -
                            input.timestamp,
 3638         -
                            expected.timestamp,
 3639         -
                            "Unexpected value for `timestamp`"
        3149  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3150  +
                http_response.status()
 3640   3151   
            );
 3641         -
                        let response = crate::output::HttpRequestWithLabelsOutput {};
 3642         -
                        Ok(response)
 3643         -
                    };
 3644         -
                    sender.send(()).await.expect("receiver dropped early");
 3645         -
                    result
        3152  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3153  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3154  +
                http_response.headers(),
        3155  +
                expected_headers,
        3156  +
            ));
 3646   3157   
        }
 3647         -
            })
 3648         -
            .build_unchecked();
 3649         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3650         -
            .await
 3651         -
            .expect("unable to make an HTTP request");
 3652         -
        assert!(receiver.recv().await.is_some());
 3653   3158   
    }
 3654         -
}
 3655         -
#[cfg(test)]
 3656         -
#[allow(unreachable_code, unused_variables)]
 3657         -
mod server_http_request_with_labels_and_timestamp_format_test {
 3658         -
    /// Serializes different timestamp formats in URI labels
 3659         -
    /// Test ID: RestJsonHttpRequestWithLabelsAndTimestampFormat
        3159  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        3160  +
    /// are rejected with a 400 SerializationException
        3161  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case13
 3660   3162   
    #[::tokio::test]
 3661         -
    async fn rest_json_http_request_with_labels_and_timestamp_format_request() {
 3662         -
        #[allow(unused_mut)]
 3663         -
                    let mut http_request = http::Request::builder()
 3664         -
                        .uri("/HttpRequestWithLabelsAndTimestampFormat/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z/2019-12-16T23%3A48%3A18Z/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z")
 3665         -
                        .method("GET")
 3666         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("".as_bytes()))).unwrap();
 3667         -
        #[allow(unused_mut)]
 3668         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3669         -
        let config = crate::service::RestJsonConfig::builder().build();
 3670         -
        let service =
 3671         -
            crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3672         -
                .http_request_with_labels_and_timestamp_format(
 3673         -
                    move |input: crate::input::HttpRequestWithLabelsAndTimestampFormatInput| {
 3674         -
                        let sender = sender.clone();
 3675         -
                        async move {
 3676         -
                            let result =
        3163  +
    #[::tracing_test::traced_test]
        3164  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
        3165  +
    ) {
 3677   3166   
        {
 3678         -
                                    let expected =
 3679         -
            crate::input::HttpRequestWithLabelsAndTimestampFormatInput {
 3680         -
                member_epoch_seconds:
 3681         -
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
 3682         -
                ,
 3683         -
                member_http_date:
 3684         -
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
 3685         -
                ,
 3686         -
                member_date_time:
 3687         -
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
 3688         -
                ,
 3689         -
                default_format:
 3690         -
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
 3691         -
                ,
 3692         -
                target_epoch_seconds:
 3693         -
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
 3694         -
                ,
 3695         -
                target_http_date:
 3696         -
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
 3697         -
                ,
 3698         -
                target_date_time:
 3699         -
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
 3700         -
                ,
 3701         -
            }
 3702         -
        ;
 3703         -
                                    ::pretty_assertions::assert_eq!(input, expected);
 3704         -
                                    let response =
 3705         -
            crate::output::HttpRequestWithLabelsAndTimestampFormatOutput {
 3706         -
            }
 3707         -
        ;
 3708         -
                                    Ok(response)
 3709         -
                                };
 3710         -
                            sender.send(()).await.expect("receiver dropped early");
 3711         -
                            result
 3712         -
                        }
 3713         -
                    },
 3714         -
                )
 3715         -
                .build_unchecked();
 3716         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3717         -
            .await
 3718         -
            .expect("unable to make an HTTP request");
 3719         -
        assert!(receiver.recv().await.is_some());
 3720         -
    }
 3721         -
}
 3722         -
#[cfg(test)]
 3723         -
#[allow(unreachable_code, unused_variables)]
 3724         -
mod server_http_request_with_regex_literal_test {
 3725         -
    /// Path matching is not broken by regex expressions in literal segments
 3726         -
    /// Test ID: RestJsonToleratesRegexCharsInSegments
 3727         -
    #[::tokio::test]
 3728         -
    async fn rest_json_tolerates_regex_chars_in_segments_request() {
 3729   3167   
            #[allow(unused_mut)]
 3730   3168   
            let mut http_request = http::Request::builder()
 3731         -
            .uri("/ReDosLiteral/abc/(a+)+")
 3732         -
            .method("GET")
        3169  +
                .uri("/MalformedTimestampBodyDateTime")
        3170  +
                .method("POST")
        3171  +
                .header("content-type", "application/json")
 3733   3172   
                .body(::aws_smithy_http_server::body::Body::from(
 3734         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3173  +
                    ::bytes::Bytes::from_static(
        3174  +
                        "{ \"timestamp\": \"1996-12-19 16:39:57Z\" }".as_bytes(),
        3175  +
                    ),
 3735   3176   
                ))
 3736   3177   
                .unwrap();
 3737   3178   
            #[allow(unused_mut)]
 3738   3179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3739   3180   
            let config = crate::service::RestJsonConfig::builder().build();
 3740   3181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3741         -
            .http_request_with_regex_literal(
 3742         -
                move |input: crate::input::HttpRequestWithRegexLiteralInput| {
        3182  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3743   3183   
                                let sender = sender.clone();
 3744   3184   
                                async move {
 3745         -
                        let result = {
 3746         -
                            let expected = crate::input::HttpRequestWithRegexLiteralInput {
 3747         -
                                str: "abc".to_owned(),
 3748         -
                            };
 3749         -
                            ::pretty_assertions::assert_eq!(input, expected);
 3750         -
                            let response = crate::output::HttpRequestWithRegexLiteralOutput {};
 3751         -
                            Ok(response)
 3752         -
                        };
        3185  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3753   3186   
                                    sender.send(()).await.expect("receiver dropped early");
 3754   3187   
                                    result
 3755   3188   
                                }
 3756         -
                },
 3757         -
            )
        3189  +
                            })
 3758   3190   
                            .build_unchecked();
 3759   3191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3760   3192   
                .await
 3761   3193   
                .expect("unable to make an HTTP request");
 3762         -
        assert!(receiver.recv().await.is_some());
 3763         -
    }
 3764         -
}
 3765         -
#[cfg(test)]
 3766         -
#[allow(unreachable_code, unused_variables)]
 3767         -
mod server_http_response_code_test {
 3768         -
    /// Binds the http response code to an output structure. Note that
 3769         -
    /// even though all members are bound outside of the payload, an
 3770         -
    /// empty JSON object is serialized in the response. However,
 3771         -
    /// clients should be able to handle an empty JSON object or an
 3772         -
    /// empty payload without failing to deserialize a response.
 3773         -
    /// Test ID: RestJsonHttpResponseCode
 3774         -
    #[::tokio::test]
 3775         -
    async fn rest_json_http_response_code_response() {
 3776         -
        let output = crate::output::HttpResponseCodeOutput {
 3777         -
            status: ::std::option::Option::Some(201),
 3778         -
        };
 3779         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3780         -
        let http_response = output.into_response();
 3781   3194   
            ::pretty_assertions::assert_eq!(
 3782         -
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
        3195  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 3783   3196   
                http_response.status()
 3784   3197   
            );
 3785         -
        let expected_headers = [("Content-Type", "application/json")];
        3198  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 3786   3199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3787   3200   
                http_response.headers(),
 3788   3201   
                expected_headers,
 3789   3202   
            ));
 3790         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 3791         -
            .await
 3792         -
            .expect("unable to extract body to bytes");
 3793         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 3794         -
            &body,
 3795         -
            "{}",
 3796         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3797         -
        ));
 3798   3203   
        }
 3799         -
    /// Binds the http response code to the http trait's code if the
 3800         -
    /// code isn't explicitly set. A client would be parsing the
 3801         -
    /// http response code, so this would always be present, but
 3802         -
    /// a server doesn't require it to be set to serialize a request.
 3803         -
    /// Test ID: RestJsonHttpResponseCodeDefaultsToModeledCode
 3804         -
    #[::tokio::test]
 3805         -
    async fn rest_json_http_response_code_defaults_to_modeled_code_response() {
 3806         -
        let output = crate::output::HttpResponseCodeOutput {
 3807         -
            status: ::std::option::Option::None,
 3808         -
        };
 3809         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3810         -
        let http_response = output.into_response();
 3811         -
        ::pretty_assertions::assert_eq!(
 3812         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3813         -
            http_response.status()
 3814         -
        );
 3815         -
        let expected_headers = [("Content-Type", "application/json")];
 3816         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3817         -
            http_response.headers(),
 3818         -
            expected_headers,
 3819         -
        ));
 3820         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 3821         -
            .await
 3822         -
            .expect("unable to extract body to bytes");
 3823         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 3824         -
            &body,
 3825         -
            "{}",
 3826         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3827         -
        ));
 3828   3204   
    }
 3829         -
}
 3830         -
#[cfg(test)]
 3831         -
#[allow(unreachable_code, unused_variables)]
 3832         -
mod server_http_string_payload_test {
 3833         -
    /// Test ID: RestJsonStringPayloadRequest
        3205  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        3206  +
    /// are rejected with a 400 SerializationException
        3207  +
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case14
 3834   3208   
    #[::tokio::test]
 3835         -
    #[should_panic]
 3836         -
    async fn rest_json_string_payload_request_request() {
        3209  +
    #[::tracing_test::traced_test]
        3210  +
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
        3211  +
    ) {
        3212  +
        {
 3837   3213   
            #[allow(unused_mut)]
 3838   3214   
            let mut http_request = http::Request::builder()
 3839         -
            .uri("/StringPayload")
        3215  +
                .uri("/MalformedTimestampBodyDateTime")
 3840   3216   
                .method("POST")
        3217  +
                .header("content-type", "application/json")
 3841   3218   
                .body(::aws_smithy_http_server::body::Body::from(
 3842         -
                ::bytes::Bytes::from_static("rawstring".as_bytes()),
        3219  +
                    ::bytes::Bytes::from_static(
        3220  +
                        "{ \"timestamp\": \"2011-12-03T10:15:30+01:00[Europe/Paris]\" }".as_bytes(),
        3221  +
                    ),
 3843   3222   
                ))
 3844   3223   
                .unwrap();
 3845   3224   
            #[allow(unused_mut)]
 3846   3225   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3847   3226   
            let config = crate::service::RestJsonConfig::builder().build();
 3848   3227   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3849         -
            .http_string_payload(move |input: crate::input::HttpStringPayloadInput| {
        3228  +
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
 3850   3229   
                                let sender = sender.clone();
 3851   3230   
                                async move {
 3852         -
                    let result = {
 3853         -
                        let expected = crate::input::HttpStringPayloadInput {
 3854         -
                            payload: ::std::option::Option::Some("rawstring".to_owned()),
 3855         -
                        };
 3856         -
                        ::pretty_assertions::assert_eq!(input, expected);
 3857         -
                        let response = crate::output::HttpStringPayloadOutput {
 3858         -
                            payload: ::std::option::Option::None,
 3859         -
                        };
 3860         -
                        response
 3861         -
                    };
        3231  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
 3862   3232   
                                    sender.send(()).await.expect("receiver dropped early");
 3863   3233   
                                    result
 3864   3234   
                                }
 3865   3235   
                            })
 3866   3236   
                            .build_unchecked();
 3867   3237   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 3868   3238   
                .await
 3869   3239   
                .expect("unable to make an HTTP request");
 3870         -
        assert!(receiver.recv().await.is_some());
 3871         -
    }
 3872         -
    /// Test ID: RestJsonStringPayloadResponse
 3873         -
    #[::tokio::test]
 3874         -
    async fn rest_json_string_payload_response_response() {
 3875         -
        let output = crate::output::HttpStringPayloadOutput {
 3876         -
            payload: ::std::option::Option::Some("rawstring".to_owned()),
 3877         -
        };
 3878         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3879         -
        let http_response = output.into_response();
 3880   3240   
            ::pretty_assertions::assert_eq!(
 3881         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3241  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 3882   3242   
                http_response.status()
 3883   3243   
            );
 3884         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 3885         -
            .await
 3886         -
            .expect("unable to extract body to bytes");
 3887         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 3888         -
            &body,
 3889         -
            "rawstring",
 3890         -
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
 3891         -
        ));
 3892         -
    }
 3893         -
}
 3894         -
#[cfg(test)]
 3895         -
#[allow(unreachable_code, unused_variables)]
 3896         -
mod server_ignore_query_params_in_response_test {
 3897         -
    /// Query parameters must be ignored when serializing the output
 3898         -
    /// of an operation. As of January 2021, server implementations
 3899         -
    /// are expected to respond with a JSON object regardless of
 3900         -
    /// if the output parameters are empty.
 3901         -
    /// Test ID: RestJsonIgnoreQueryParamsInResponse
 3902         -
    #[::tokio::test]
 3903         -
    async fn rest_json_ignore_query_params_in_response_response() {
 3904         -
        let output = crate::output::IgnoreQueryParamsInResponseOutput {
 3905         -
            baz: ::std::option::Option::None,
 3906         -
        };
 3907         -
        use ::aws_smithy_http_server::response::IntoResponse;
 3908         -
        let http_response = output.into_response();
 3909         -
        ::pretty_assertions::assert_eq!(
 3910         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 3911         -
            http_response.status()
 3912         -
        );
 3913         -
        let expected_headers = [("Content-Type", "application/json")];
        3244  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 3914   3245   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 3915   3246   
                http_response.headers(),
 3916   3247   
                expected_headers,
 3917   3248   
            ));
 3918         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        3249  +
        }
        3250  +
    }
        3251  +
}
        3252  +
        3253  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
        3254  +
::pin_project_lite::pin_project! {
        3255  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        3256  +
    /// [`MalformedTimestampBodyDefaultInput`](crate::input::MalformedTimestampBodyDefaultInput) using modelled bindings.
        3257  +
    pub struct MalformedTimestampBodyDefaultInputFuture {
        3258  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampBodyDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        3259  +
    }
        3260  +
}
        3261  +
        3262  +
impl std::future::Future for MalformedTimestampBodyDefaultInputFuture {
        3263  +
    type Output = Result<
        3264  +
        crate::input::MalformedTimestampBodyDefaultInput,
        3265  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        3266  +
    >;
        3267  +
        3268  +
    fn poll(
        3269  +
        self: std::pin::Pin<&mut Self>,
        3270  +
        cx: &mut std::task::Context<'_>,
        3271  +
    ) -> std::task::Poll<Self::Output> {
        3272  +
        let this = self.project();
        3273  +
        this.inner.as_mut().poll(cx)
        3274  +
    }
        3275  +
}
        3276  +
        3277  +
impl<B>
        3278  +
    ::aws_smithy_http_server::request::FromRequest<
        3279  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        3280  +
        B,
        3281  +
    > for crate::input::MalformedTimestampBodyDefaultInput
        3282  +
where
        3283  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        3284  +
    B: 'static,
        3285  +
        3286  +
    B::Data: Send,
        3287  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        3288  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        3289  +
{
        3290  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        3291  +
    type Future = MalformedTimestampBodyDefaultInputFuture;
        3292  +
        3293  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        3294  +
        let fut = async move {
        3295  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        3296  +
                request.headers(),
        3297  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDEFAULT,
        3298  +
            ) {
        3299  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        3300  +
            }
        3301  +
            crate::protocol_serde::shape_malformed_timestamp_body_default::de_malformed_timestamp_body_default_http_request(request)
 3919   3302   
                            .await
 3920         -
            .expect("unable to extract body to bytes");
 3921         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 3922         -
            &body,
 3923         -
            "{}",
 3924         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 3925         -
        ));
        3303  +
                            .map_err(Into::into)
        3304  +
        };
        3305  +
        use ::futures_util::future::TryFutureExt;
        3306  +
        let fut = fut.map_err(
        3307  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        3308  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        3309  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        3310  +
                    e,
        3311  +
                )
        3312  +
            },
        3313  +
        );
        3314  +
        MalformedTimestampBodyDefaultInputFuture {
        3315  +
            inner: Box::pin(fut),
        3316  +
        }
 3926   3317   
    }
 3927   3318   
}
 3928         -
#[cfg(test)]
        3319  +
impl
        3320  +
    ::aws_smithy_http_server::response::IntoResponse<
        3321  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        3322  +
    > for crate::output::MalformedTimestampBodyDefaultOutput
        3323  +
{
        3324  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        3325  +
        match crate::protocol_serde::shape_malformed_timestamp_body_default::ser_malformed_timestamp_body_default_http_response(self) {
        3326  +
                        Ok(response) => response,
        3327  +
                        Err(e) => {
        3328  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        3329  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        3330  +
                        }
        3331  +
                    }
        3332  +
    }
        3333  +
}
        3334  +
impl
        3335  +
    ::aws_smithy_http_server::response::IntoResponse<
        3336  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        3337  +
    > for crate::error::MalformedTimestampBodyDefaultError
        3338  +
{
        3339  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        3340  +
        match crate::protocol_serde::shape_malformed_timestamp_body_default::ser_malformed_timestamp_body_default_http_error(&self) {
        3341  +
            Ok(mut response) => {
        3342  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        3343  +
                response
        3344  +
            },
        3345  +
            Err(e) => {
        3346  +
                ::tracing::error!(error = %e, "failed to serialize response");
        3347  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        3348  +
            }
        3349  +
        }
        3350  +
    }
        3351  +
}
        3352  +
 3929   3353   
#[allow(unreachable_code, unused_variables)]
 3930         -
mod server_input_and_output_with_headers_test {
 3931         -
    /// Tests requests with string header bindings
 3932         -
    /// Test ID: RestJsonInputAndOutputWithStringHeaders
        3354  +
#[cfg(test)]
        3355  +
mod malformed_timestamp_body_default_test {
        3356  +
        3357  +
    /// By default, RFC3339 timestamps are rejected with a
        3358  +
    /// 400 SerializationException
        3359  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case0
 3933   3360   
    #[::tokio::test]
 3934         -
    async fn rest_json_input_and_output_with_string_headers_request() {
        3361  +
    #[::tracing_test::traced_test]
        3362  +
    async fn rest_json_body_timestamp_default_rejects_date_time_case0_malformed_request() {
        3363  +
        {
 3935   3364   
            #[allow(unused_mut)]
 3936   3365   
            let mut http_request = http::Request::builder()
 3937         -
            .uri("/InputAndOutputWithHeaders")
        3366  +
                .uri("/MalformedTimestampBodyDefault")
 3938   3367   
                .method("POST")
 3939         -
            .header("X-String", "Hello")
 3940         -
            .header("X-StringList", "a, b, c")
 3941         -
            .header("X-StringSet", "a, b, c")
        3368  +
                .header("content-type", "application/json")
 3942   3369   
                .body(::aws_smithy_http_server::body::Body::from(
 3943         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3370  +
                    ::bytes::Bytes::from_static(
        3371  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
        3372  +
                    ),
 3944   3373   
                ))
 3945   3374   
                .unwrap();
 3946   3375   
            #[allow(unused_mut)]
 3947   3376   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 3948   3377   
            let config = crate::service::RestJsonConfig::builder().build();
 3949   3378   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 3950         -
            .input_and_output_with_headers(
 3951         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
        3379  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 3952   3380   
                                let sender = sender.clone();
 3953   3381   
                                async move {
 3954         -
                        let result = {
 3955         -
                            use ::aws_smithy_protocol_test::FloatEquals;
 3956         -
                            let expected = crate::input::InputAndOutputWithHeadersInput {
 3957         -
                                header_string: ::std::option::Option::Some("Hello".to_owned()),
 3958         -
                                header_string_list: ::std::option::Option::Some(vec![
 3959         -
                                    "a".to_owned(),
 3960         -
                                    "b".to_owned(),
 3961         -
                                    "c".to_owned(),
 3962         -
                                ]),
 3963         -
                                header_string_set: ::std::option::Option::Some(
 3964         -
                                    vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]
 3965         -
                                        .try_into()
 3966         -
                                        .expect("this is only used in tests"),
 3967         -
                                ),
 3968         -
                                header_byte: ::std::option::Option::None,
 3969         -
                                header_short: ::std::option::Option::None,
 3970         -
                                header_integer: ::std::option::Option::None,
 3971         -
                                header_long: ::std::option::Option::None,
 3972         -
                                header_float: ::std::option::Option::None,
 3973         -
                                header_double: ::std::option::Option::None,
 3974         -
                                header_true_bool: ::std::option::Option::None,
 3975         -
                                header_false_bool: ::std::option::Option::None,
 3976         -
                                header_integer_list: ::std::option::Option::None,
 3977         -
                                header_boolean_list: ::std::option::Option::None,
 3978         -
                                header_timestamp_list: ::std::option::Option::None,
 3979         -
                                header_enum: ::std::option::Option::None,
 3980         -
                                header_enum_list: ::std::option::Option::None,
 3981         -
                                header_integer_enum: ::std::option::Option::None,
 3982         -
                                header_integer_enum_list: ::std::option::Option::None,
 3983         -
                            };
 3984         -
                            ::pretty_assertions::assert_eq!(
 3985         -
                                input.header_string,
 3986         -
                                expected.header_string,
 3987         -
                                "Unexpected value for `header_string`"
 3988         -
                            );
 3989         -
                            ::pretty_assertions::assert_eq!(
 3990         -
                                input.header_byte,
 3991         -
                                expected.header_byte,
 3992         -
                                "Unexpected value for `header_byte`"
 3993         -
                            );
 3994         -
                            ::pretty_assertions::assert_eq!(
 3995         -
                                input.header_short,
 3996         -
                                expected.header_short,
 3997         -
                                "Unexpected value for `header_short`"
 3998         -
                            );
 3999         -
                            ::pretty_assertions::assert_eq!(
 4000         -
                                input.header_integer,
 4001         -
                                expected.header_integer,
 4002         -
                                "Unexpected value for `header_integer`"
 4003         -
                            );
 4004         -
                            ::pretty_assertions::assert_eq!(
 4005         -
                                input.header_long,
 4006         -
                                expected.header_long,
 4007         -
                                "Unexpected value for `header_long`"
 4008         -
                            );
 4009         -
                            assert!(
 4010         -
                                input.header_float.float_equals(&expected.header_float),
 4011         -
                                "Unexpected value for `header_float` {:?} vs. {:?}",
 4012         -
                                expected.header_float,
 4013         -
                                input.header_float
 4014         -
                            );
 4015         -
                            assert!(
 4016         -
                                input.header_double.float_equals(&expected.header_double),
 4017         -
                                "Unexpected value for `header_double` {:?} vs. {:?}",
 4018         -
                                expected.header_double,
 4019         -
                                input.header_double
 4020         -
                            );
 4021         -
                            ::pretty_assertions::assert_eq!(
 4022         -
                                input.header_true_bool,
 4023         -
                                expected.header_true_bool,
 4024         -
                                "Unexpected value for `header_true_bool`"
 4025         -
                            );
 4026         -
                            ::pretty_assertions::assert_eq!(
 4027         -
                                input.header_false_bool,
 4028         -
                                expected.header_false_bool,
 4029         -
                                "Unexpected value for `header_false_bool`"
 4030         -
                            );
 4031         -
                            ::pretty_assertions::assert_eq!(
 4032         -
                                input.header_string_list,
 4033         -
                                expected.header_string_list,
 4034         -
                                "Unexpected value for `header_string_list`"
 4035         -
                            );
 4036         -
                            ::pretty_assertions::assert_eq!(
 4037         -
                                input.header_string_set,
 4038         -
                                expected.header_string_set,
 4039         -
                                "Unexpected value for `header_string_set`"
 4040         -
                            );
 4041         -
                            ::pretty_assertions::assert_eq!(
 4042         -
                                input.header_integer_list,
 4043         -
                                expected.header_integer_list,
 4044         -
                                "Unexpected value for `header_integer_list`"
 4045         -
                            );
 4046         -
                            ::pretty_assertions::assert_eq!(
 4047         -
                                input.header_boolean_list,
 4048         -
                                expected.header_boolean_list,
 4049         -
                                "Unexpected value for `header_boolean_list`"
 4050         -
                            );
 4051         -
                            ::pretty_assertions::assert_eq!(
 4052         -
                                input.header_timestamp_list,
 4053         -
                                expected.header_timestamp_list,
 4054         -
                                "Unexpected value for `header_timestamp_list`"
 4055         -
                            );
 4056         -
                            ::pretty_assertions::assert_eq!(
 4057         -
                                input.header_enum,
 4058         -
                                expected.header_enum,
 4059         -
                                "Unexpected value for `header_enum`"
 4060         -
                            );
 4061         -
                            ::pretty_assertions::assert_eq!(
 4062         -
                                input.header_enum_list,
 4063         -
                                expected.header_enum_list,
 4064         -
                                "Unexpected value for `header_enum_list`"
 4065         -
                            );
 4066         -
                            ::pretty_assertions::assert_eq!(
 4067         -
                                input.header_integer_enum,
 4068         -
                                expected.header_integer_enum,
 4069         -
                                "Unexpected value for `header_integer_enum`"
 4070         -
                            );
 4071         -
                            ::pretty_assertions::assert_eq!(
 4072         -
                                input.header_integer_enum_list,
 4073         -
                                expected.header_integer_enum_list,
 4074         -
                                "Unexpected value for `header_integer_enum_list`"
 4075         -
                            );
 4076         -
                            let response = crate::output::InputAndOutputWithHeadersOutput {
 4077         -
                                header_string: ::std::option::Option::None,
 4078         -
                                header_byte: ::std::option::Option::None,
 4079         -
                                header_short: ::std::option::Option::None,
 4080         -
                                header_integer: ::std::option::Option::None,
 4081         -
                                header_long: ::std::option::Option::None,
 4082         -
                                header_float: ::std::option::Option::None,
 4083         -
                                header_double: ::std::option::Option::None,
 4084         -
                                header_true_bool: ::std::option::Option::None,
 4085         -
                                header_false_bool: ::std::option::Option::None,
 4086         -
                                header_string_list: ::std::option::Option::None,
 4087         -
                                header_string_set: ::std::option::Option::None,
 4088         -
                                header_integer_list: ::std::option::Option::None,
 4089         -
                                header_boolean_list: ::std::option::Option::None,
 4090         -
                                header_timestamp_list: ::std::option::Option::None,
 4091         -
                                header_enum: ::std::option::Option::None,
 4092         -
                                header_enum_list: ::std::option::Option::None,
 4093         -
                                header_integer_enum: ::std::option::Option::None,
 4094         -
                                header_integer_enum_list: ::std::option::Option::None,
 4095         -
                            };
 4096         -
                            Ok(response)
 4097         -
                        };
        3382  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 4098   3383   
                                    sender.send(()).await.expect("receiver dropped early");
 4099   3384   
                                    result
 4100   3385   
                                }
 4101         -
                },
 4102         -
            )
        3386  +
                            })
 4103   3387   
                            .build_unchecked();
 4104   3388   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4105   3389   
                .await
 4106   3390   
                .expect("unable to make an HTTP request");
 4107         -
        assert!(receiver.recv().await.is_some());
        3391  +
            ::pretty_assertions::assert_eq!(
        3392  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3393  +
                http_response.status()
        3394  +
            );
        3395  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3396  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3397  +
                http_response.headers(),
        3398  +
                expected_headers,
        3399  +
            ));
 4108   3400   
        }
 4109         -
    /// Tests requests with string list header bindings that require quoting
 4110         -
    /// Test ID: RestJsonInputAndOutputWithQuotedStringHeaders
        3401  +
    }
        3402  +
    /// By default, RFC3339 timestamps are rejected with a
        3403  +
    /// 400 SerializationException
        3404  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case1
 4111   3405   
    #[::tokio::test]
 4112         -
    async fn rest_json_input_and_output_with_quoted_string_headers_request() {
        3406  +
    #[::tracing_test::traced_test]
        3407  +
    async fn rest_json_body_timestamp_default_rejects_date_time_case1_malformed_request() {
        3408  +
        {
 4113   3409   
            #[allow(unused_mut)]
 4114   3410   
            let mut http_request = http::Request::builder()
 4115         -
            .uri("/InputAndOutputWithHeaders")
        3411  +
                .uri("/MalformedTimestampBodyDefault")
 4116   3412   
                .method("POST")
 4117         -
            .header("X-StringList", "\"b,c\", \"\\\"def\\\"\", a")
        3413  +
                .header("content-type", "application/json")
 4118   3414   
                .body(::aws_smithy_http_server::body::Body::from(
 4119         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3415  +
                    ::bytes::Bytes::from_static(
        3416  +
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
        3417  +
                    ),
 4120   3418   
                ))
 4121   3419   
                .unwrap();
 4122   3420   
            #[allow(unused_mut)]
 4123   3421   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4124   3422   
            let config = crate::service::RestJsonConfig::builder().build();
 4125   3423   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4126         -
            .input_and_output_with_headers(
 4127         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
        3424  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 4128   3425   
                                let sender = sender.clone();
 4129   3426   
                                async move {
 4130         -
                        let result = {
 4131         -
                            use ::aws_smithy_protocol_test::FloatEquals;
 4132         -
                            let expected = crate::input::InputAndOutputWithHeadersInput {
 4133         -
                                header_string_list: ::std::option::Option::Some(vec![
 4134         -
                                    "b,c".to_owned(),
 4135         -
                                    "\"def\"".to_owned(),
 4136         -
                                    "a".to_owned(),
 4137         -
                                ]),
 4138         -
                                header_string: ::std::option::Option::None,
 4139         -
                                header_byte: ::std::option::Option::None,
 4140         -
                                header_short: ::std::option::Option::None,
 4141         -
                                header_integer: ::std::option::Option::None,
 4142         -
                                header_long: ::std::option::Option::None,
 4143         -
                                header_float: ::std::option::Option::None,
 4144         -
                                header_double: ::std::option::Option::None,
 4145         -
                                header_true_bool: ::std::option::Option::None,
 4146         -
                                header_false_bool: ::std::option::Option::None,
 4147         -
                                header_string_set: ::std::option::Option::None,
 4148         -
                                header_integer_list: ::std::option::Option::None,
 4149         -
                                header_boolean_list: ::std::option::Option::None,
 4150         -
                                header_timestamp_list: ::std::option::Option::None,
 4151         -
                                header_enum: ::std::option::Option::None,
 4152         -
                                header_enum_list: ::std::option::Option::None,
 4153         -
                                header_integer_enum: ::std::option::Option::None,
 4154         -
                                header_integer_enum_list: ::std::option::Option::None,
 4155         -
                            };
 4156         -
                            ::pretty_assertions::assert_eq!(
 4157         -
                                input.header_string,
 4158         -
                                expected.header_string,
 4159         -
                                "Unexpected value for `header_string`"
 4160         -
                            );
 4161         -
                            ::pretty_assertions::assert_eq!(
 4162         -
                                input.header_byte,
 4163         -
                                expected.header_byte,
 4164         -
                                "Unexpected value for `header_byte`"
 4165         -
                            );
 4166         -
                            ::pretty_assertions::assert_eq!(
 4167         -
                                input.header_short,
 4168         -
                                expected.header_short,
 4169         -
                                "Unexpected value for `header_short`"
 4170         -
                            );
 4171         -
                            ::pretty_assertions::assert_eq!(
 4172         -
                                input.header_integer,
 4173         -
                                expected.header_integer,
 4174         -
                                "Unexpected value for `header_integer`"
 4175         -
                            );
 4176         -
                            ::pretty_assertions::assert_eq!(
 4177         -
                                input.header_long,
 4178         -
                                expected.header_long,
 4179         -
                                "Unexpected value for `header_long`"
 4180         -
                            );
 4181         -
                            assert!(
 4182         -
                                input.header_float.float_equals(&expected.header_float),
 4183         -
                                "Unexpected value for `header_float` {:?} vs. {:?}",
 4184         -
                                expected.header_float,
 4185         -
                                input.header_float
 4186         -
                            );
 4187         -
                            assert!(
 4188         -
                                input.header_double.float_equals(&expected.header_double),
 4189         -
                                "Unexpected value for `header_double` {:?} vs. {:?}",
 4190         -
                                expected.header_double,
 4191         -
                                input.header_double
 4192         -
                            );
 4193         -
                            ::pretty_assertions::assert_eq!(
 4194         -
                                input.header_true_bool,
 4195         -
                                expected.header_true_bool,
 4196         -
                                "Unexpected value for `header_true_bool`"
 4197         -
                            );
 4198         -
                            ::pretty_assertions::assert_eq!(
 4199         -
                                input.header_false_bool,
 4200         -
                                expected.header_false_bool,
 4201         -
                                "Unexpected value for `header_false_bool`"
 4202         -
                            );
 4203         -
                            ::pretty_assertions::assert_eq!(
 4204         -
                                input.header_string_list,
 4205         -
                                expected.header_string_list,
 4206         -
                                "Unexpected value for `header_string_list`"
 4207         -
                            );
 4208         -
                            ::pretty_assertions::assert_eq!(
 4209         -
                                input.header_string_set,
 4210         -
                                expected.header_string_set,
 4211         -
                                "Unexpected value for `header_string_set`"
 4212         -
                            );
 4213         -
                            ::pretty_assertions::assert_eq!(
 4214         -
                                input.header_integer_list,
 4215         -
                                expected.header_integer_list,
 4216         -
                                "Unexpected value for `header_integer_list`"
 4217         -
                            );
 4218         -
                            ::pretty_assertions::assert_eq!(
 4219         -
                                input.header_boolean_list,
 4220         -
                                expected.header_boolean_list,
 4221         -
                                "Unexpected value for `header_boolean_list`"
 4222         -
                            );
 4223         -
                            ::pretty_assertions::assert_eq!(
 4224         -
                                input.header_timestamp_list,
 4225         -
                                expected.header_timestamp_list,
 4226         -
                                "Unexpected value for `header_timestamp_list`"
 4227         -
                            );
 4228         -
                            ::pretty_assertions::assert_eq!(
 4229         -
                                input.header_enum,
 4230         -
                                expected.header_enum,
 4231         -
                                "Unexpected value for `header_enum`"
 4232         -
                            );
 4233         -
                            ::pretty_assertions::assert_eq!(
 4234         -
                                input.header_enum_list,
 4235         -
                                expected.header_enum_list,
 4236         -
                                "Unexpected value for `header_enum_list`"
 4237         -
                            );
 4238         -
                            ::pretty_assertions::assert_eq!(
 4239         -
                                input.header_integer_enum,
 4240         -
                                expected.header_integer_enum,
 4241         -
                                "Unexpected value for `header_integer_enum`"
 4242         -
                            );
 4243         -
                            ::pretty_assertions::assert_eq!(
 4244         -
                                input.header_integer_enum_list,
 4245         -
                                expected.header_integer_enum_list,
 4246         -
                                "Unexpected value for `header_integer_enum_list`"
 4247         -
                            );
 4248         -
                            let response = crate::output::InputAndOutputWithHeadersOutput {
 4249         -
                                header_string: ::std::option::Option::None,
 4250         -
                                header_byte: ::std::option::Option::None,
 4251         -
                                header_short: ::std::option::Option::None,
 4252         -
                                header_integer: ::std::option::Option::None,
 4253         -
                                header_long: ::std::option::Option::None,
 4254         -
                                header_float: ::std::option::Option::None,
 4255         -
                                header_double: ::std::option::Option::None,
 4256         -
                                header_true_bool: ::std::option::Option::None,
 4257         -
                                header_false_bool: ::std::option::Option::None,
 4258         -
                                header_string_list: ::std::option::Option::None,
 4259         -
                                header_string_set: ::std::option::Option::None,
 4260         -
                                header_integer_list: ::std::option::Option::None,
 4261         -
                                header_boolean_list: ::std::option::Option::None,
 4262         -
                                header_timestamp_list: ::std::option::Option::None,
 4263         -
                                header_enum: ::std::option::Option::None,
 4264         -
                                header_enum_list: ::std::option::Option::None,
 4265         -
                                header_integer_enum: ::std::option::Option::None,
 4266         -
                                header_integer_enum_list: ::std::option::Option::None,
 4267         -
                            };
 4268         -
                            Ok(response)
 4269         -
                        };
        3427  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 4270   3428   
                                    sender.send(()).await.expect("receiver dropped early");
 4271   3429   
                                    result
 4272   3430   
                                }
 4273         -
                },
 4274         -
            )
        3431  +
                            })
 4275   3432   
                            .build_unchecked();
 4276   3433   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4277   3434   
                .await
 4278   3435   
                .expect("unable to make an HTTP request");
 4279         -
        assert!(receiver.recv().await.is_some());
        3436  +
            ::pretty_assertions::assert_eq!(
        3437  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3438  +
                http_response.status()
        3439  +
            );
        3440  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3441  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3442  +
                http_response.headers(),
        3443  +
                expected_headers,
        3444  +
            ));
 4280   3445   
        }
 4281         -
    /// Tests requests with numeric header bindings
 4282         -
    /// Test ID: RestJsonInputAndOutputWithNumericHeaders
        3446  +
    }
        3447  +
    /// By default, RFC3339 timestamps are rejected with a
        3448  +
    /// 400 SerializationException
        3449  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case2
 4283   3450   
    #[::tokio::test]
 4284         -
    async fn rest_json_input_and_output_with_numeric_headers_request() {
        3451  +
    #[::tracing_test::traced_test]
        3452  +
    async fn rest_json_body_timestamp_default_rejects_date_time_case2_malformed_request() {
        3453  +
        {
 4285   3454   
            #[allow(unused_mut)]
 4286   3455   
            let mut http_request = http::Request::builder()
 4287         -
            .uri("/InputAndOutputWithHeaders")
        3456  +
                .uri("/MalformedTimestampBodyDefault")
 4288   3457   
                .method("POST")
 4289         -
            .header("X-Byte", "1")
 4290         -
            .header("X-Double", "1.1")
 4291         -
            .header("X-Float", "1.1")
 4292         -
            .header("X-Integer", "123")
 4293         -
            .header("X-IntegerList", "1, 2, 3")
 4294         -
            .header("X-Long", "123")
 4295         -
            .header("X-Short", "123")
        3458  +
                .header("content-type", "application/json")
 4296   3459   
                .body(::aws_smithy_http_server::body::Body::from(
 4297         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3460  +
                    ::bytes::Bytes::from_static(
        3461  +
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
        3462  +
                    ),
 4298   3463   
                ))
 4299   3464   
                .unwrap();
 4300   3465   
            #[allow(unused_mut)]
 4301   3466   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4302   3467   
            let config = crate::service::RestJsonConfig::builder().build();
 4303   3468   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4304         -
            .input_and_output_with_headers(
 4305         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
        3469  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 4306   3470   
                                let sender = sender.clone();
 4307   3471   
                                async move {
 4308         -
                        let result = {
 4309         -
                            use ::aws_smithy_protocol_test::FloatEquals;
 4310         -
                            let expected = crate::input::InputAndOutputWithHeadersInput {
 4311         -
                                header_byte: ::std::option::Option::Some(1),
 4312         -
                                header_short: ::std::option::Option::Some(123),
 4313         -
                                header_integer: ::std::option::Option::Some(123),
 4314         -
                                header_long: ::std::option::Option::Some(123),
 4315         -
                                header_float: ::std::option::Option::Some(1.1_f32),
 4316         -
                                header_double: ::std::option::Option::Some(1.1_f64),
 4317         -
                                header_integer_list: ::std::option::Option::Some(vec![1, 2, 3]),
 4318         -
                                header_string: ::std::option::Option::None,
 4319         -
                                header_true_bool: ::std::option::Option::None,
 4320         -
                                header_false_bool: ::std::option::Option::None,
 4321         -
                                header_string_list: ::std::option::Option::None,
 4322         -
                                header_string_set: ::std::option::Option::None,
 4323         -
                                header_boolean_list: ::std::option::Option::None,
 4324         -
                                header_timestamp_list: ::std::option::Option::None,
 4325         -
                                header_enum: ::std::option::Option::None,
 4326         -
                                header_enum_list: ::std::option::Option::None,
 4327         -
                                header_integer_enum: ::std::option::Option::None,
 4328         -
                                header_integer_enum_list: ::std::option::Option::None,
 4329         -
                            };
 4330         -
                            ::pretty_assertions::assert_eq!(
 4331         -
                                input.header_string,
 4332         -
                                expected.header_string,
 4333         -
                                "Unexpected value for `header_string`"
 4334         -
                            );
 4335         -
                            ::pretty_assertions::assert_eq!(
 4336         -
                                input.header_byte,
 4337         -
                                expected.header_byte,
 4338         -
                                "Unexpected value for `header_byte`"
 4339         -
                            );
 4340         -
                            ::pretty_assertions::assert_eq!(
 4341         -
                                input.header_short,
 4342         -
                                expected.header_short,
 4343         -
                                "Unexpected value for `header_short`"
 4344         -
                            );
 4345         -
                            ::pretty_assertions::assert_eq!(
 4346         -
                                input.header_integer,
 4347         -
                                expected.header_integer,
 4348         -
                                "Unexpected value for `header_integer`"
 4349         -
                            );
 4350         -
                            ::pretty_assertions::assert_eq!(
 4351         -
                                input.header_long,
 4352         -
                                expected.header_long,
 4353         -
                                "Unexpected value for `header_long`"
 4354         -
                            );
 4355         -
                            assert!(
 4356         -
                                input.header_float.float_equals(&expected.header_float),
 4357         -
                                "Unexpected value for `header_float` {:?} vs. {:?}",
 4358         -
                                expected.header_float,
 4359         -
                                input.header_float
 4360         -
                            );
 4361         -
                            assert!(
 4362         -
                                input.header_double.float_equals(&expected.header_double),
 4363         -
                                "Unexpected value for `header_double` {:?} vs. {:?}",
 4364         -
                                expected.header_double,
 4365         -
                                input.header_double
 4366         -
                            );
 4367         -
                            ::pretty_assertions::assert_eq!(
 4368         -
                                input.header_true_bool,
 4369         -
                                expected.header_true_bool,
 4370         -
                                "Unexpected value for `header_true_bool`"
 4371         -
                            );
 4372         -
                            ::pretty_assertions::assert_eq!(
 4373         -
                                input.header_false_bool,
 4374         -
                                expected.header_false_bool,
 4375         -
                                "Unexpected value for `header_false_bool`"
 4376         -
                            );
 4377         -
                            ::pretty_assertions::assert_eq!(
 4378         -
                                input.header_string_list,
 4379         -
                                expected.header_string_list,
 4380         -
                                "Unexpected value for `header_string_list`"
 4381         -
                            );
 4382         -
                            ::pretty_assertions::assert_eq!(
 4383         -
                                input.header_string_set,
 4384         -
                                expected.header_string_set,
 4385         -
                                "Unexpected value for `header_string_set`"
 4386         -
                            );
 4387         -
                            ::pretty_assertions::assert_eq!(
 4388         -
                                input.header_integer_list,
 4389         -
                                expected.header_integer_list,
 4390         -
                                "Unexpected value for `header_integer_list`"
 4391         -
                            );
 4392         -
                            ::pretty_assertions::assert_eq!(
 4393         -
                                input.header_boolean_list,
 4394         -
                                expected.header_boolean_list,
 4395         -
                                "Unexpected value for `header_boolean_list`"
 4396         -
                            );
 4397         -
                            ::pretty_assertions::assert_eq!(
 4398         -
                                input.header_timestamp_list,
 4399         -
                                expected.header_timestamp_list,
 4400         -
                                "Unexpected value for `header_timestamp_list`"
 4401         -
                            );
 4402         -
                            ::pretty_assertions::assert_eq!(
 4403         -
                                input.header_enum,
 4404         -
                                expected.header_enum,
 4405         -
                                "Unexpected value for `header_enum`"
 4406         -
                            );
 4407         -
                            ::pretty_assertions::assert_eq!(
 4408         -
                                input.header_enum_list,
 4409         -
                                expected.header_enum_list,
 4410         -
                                "Unexpected value for `header_enum_list`"
 4411         -
                            );
 4412         -
                            ::pretty_assertions::assert_eq!(
 4413         -
                                input.header_integer_enum,
 4414         -
                                expected.header_integer_enum,
 4415         -
                                "Unexpected value for `header_integer_enum`"
 4416         -
                            );
 4417         -
                            ::pretty_assertions::assert_eq!(
 4418         -
                                input.header_integer_enum_list,
 4419         -
                                expected.header_integer_enum_list,
 4420         -
                                "Unexpected value for `header_integer_enum_list`"
 4421         -
                            );
 4422         -
                            let response = crate::output::InputAndOutputWithHeadersOutput {
 4423         -
                                header_string: ::std::option::Option::None,
 4424         -
                                header_byte: ::std::option::Option::None,
 4425         -
                                header_short: ::std::option::Option::None,
 4426         -
                                header_integer: ::std::option::Option::None,
 4427         -
                                header_long: ::std::option::Option::None,
 4428         -
                                header_float: ::std::option::Option::None,
 4429         -
                                header_double: ::std::option::Option::None,
 4430         -
                                header_true_bool: ::std::option::Option::None,
 4431         -
                                header_false_bool: ::std::option::Option::None,
 4432         -
                                header_string_list: ::std::option::Option::None,
 4433         -
                                header_string_set: ::std::option::Option::None,
 4434         -
                                header_integer_list: ::std::option::Option::None,
 4435         -
                                header_boolean_list: ::std::option::Option::None,
 4436         -
                                header_timestamp_list: ::std::option::Option::None,
 4437         -
                                header_enum: ::std::option::Option::None,
 4438         -
                                header_enum_list: ::std::option::Option::None,
 4439         -
                                header_integer_enum: ::std::option::Option::None,
 4440         -
                                header_integer_enum_list: ::std::option::Option::None,
 4441         -
                            };
 4442         -
                            Ok(response)
 4443         -
                        };
        3472  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 4444   3473   
                                    sender.send(()).await.expect("receiver dropped early");
 4445   3474   
                                    result
 4446   3475   
                                }
 4447         -
                },
 4448         -
            )
        3476  +
                            })
 4449   3477   
                            .build_unchecked();
 4450   3478   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4451   3479   
                .await
 4452   3480   
                .expect("unable to make an HTTP request");
 4453         -
        assert!(receiver.recv().await.is_some());
        3481  +
            ::pretty_assertions::assert_eq!(
        3482  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3483  +
                http_response.status()
        3484  +
            );
        3485  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3486  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3487  +
                http_response.headers(),
        3488  +
                expected_headers,
        3489  +
            ));
 4454   3490   
        }
 4455         -
    /// Tests requests with boolean header bindings
 4456         -
    /// Test ID: RestJsonInputAndOutputWithBooleanHeaders
        3491  +
    }
        3492  +
    /// By default, epoch second timestamps as strings are rejected with a
        3493  +
    /// 400 SerializationException
        3494  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case0
 4457   3495   
    #[::tokio::test]
 4458         -
    async fn rest_json_input_and_output_with_boolean_headers_request() {
        3496  +
    #[::tracing_test::traced_test]
        3497  +
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case0_malformed_request(
        3498  +
    ) {
        3499  +
        {
 4459   3500   
            #[allow(unused_mut)]
 4460   3501   
            let mut http_request = http::Request::builder()
 4461         -
            .uri("/InputAndOutputWithHeaders")
        3502  +
                .uri("/MalformedTimestampBodyDefault")
 4462   3503   
                .method("POST")
 4463         -
            .header("X-Boolean1", "true")
 4464         -
            .header("X-Boolean2", "false")
 4465         -
            .header("X-BooleanList", "true, false, true")
        3504  +
                .header("content-type", "application/json")
 4466   3505   
                .body(::aws_smithy_http_server::body::Body::from(
 4467         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3506  +
                    ::bytes::Bytes::from_static(
        3507  +
                        "{ \"timestamp\": \"1515531081.1234\" }".as_bytes(),
        3508  +
                    ),
 4468   3509   
                ))
 4469   3510   
                .unwrap();
 4470   3511   
            #[allow(unused_mut)]
 4471   3512   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4472   3513   
            let config = crate::service::RestJsonConfig::builder().build();
 4473   3514   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4474         -
            .input_and_output_with_headers(
 4475         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
        3515  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 4476   3516   
                                let sender = sender.clone();
 4477   3517   
                                async move {
 4478         -
                        let result = {
 4479         -
                            use ::aws_smithy_protocol_test::FloatEquals;
 4480         -
                            let expected = crate::input::InputAndOutputWithHeadersInput {
 4481         -
                                header_true_bool: ::std::option::Option::Some(true),
 4482         -
                                header_false_bool: ::std::option::Option::Some(false),
 4483         -
                                header_boolean_list: ::std::option::Option::Some(vec![
 4484         -
                                    true, false, true,
 4485         -
                                ]),
 4486         -
                                header_string: ::std::option::Option::None,
 4487         -
                                header_byte: ::std::option::Option::None,
 4488         -
                                header_short: ::std::option::Option::None,
 4489         -
                                header_integer: ::std::option::Option::None,
 4490         -
                                header_long: ::std::option::Option::None,
 4491         -
                                header_float: ::std::option::Option::None,
 4492         -
                                header_double: ::std::option::Option::None,
 4493         -
                                header_string_list: ::std::option::Option::None,
 4494         -
                                header_string_set: ::std::option::Option::None,
 4495         -
                                header_integer_list: ::std::option::Option::None,
 4496         -
                                header_timestamp_list: ::std::option::Option::None,
 4497         -
                                header_enum: ::std::option::Option::None,
 4498         -
                                header_enum_list: ::std::option::Option::None,
 4499         -
                                header_integer_enum: ::std::option::Option::None,
 4500         -
                                header_integer_enum_list: ::std::option::Option::None,
 4501         -
                            };
 4502         -
                            ::pretty_assertions::assert_eq!(
 4503         -
                                input.header_string,
 4504         -
                                expected.header_string,
 4505         -
                                "Unexpected value for `header_string`"
 4506         -
                            );
 4507         -
                            ::pretty_assertions::assert_eq!(
 4508         -
                                input.header_byte,
 4509         -
                                expected.header_byte,
 4510         -
                                "Unexpected value for `header_byte`"
 4511         -
                            );
 4512         -
                            ::pretty_assertions::assert_eq!(
 4513         -
                                input.header_short,
 4514         -
                                expected.header_short,
 4515         -
                                "Unexpected value for `header_short`"
 4516         -
                            );
 4517         -
                            ::pretty_assertions::assert_eq!(
 4518         -
                                input.header_integer,
 4519         -
                                expected.header_integer,
 4520         -
                                "Unexpected value for `header_integer`"
 4521         -
                            );
 4522         -
                            ::pretty_assertions::assert_eq!(
 4523         -
                                input.header_long,
 4524         -
                                expected.header_long,
 4525         -
                                "Unexpected value for `header_long`"
 4526         -
                            );
 4527         -
                            assert!(
 4528         -
                                input.header_float.float_equals(&expected.header_float),
 4529         -
                                "Unexpected value for `header_float` {:?} vs. {:?}",
 4530         -
                                expected.header_float,
 4531         -
                                input.header_float
 4532         -
                            );
 4533         -
                            assert!(
 4534         -
                                input.header_double.float_equals(&expected.header_double),
 4535         -
                                "Unexpected value for `header_double` {:?} vs. {:?}",
 4536         -
                                expected.header_double,
 4537         -
                                input.header_double
 4538         -
                            );
 4539         -
                            ::pretty_assertions::assert_eq!(
 4540         -
                                input.header_true_bool,
 4541         -
                                expected.header_true_bool,
 4542         -
                                "Unexpected value for `header_true_bool`"
 4543         -
                            );
 4544         -
                            ::pretty_assertions::assert_eq!(
 4545         -
                                input.header_false_bool,
 4546         -
                                expected.header_false_bool,
 4547         -
                                "Unexpected value for `header_false_bool`"
 4548         -
                            );
 4549         -
                            ::pretty_assertions::assert_eq!(
 4550         -
                                input.header_string_list,
 4551         -
                                expected.header_string_list,
 4552         -
                                "Unexpected value for `header_string_list`"
 4553         -
                            );
 4554         -
                            ::pretty_assertions::assert_eq!(
 4555         -
                                input.header_string_set,
 4556         -
                                expected.header_string_set,
 4557         -
                                "Unexpected value for `header_string_set`"
 4558         -
                            );
 4559         -
                            ::pretty_assertions::assert_eq!(
 4560         -
                                input.header_integer_list,
 4561         -
                                expected.header_integer_list,
 4562         -
                                "Unexpected value for `header_integer_list`"
 4563         -
                            );
 4564         -
                            ::pretty_assertions::assert_eq!(
 4565         -
                                input.header_boolean_list,
 4566         -
                                expected.header_boolean_list,
 4567         -
                                "Unexpected value for `header_boolean_list`"
 4568         -
                            );
 4569         -
                            ::pretty_assertions::assert_eq!(
 4570         -
                                input.header_timestamp_list,
 4571         -
                                expected.header_timestamp_list,
 4572         -
                                "Unexpected value for `header_timestamp_list`"
 4573         -
                            );
 4574         -
                            ::pretty_assertions::assert_eq!(
 4575         -
                                input.header_enum,
 4576         -
                                expected.header_enum,
 4577         -
                                "Unexpected value for `header_enum`"
 4578         -
                            );
 4579         -
                            ::pretty_assertions::assert_eq!(
 4580         -
                                input.header_enum_list,
 4581         -
                                expected.header_enum_list,
 4582         -
                                "Unexpected value for `header_enum_list`"
 4583         -
                            );
 4584         -
                            ::pretty_assertions::assert_eq!(
 4585         -
                                input.header_integer_enum,
 4586         -
                                expected.header_integer_enum,
 4587         -
                                "Unexpected value for `header_integer_enum`"
 4588         -
                            );
 4589         -
                            ::pretty_assertions::assert_eq!(
 4590         -
                                input.header_integer_enum_list,
 4591         -
                                expected.header_integer_enum_list,
 4592         -
                                "Unexpected value for `header_integer_enum_list`"
 4593         -
                            );
 4594         -
                            let response = crate::output::InputAndOutputWithHeadersOutput {
 4595         -
                                header_string: ::std::option::Option::None,
 4596         -
                                header_byte: ::std::option::Option::None,
 4597         -
                                header_short: ::std::option::Option::None,
 4598         -
                                header_integer: ::std::option::Option::None,
 4599         -
                                header_long: ::std::option::Option::None,
 4600         -
                                header_float: ::std::option::Option::None,
 4601         -
                                header_double: ::std::option::Option::None,
 4602         -
                                header_true_bool: ::std::option::Option::None,
 4603         -
                                header_false_bool: ::std::option::Option::None,
 4604         -
                                header_string_list: ::std::option::Option::None,
 4605         -
                                header_string_set: ::std::option::Option::None,
 4606         -
                                header_integer_list: ::std::option::Option::None,
 4607         -
                                header_boolean_list: ::std::option::Option::None,
 4608         -
                                header_timestamp_list: ::std::option::Option::None,
 4609         -
                                header_enum: ::std::option::Option::None,
 4610         -
                                header_enum_list: ::std::option::Option::None,
 4611         -
                                header_integer_enum: ::std::option::Option::None,
 4612         -
                                header_integer_enum_list: ::std::option::Option::None,
 4613         -
                            };
 4614         -
                            Ok(response)
 4615         -
                        };
        3518  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 4616   3519   
                                    sender.send(()).await.expect("receiver dropped early");
 4617   3520   
                                    result
 4618   3521   
                                }
 4619         -
                },
 4620         -
            )
        3522  +
                            })
 4621   3523   
                            .build_unchecked();
 4622   3524   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4623   3525   
                .await
 4624   3526   
                .expect("unable to make an HTTP request");
 4625         -
        assert!(receiver.recv().await.is_some());
        3527  +
            ::pretty_assertions::assert_eq!(
        3528  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3529  +
                http_response.status()
        3530  +
            );
        3531  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3532  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3533  +
                http_response.headers(),
        3534  +
                expected_headers,
        3535  +
            ));
 4626   3536   
        }
 4627         -
    /// Tests requests with timestamp header bindings
 4628         -
    /// Test ID: RestJsonInputAndOutputWithTimestampHeaders
        3537  +
    }
        3538  +
    /// By default, epoch second timestamps as strings are rejected with a
        3539  +
    /// 400 SerializationException
        3540  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case1
 4629   3541   
    #[::tokio::test]
 4630         -
    async fn rest_json_input_and_output_with_timestamp_headers_request() {
        3542  +
    #[::tracing_test::traced_test]
        3543  +
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case1_malformed_request(
        3544  +
    ) {
        3545  +
        {
 4631   3546   
            #[allow(unused_mut)]
 4632   3547   
            let mut http_request = http::Request::builder()
 4633         -
            .uri("/InputAndOutputWithHeaders")
        3548  +
                .uri("/MalformedTimestampBodyDefault")
 4634   3549   
                .method("POST")
 4635         -
            .header(
 4636         -
                "X-TimestampList",
 4637         -
                "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT",
 4638         -
            )
        3550  +
                .header("content-type", "application/json")
 4639   3551   
                .body(::aws_smithy_http_server::body::Body::from(
 4640         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3552  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1515531081\" }".as_bytes()),
 4641   3553   
                ))
 4642   3554   
                .unwrap();
 4643   3555   
            #[allow(unused_mut)]
 4644   3556   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4645   3557   
            let config = crate::service::RestJsonConfig::builder().build();
 4646   3558   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4647         -
            .input_and_output_with_headers(
 4648         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
        3559  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 4649   3560   
                                let sender = sender.clone();
 4650   3561   
                                async move {
 4651         -
                        let result = {
 4652         -
                            use ::aws_smithy_protocol_test::FloatEquals;
 4653         -
                            let expected = crate::input::InputAndOutputWithHeadersInput {
 4654         -
                                header_timestamp_list: ::std::option::Option::Some(vec![
 4655         -
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
 4656         -
                                        1576540098, 0_f64,
 4657         -
                                    ),
 4658         -
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
 4659         -
                                        1576540098, 0_f64,
 4660         -
                                    ),
 4661         -
                                ]),
 4662         -
                                header_string: ::std::option::Option::None,
 4663         -
                                header_byte: ::std::option::Option::None,
 4664         -
                                header_short: ::std::option::Option::None,
 4665         -
                                header_integer: ::std::option::Option::None,
 4666         -
                                header_long: ::std::option::Option::None,
 4667         -
                                header_float: ::std::option::Option::None,
 4668         -
                                header_double: ::std::option::Option::None,
 4669         -
                                header_true_bool: ::std::option::Option::None,
 4670         -
                                header_false_bool: ::std::option::Option::None,
 4671         -
                                header_string_list: ::std::option::Option::None,
 4672         -
                                header_string_set: ::std::option::Option::None,
 4673         -
                                header_integer_list: ::std::option::Option::None,
 4674         -
                                header_boolean_list: ::std::option::Option::None,
 4675         -
                                header_enum: ::std::option::Option::None,
 4676         -
                                header_enum_list: ::std::option::Option::None,
 4677         -
                                header_integer_enum: ::std::option::Option::None,
 4678         -
                                header_integer_enum_list: ::std::option::Option::None,
 4679         -
                            };
 4680         -
                            ::pretty_assertions::assert_eq!(
 4681         -
                                input.header_string,
 4682         -
                                expected.header_string,
 4683         -
                                "Unexpected value for `header_string`"
 4684         -
                            );
 4685         -
                            ::pretty_assertions::assert_eq!(
 4686         -
                                input.header_byte,
 4687         -
                                expected.header_byte,
 4688         -
                                "Unexpected value for `header_byte`"
 4689         -
                            );
 4690         -
                            ::pretty_assertions::assert_eq!(
 4691         -
                                input.header_short,
 4692         -
                                expected.header_short,
 4693         -
                                "Unexpected value for `header_short`"
 4694         -
                            );
 4695         -
                            ::pretty_assertions::assert_eq!(
 4696         -
                                input.header_integer,
 4697         -
                                expected.header_integer,
 4698         -
                                "Unexpected value for `header_integer`"
 4699         -
                            );
 4700         -
                            ::pretty_assertions::assert_eq!(
 4701         -
                                input.header_long,
 4702         -
                                expected.header_long,
 4703         -
                                "Unexpected value for `header_long`"
 4704         -
                            );
 4705         -
                            assert!(
 4706         -
                                input.header_float.float_equals(&expected.header_float),
 4707         -
                                "Unexpected value for `header_float` {:?} vs. {:?}",
 4708         -
                                expected.header_float,
 4709         -
                                input.header_float
 4710         -
                            );
 4711         -
                            assert!(
 4712         -
                                input.header_double.float_equals(&expected.header_double),
 4713         -
                                "Unexpected value for `header_double` {:?} vs. {:?}",
 4714         -
                                expected.header_double,
 4715         -
                                input.header_double
 4716         -
                            );
 4717         -
                            ::pretty_assertions::assert_eq!(
 4718         -
                                input.header_true_bool,
 4719         -
                                expected.header_true_bool,
 4720         -
                                "Unexpected value for `header_true_bool`"
 4721         -
                            );
 4722         -
                            ::pretty_assertions::assert_eq!(
 4723         -
                                input.header_false_bool,
 4724         -
                                expected.header_false_bool,
 4725         -
                                "Unexpected value for `header_false_bool`"
 4726         -
                            );
 4727         -
                            ::pretty_assertions::assert_eq!(
 4728         -
                                input.header_string_list,
 4729         -
                                expected.header_string_list,
 4730         -
                                "Unexpected value for `header_string_list`"
 4731         -
                            );
 4732         -
                            ::pretty_assertions::assert_eq!(
 4733         -
                                input.header_string_set,
 4734         -
                                expected.header_string_set,
 4735         -
                                "Unexpected value for `header_string_set`"
 4736         -
                            );
 4737         -
                            ::pretty_assertions::assert_eq!(
 4738         -
                                input.header_integer_list,
 4739         -
                                expected.header_integer_list,
 4740         -
                                "Unexpected value for `header_integer_list`"
 4741         -
                            );
 4742         -
                            ::pretty_assertions::assert_eq!(
 4743         -
                                input.header_boolean_list,
 4744         -
                                expected.header_boolean_list,
 4745         -
                                "Unexpected value for `header_boolean_list`"
 4746         -
                            );
 4747         -
                            ::pretty_assertions::assert_eq!(
 4748         -
                                input.header_timestamp_list,
 4749         -
                                expected.header_timestamp_list,
 4750         -
                                "Unexpected value for `header_timestamp_list`"
 4751         -
                            );
 4752         -
                            ::pretty_assertions::assert_eq!(
 4753         -
                                input.header_enum,
 4754         -
                                expected.header_enum,
 4755         -
                                "Unexpected value for `header_enum`"
 4756         -
                            );
 4757         -
                            ::pretty_assertions::assert_eq!(
 4758         -
                                input.header_enum_list,
 4759         -
                                expected.header_enum_list,
 4760         -
                                "Unexpected value for `header_enum_list`"
 4761         -
                            );
 4762         -
                            ::pretty_assertions::assert_eq!(
 4763         -
                                input.header_integer_enum,
 4764         -
                                expected.header_integer_enum,
 4765         -
                                "Unexpected value for `header_integer_enum`"
 4766         -
                            );
 4767         -
                            ::pretty_assertions::assert_eq!(
 4768         -
                                input.header_integer_enum_list,
 4769         -
                                expected.header_integer_enum_list,
 4770         -
                                "Unexpected value for `header_integer_enum_list`"
 4771         -
                            );
 4772         -
                            let response = crate::output::InputAndOutputWithHeadersOutput {
 4773         -
                                header_string: ::std::option::Option::None,
 4774         -
                                header_byte: ::std::option::Option::None,
 4775         -
                                header_short: ::std::option::Option::None,
 4776         -
                                header_integer: ::std::option::Option::None,
 4777         -
                                header_long: ::std::option::Option::None,
 4778         -
                                header_float: ::std::option::Option::None,
 4779         -
                                header_double: ::std::option::Option::None,
 4780         -
                                header_true_bool: ::std::option::Option::None,
 4781         -
                                header_false_bool: ::std::option::Option::None,
 4782         -
                                header_string_list: ::std::option::Option::None,
 4783         -
                                header_string_set: ::std::option::Option::None,
 4784         -
                                header_integer_list: ::std::option::Option::None,
 4785         -
                                header_boolean_list: ::std::option::Option::None,
 4786         -
                                header_timestamp_list: ::std::option::Option::None,
 4787         -
                                header_enum: ::std::option::Option::None,
 4788         -
                                header_enum_list: ::std::option::Option::None,
 4789         -
                                header_integer_enum: ::std::option::Option::None,
 4790         -
                                header_integer_enum_list: ::std::option::Option::None,
 4791         -
                            };
 4792         -
                            Ok(response)
 4793         -
                        };
        3562  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 4794   3563   
                                    sender.send(()).await.expect("receiver dropped early");
 4795   3564   
                                    result
 4796   3565   
                                }
 4797         -
                },
 4798         -
            )
        3566  +
                            })
 4799   3567   
                            .build_unchecked();
 4800   3568   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4801   3569   
                .await
 4802   3570   
                .expect("unable to make an HTTP request");
 4803         -
        assert!(receiver.recv().await.is_some());
        3571  +
            ::pretty_assertions::assert_eq!(
        3572  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3573  +
                http_response.status()
        3574  +
            );
        3575  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3576  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3577  +
                http_response.headers(),
        3578  +
                expected_headers,
        3579  +
            ));
 4804   3580   
        }
 4805         -
    /// Tests requests with enum header bindings
 4806         -
    /// Test ID: RestJsonInputAndOutputWithEnumHeaders
        3581  +
    }
        3582  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3583  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case0
 4807   3584   
    #[::tokio::test]
 4808         -
    async fn rest_json_input_and_output_with_enum_headers_request() {
        3585  +
    #[::tracing_test::traced_test]
        3586  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case0_malformed_request(
        3587  +
    ) {
        3588  +
        {
 4809   3589   
            #[allow(unused_mut)]
 4810   3590   
            let mut http_request = http::Request::builder()
 4811         -
            .uri("/InputAndOutputWithHeaders")
        3591  +
                .uri("/MalformedTimestampBodyDefault")
 4812   3592   
                .method("POST")
 4813         -
            .header("X-Enum", "Foo")
 4814         -
            .header("X-EnumList", "Foo, Bar, Baz")
        3593  +
                .header("content-type", "application/json")
 4815   3594   
                .body(::aws_smithy_http_server::body::Body::from(
 4816         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3595  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": true }".as_bytes()),
 4817   3596   
                ))
 4818   3597   
                .unwrap();
 4819   3598   
            #[allow(unused_mut)]
 4820   3599   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 4821   3600   
            let config = crate::service::RestJsonConfig::builder().build();
 4822   3601   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 4823         -
            .input_and_output_with_headers(
 4824         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
        3602  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 4825   3603   
                                let sender = sender.clone();
 4826   3604   
                                async move {
 4827         -
                        let result = {
 4828         -
                            use ::aws_smithy_protocol_test::FloatEquals;
 4829         -
                            let expected = crate::input::InputAndOutputWithHeadersInput {
 4830         -
                                header_enum: ::std::option::Option::Some(
 4831         -
                                    "Foo"
 4832         -
                                        .parse::<crate::model::FooEnum>()
 4833         -
                                        .expect("static value validated to member"),
 4834         -
                                ),
 4835         -
                                header_enum_list: ::std::option::Option::Some(vec![
 4836         -
                                    "Foo"
 4837         -
                                        .parse::<crate::model::FooEnum>()
 4838         -
                                        .expect("static value validated to member"),
 4839         -
                                    "Bar"
 4840         -
                                        .parse::<crate::model::FooEnum>()
 4841         -
                                        .expect("static value validated to member"),
 4842         -
                                    "Baz"
 4843         -
                                        .parse::<crate::model::FooEnum>()
 4844         -
                                        .expect("static value validated to member"),
 4845         -
                                ]),
 4846         -
                                header_string: ::std::option::Option::None,
 4847         -
                                header_byte: ::std::option::Option::None,
 4848         -
                                header_short: ::std::option::Option::None,
 4849         -
                                header_integer: ::std::option::Option::None,
 4850         -
                                header_long: ::std::option::Option::None,
 4851         -
                                header_float: ::std::option::Option::None,
 4852         -
                                header_double: ::std::option::Option::None,
 4853         -
                                header_true_bool: ::std::option::Option::None,
 4854         -
                                header_false_bool: ::std::option::Option::None,
 4855         -
                                header_string_list: ::std::option::Option::None,
 4856         -
                                header_string_set: ::std::option::Option::None,
 4857         -
                                header_integer_list: ::std::option::Option::None,
 4858         -
                                header_boolean_list: ::std::option::Option::None,
 4859         -
                                header_timestamp_list: ::std::option::Option::None,
 4860         -
                                header_integer_enum: ::std::option::Option::None,
 4861         -
                                header_integer_enum_list: ::std::option::Option::None,
 4862         -
                            };
 4863         -
                            ::pretty_assertions::assert_eq!(
 4864         -
                                input.header_string,
 4865         -
                                expected.header_string,
 4866         -
                                "Unexpected value for `header_string`"
 4867         -
                            );
 4868         -
                            ::pretty_assertions::assert_eq!(
 4869         -
                                input.header_byte,
 4870         -
                                expected.header_byte,
 4871         -
                                "Unexpected value for `header_byte`"
 4872         -
                            );
 4873         -
                            ::pretty_assertions::assert_eq!(
 4874         -
                                input.header_short,
 4875         -
                                expected.header_short,
 4876         -
                                "Unexpected value for `header_short`"
 4877         -
                            );
 4878         -
                            ::pretty_assertions::assert_eq!(
 4879         -
                                input.header_integer,
 4880         -
                                expected.header_integer,
 4881         -
                                "Unexpected value for `header_integer`"
 4882         -
                            );
 4883         -
                            ::pretty_assertions::assert_eq!(
 4884         -
                                input.header_long,
 4885         -
                                expected.header_long,
 4886         -
                                "Unexpected value for `header_long`"
 4887         -
                            );
 4888         -
                            assert!(
 4889         -
                                input.header_float.float_equals(&expected.header_float),
 4890         -
                                "Unexpected value for `header_float` {:?} vs. {:?}",
 4891         -
                                expected.header_float,
 4892         -
                                input.header_float
 4893         -
                            );
 4894         -
                            assert!(
 4895         -
                                input.header_double.float_equals(&expected.header_double),
 4896         -
                                "Unexpected value for `header_double` {:?} vs. {:?}",
 4897         -
                                expected.header_double,
 4898         -
                                input.header_double
 4899         -
                            );
 4900         -
                            ::pretty_assertions::assert_eq!(
 4901         -
                                input.header_true_bool,
 4902         -
                                expected.header_true_bool,
 4903         -
                                "Unexpected value for `header_true_bool`"
 4904         -
                            );
 4905         -
                            ::pretty_assertions::assert_eq!(
 4906         -
                                input.header_false_bool,
 4907         -
                                expected.header_false_bool,
 4908         -
                                "Unexpected value for `header_false_bool`"
 4909         -
                            );
 4910         -
                            ::pretty_assertions::assert_eq!(
 4911         -
                                input.header_string_list,
 4912         -
                                expected.header_string_list,
 4913         -
                                "Unexpected value for `header_string_list`"
 4914         -
                            );
 4915         -
                            ::pretty_assertions::assert_eq!(
 4916         -
                                input.header_string_set,
 4917         -
                                expected.header_string_set,
 4918         -
                                "Unexpected value for `header_string_set`"
 4919         -
                            );
 4920         -
                            ::pretty_assertions::assert_eq!(
 4921         -
                                input.header_integer_list,
 4922         -
                                expected.header_integer_list,
 4923         -
                                "Unexpected value for `header_integer_list`"
 4924         -
                            );
 4925         -
                            ::pretty_assertions::assert_eq!(
 4926         -
                                input.header_boolean_list,
 4927         -
                                expected.header_boolean_list,
 4928         -
                                "Unexpected value for `header_boolean_list`"
 4929         -
                            );
 4930         -
                            ::pretty_assertions::assert_eq!(
 4931         -
                                input.header_timestamp_list,
 4932         -
                                expected.header_timestamp_list,
 4933         -
                                "Unexpected value for `header_timestamp_list`"
 4934         -
                            );
 4935         -
                            ::pretty_assertions::assert_eq!(
 4936         -
                                input.header_enum,
 4937         -
                                expected.header_enum,
 4938         -
                                "Unexpected value for `header_enum`"
 4939         -
                            );
 4940         -
                            ::pretty_assertions::assert_eq!(
 4941         -
                                input.header_enum_list,
 4942         -
                                expected.header_enum_list,
 4943         -
                                "Unexpected value for `header_enum_list`"
 4944         -
                            );
 4945         -
                            ::pretty_assertions::assert_eq!(
 4946         -
                                input.header_integer_enum,
 4947         -
                                expected.header_integer_enum,
 4948         -
                                "Unexpected value for `header_integer_enum`"
 4949         -
                            );
 4950         -
                            ::pretty_assertions::assert_eq!(
 4951         -
                                input.header_integer_enum_list,
 4952         -
                                expected.header_integer_enum_list,
 4953         -
                                "Unexpected value for `header_integer_enum_list`"
 4954         -
                            );
 4955         -
                            let response = crate::output::InputAndOutputWithHeadersOutput {
 4956         -
                                header_string: ::std::option::Option::None,
 4957         -
                                header_byte: ::std::option::Option::None,
 4958         -
                                header_short: ::std::option::Option::None,
 4959         -
                                header_integer: ::std::option::Option::None,
 4960         -
                                header_long: ::std::option::Option::None,
 4961         -
                                header_float: ::std::option::Option::None,
 4962         -
                                header_double: ::std::option::Option::None,
 4963         -
                                header_true_bool: ::std::option::Option::None,
 4964         -
                                header_false_bool: ::std::option::Option::None,
 4965         -
                                header_string_list: ::std::option::Option::None,
 4966         -
                                header_string_set: ::std::option::Option::None,
 4967         -
                                header_integer_list: ::std::option::Option::None,
 4968         -
                                header_boolean_list: ::std::option::Option::None,
 4969         -
                                header_timestamp_list: ::std::option::Option::None,
 4970         -
                                header_enum: ::std::option::Option::None,
 4971         -
                                header_enum_list: ::std::option::Option::None,
 4972         -
                                header_integer_enum: ::std::option::Option::None,
 4973         -
                                header_integer_enum_list: ::std::option::Option::None,
 4974         -
                            };
 4975         -
                            Ok(response)
 4976         -
                        };
        3605  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 4977   3606   
                                    sender.send(()).await.expect("receiver dropped early");
 4978   3607   
                                    result
 4979   3608   
                                }
 4980         -
                },
 4981         -
            )
        3609  +
                            })
 4982   3610   
                            .build_unchecked();
 4983   3611   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 4984   3612   
                .await
 4985   3613   
                .expect("unable to make an HTTP request");
 4986         -
        assert!(receiver.recv().await.is_some());
        3614  +
            ::pretty_assertions::assert_eq!(
        3615  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3616  +
                http_response.status()
        3617  +
            );
        3618  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3619  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3620  +
                http_response.headers(),
        3621  +
                expected_headers,
        3622  +
            ));
 4987   3623   
        }
 4988         -
    /// Tests requests with intEnum header bindings
 4989         -
    /// Test ID: RestJsonInputAndOutputWithIntEnumHeaders
        3624  +
    }
        3625  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3626  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case1
 4990   3627   
    #[::tokio::test]
 4991         -
    async fn rest_json_input_and_output_with_int_enum_headers_request() {
        3628  +
    #[::tracing_test::traced_test]
        3629  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case1_malformed_request(
        3630  +
    ) {
        3631  +
        {
 4992   3632   
            #[allow(unused_mut)]
 4993   3633   
            let mut http_request = http::Request::builder()
 4994         -
            .uri("/InputAndOutputWithHeaders")
        3634  +
                .uri("/MalformedTimestampBodyDefault")
 4995   3635   
                .method("POST")
 4996         -
            .header("X-IntegerEnum", "1")
 4997         -
            .header("X-IntegerEnumList", "1, 2, 3")
        3636  +
                .header("content-type", "application/json")
 4998   3637   
                .body(::aws_smithy_http_server::body::Body::from(
 4999         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3638  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081ABC }".as_bytes()),
 5000   3639   
                ))
 5001   3640   
                .unwrap();
 5002   3641   
            #[allow(unused_mut)]
 5003   3642   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5004   3643   
            let config = crate::service::RestJsonConfig::builder().build();
 5005   3644   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5006         -
            .input_and_output_with_headers(
 5007         -
                move |input: crate::input::InputAndOutputWithHeadersInput| {
        3645  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 5008   3646   
                                let sender = sender.clone();
 5009   3647   
                                async move {
 5010         -
                        let result = {
 5011         -
                            use ::aws_smithy_protocol_test::FloatEquals;
 5012         -
                            let expected = crate::input::InputAndOutputWithHeadersInput {
 5013         -
                                header_integer_enum: ::std::option::Option::Some(1),
 5014         -
                                header_integer_enum_list: ::std::option::Option::Some(vec![
 5015         -
                                    1, 2, 3,
 5016         -
                                ]),
 5017         -
                                header_string: ::std::option::Option::None,
 5018         -
                                header_byte: ::std::option::Option::None,
 5019         -
                                header_short: ::std::option::Option::None,
 5020         -
                                header_integer: ::std::option::Option::None,
 5021         -
                                header_long: ::std::option::Option::None,
 5022         -
                                header_float: ::std::option::Option::None,
 5023         -
                                header_double: ::std::option::Option::None,
 5024         -
                                header_true_bool: ::std::option::Option::None,
 5025         -
                                header_false_bool: ::std::option::Option::None,
 5026         -
                                header_string_list: ::std::option::Option::None,
 5027         -
                                header_string_set: ::std::option::Option::None,
 5028         -
                                header_integer_list: ::std::option::Option::None,
 5029         -
                                header_boolean_list: ::std::option::Option::None,
 5030         -
                                header_timestamp_list: ::std::option::Option::None,
 5031         -
                                header_enum: ::std::option::Option::None,
 5032         -
                                header_enum_list: ::std::option::Option::None,
 5033         -
                            };
 5034         -
                            ::pretty_assertions::assert_eq!(
 5035         -
                                input.header_string,
 5036         -
                                expected.header_string,
 5037         -
                                "Unexpected value for `header_string`"
 5038         -
                            );
 5039         -
                            ::pretty_assertions::assert_eq!(
 5040         -
                                input.header_byte,
 5041         -
                                expected.header_byte,
 5042         -
                                "Unexpected value for `header_byte`"
 5043         -
                            );
 5044         -
                            ::pretty_assertions::assert_eq!(
 5045         -
                                input.header_short,
 5046         -
                                expected.header_short,
 5047         -
                                "Unexpected value for `header_short`"
 5048         -
                            );
 5049         -
                            ::pretty_assertions::assert_eq!(
 5050         -
                                input.header_integer,
 5051         -
                                expected.header_integer,
 5052         -
                                "Unexpected value for `header_integer`"
 5053         -
                            );
 5054         -
                            ::pretty_assertions::assert_eq!(
 5055         -
                                input.header_long,
 5056         -
                                expected.header_long,
 5057         -
                                "Unexpected value for `header_long`"
 5058         -
                            );
 5059         -
                            assert!(
 5060         -
                                input.header_float.float_equals(&expected.header_float),
 5061         -
                                "Unexpected value for `header_float` {:?} vs. {:?}",
 5062         -
                                expected.header_float,
 5063         -
                                input.header_float
 5064         -
                            );
 5065         -
                            assert!(
 5066         -
                                input.header_double.float_equals(&expected.header_double),
 5067         -
                                "Unexpected value for `header_double` {:?} vs. {:?}",
 5068         -
                                expected.header_double,
 5069         -
                                input.header_double
 5070         -
                            );
 5071         -
                            ::pretty_assertions::assert_eq!(
 5072         -
                                input.header_true_bool,
 5073         -
                                expected.header_true_bool,
 5074         -
                                "Unexpected value for `header_true_bool`"
 5075         -
                            );
 5076         -
                            ::pretty_assertions::assert_eq!(
 5077         -
                                input.header_false_bool,
 5078         -
                                expected.header_false_bool,
 5079         -
                                "Unexpected value for `header_false_bool`"
 5080         -
                            );
 5081         -
                            ::pretty_assertions::assert_eq!(
 5082         -
                                input.header_string_list,
 5083         -
                                expected.header_string_list,
 5084         -
                                "Unexpected value for `header_string_list`"
 5085         -
                            );
 5086         -
                            ::pretty_assertions::assert_eq!(
 5087         -
                                input.header_string_set,
 5088         -
                                expected.header_string_set,
 5089         -
                                "Unexpected value for `header_string_set`"
 5090         -
                            );
 5091         -
                            ::pretty_assertions::assert_eq!(
 5092         -
                                input.header_integer_list,
 5093         -
                                expected.header_integer_list,
 5094         -
                                "Unexpected value for `header_integer_list`"
 5095         -
                            );
 5096         -
                            ::pretty_assertions::assert_eq!(
 5097         -
                                input.header_boolean_list,
 5098         -
                                expected.header_boolean_list,
 5099         -
                                "Unexpected value for `header_boolean_list`"
 5100         -
                            );
 5101         -
                            ::pretty_assertions::assert_eq!(
 5102         -
                                input.header_timestamp_list,
 5103         -
                                expected.header_timestamp_list,
 5104         -
                                "Unexpected value for `header_timestamp_list`"
 5105         -
                            );
 5106         -
                            ::pretty_assertions::assert_eq!(
 5107         -
                                input.header_enum,
 5108         -
                                expected.header_enum,
 5109         -
                                "Unexpected value for `header_enum`"
 5110         -
                            );
 5111         -
                            ::pretty_assertions::assert_eq!(
 5112         -
                                input.header_enum_list,
 5113         -
                                expected.header_enum_list,
 5114         -
                                "Unexpected value for `header_enum_list`"
 5115         -
                            );
 5116         -
                            ::pretty_assertions::assert_eq!(
 5117         -
                                input.header_integer_enum,
 5118         -
                                expected.header_integer_enum,
 5119         -
                                "Unexpected value for `header_integer_enum`"
 5120         -
                            );
 5121         -
                            ::pretty_assertions::assert_eq!(
 5122         -
                                input.header_integer_enum_list,
 5123         -
                                expected.header_integer_enum_list,
 5124         -
                                "Unexpected value for `header_integer_enum_list`"
 5125         -
                            );
 5126         -
                            let response = crate::output::InputAndOutputWithHeadersOutput {
 5127         -
                                header_string: ::std::option::Option::None,
 5128         -
                                header_byte: ::std::option::Option::None,
 5129         -
                                header_short: ::std::option::Option::None,
 5130         -
                                header_integer: ::std::option::Option::None,
 5131         -
                                header_long: ::std::option::Option::None,
 5132         -
                                header_float: ::std::option::Option::None,
 5133         -
                                header_double: ::std::option::Option::None,
 5134         -
                                header_true_bool: ::std::option::Option::None,
 5135         -
                                header_false_bool: ::std::option::Option::None,
 5136         -
                                header_string_list: ::std::option::Option::None,
 5137         -
                                header_string_set: ::std::option::Option::None,
 5138         -
                                header_integer_list: ::std::option::Option::None,
 5139         -
                                header_boolean_list: ::std::option::Option::None,
 5140         -
                                header_timestamp_list: ::std::option::Option::None,
 5141         -
                                header_enum: ::std::option::Option::None,
 5142         -
                                header_enum_list: ::std::option::Option::None,
 5143         -
                                header_integer_enum: ::std::option::Option::None,
 5144         -
                                header_integer_enum_list: ::std::option::Option::None,
 5145         -
                            };
 5146         -
                            Ok(response)
 5147         -
                        };
        3648  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 5148   3649   
                                    sender.send(()).await.expect("receiver dropped early");
 5149   3650   
                                    result
 5150   3651   
                                }
 5151         -
                },
 5152         -
            )
        3652  +
                            })
 5153   3653   
                            .build_unchecked();
 5154   3654   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5155   3655   
                .await
 5156   3656   
                .expect("unable to make an HTTP request");
 5157         -
        assert!(receiver.recv().await.is_some());
        3657  +
            ::pretty_assertions::assert_eq!(
        3658  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3659  +
                http_response.status()
        3660  +
            );
        3661  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3662  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3663  +
                http_response.headers(),
        3664  +
                expected_headers,
        3665  +
            ));
 5158   3666   
        }
 5159         -
    /// Supports handling NaN float header values.
 5160         -
    /// Test ID: RestJsonSupportsNaNFloatHeaderInputs
        3667  +
    }
        3668  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3669  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case2
 5161   3670   
    #[::tokio::test]
 5162         -
    async fn rest_json_supports_na_n_float_header_inputs_request() {
        3671  +
    #[::tracing_test::traced_test]
        3672  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case2_malformed_request(
        3673  +
    ) {
        3674  +
        {
 5163   3675   
            #[allow(unused_mut)]
 5164   3676   
            let mut http_request = http::Request::builder()
 5165         -
            .uri("/InputAndOutputWithHeaders")
        3677  +
                .uri("/MalformedTimestampBodyDefault")
 5166   3678   
                .method("POST")
 5167         -
            .header("X-Double", "NaN")
 5168         -
            .header("X-Float", "NaN")
        3679  +
                .header("content-type", "application/json")
 5169   3680   
                .body(::aws_smithy_http_server::body::Body::from(
 5170         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3681  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 0x42 }".as_bytes()),
 5171   3682   
                ))
 5172   3683   
                .unwrap();
 5173   3684   
            #[allow(unused_mut)]
 5174   3685   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5175   3686   
            let config = crate::service::RestJsonConfig::builder().build();
 5176   3687   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5177         -
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
        3688  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 5178   3689   
                                let sender = sender.clone();
 5179   3690   
                                async move {
 5180         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 5181         -
        let expected =
 5182         -
            crate::input::InputAndOutputWithHeadersInput {
 5183         -
                header_float:
 5184         -
                    ::std::option::Option::Some(
 5185         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
 5186         -
                    )
 5187         -
                ,
 5188         -
                header_double:
 5189         -
                    ::std::option::Option::Some(
 5190         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
 5191         -
                    )
 5192         -
                ,
 5193         -
                header_string:
 5194         -
                    ::std::option::Option::None
 5195         -
                ,
 5196         -
                header_byte:
 5197         -
                    ::std::option::Option::None
 5198         -
                ,
 5199         -
                header_short:
 5200         -
                    ::std::option::Option::None
 5201         -
                ,
 5202         -
                header_integer:
 5203         -
                    ::std::option::Option::None
 5204         -
                ,
 5205         -
                header_long:
 5206         -
                    ::std::option::Option::None
 5207         -
                ,
 5208         -
                header_true_bool:
 5209         -
                    ::std::option::Option::None
 5210         -
                ,
 5211         -
                header_false_bool:
 5212         -
                    ::std::option::Option::None
 5213         -
                ,
 5214         -
                header_string_list:
 5215         -
                    ::std::option::Option::None
 5216         -
                ,
 5217         -
                header_string_set:
 5218         -
                    ::std::option::Option::None
 5219         -
                ,
 5220         -
                header_integer_list:
 5221         -
                    ::std::option::Option::None
 5222         -
                ,
 5223         -
                header_boolean_list:
 5224         -
                    ::std::option::Option::None
 5225         -
                ,
 5226         -
                header_timestamp_list:
 5227         -
                    ::std::option::Option::None
 5228         -
                ,
 5229         -
                header_enum:
 5230         -
                    ::std::option::Option::None
 5231         -
                ,
 5232         -
                header_enum_list:
 5233         -
                    ::std::option::Option::None
 5234         -
                ,
 5235         -
                header_integer_enum:
 5236         -
                    ::std::option::Option::None
 5237         -
                ,
 5238         -
                header_integer_enum_list:
 5239         -
                    ::std::option::Option::None
 5240         -
                ,
 5241         -
            }
 5242         -
        ;
 5243         -
        ::pretty_assertions::assert_eq!(input.header_string, expected.header_string, "Unexpected value for `header_string`");
 5244         -
        ::pretty_assertions::assert_eq!(input.header_byte, expected.header_byte, "Unexpected value for `header_byte`");
 5245         -
        ::pretty_assertions::assert_eq!(input.header_short, expected.header_short, "Unexpected value for `header_short`");
 5246         -
        ::pretty_assertions::assert_eq!(input.header_integer, expected.header_integer, "Unexpected value for `header_integer`");
 5247         -
        ::pretty_assertions::assert_eq!(input.header_long, expected.header_long, "Unexpected value for `header_long`");
 5248         -
        assert!(input.header_float.float_equals(&expected.header_float),
 5249         -
                                            "Unexpected value for `header_float` {:?} vs. {:?}", expected.header_float, input.header_float);
 5250         -
        assert!(input.header_double.float_equals(&expected.header_double),
 5251         -
                                            "Unexpected value for `header_double` {:?} vs. {:?}", expected.header_double, input.header_double);
 5252         -
        ::pretty_assertions::assert_eq!(input.header_true_bool, expected.header_true_bool, "Unexpected value for `header_true_bool`");
 5253         -
        ::pretty_assertions::assert_eq!(input.header_false_bool, expected.header_false_bool, "Unexpected value for `header_false_bool`");
 5254         -
        ::pretty_assertions::assert_eq!(input.header_string_list, expected.header_string_list, "Unexpected value for `header_string_list`");
 5255         -
        ::pretty_assertions::assert_eq!(input.header_string_set, expected.header_string_set, "Unexpected value for `header_string_set`");
 5256         -
        ::pretty_assertions::assert_eq!(input.header_integer_list, expected.header_integer_list, "Unexpected value for `header_integer_list`");
 5257         -
        ::pretty_assertions::assert_eq!(input.header_boolean_list, expected.header_boolean_list, "Unexpected value for `header_boolean_list`");
 5258         -
        ::pretty_assertions::assert_eq!(input.header_timestamp_list, expected.header_timestamp_list, "Unexpected value for `header_timestamp_list`");
 5259         -
        ::pretty_assertions::assert_eq!(input.header_enum, expected.header_enum, "Unexpected value for `header_enum`");
 5260         -
        ::pretty_assertions::assert_eq!(input.header_enum_list, expected.header_enum_list, "Unexpected value for `header_enum_list`");
 5261         -
        ::pretty_assertions::assert_eq!(input.header_integer_enum, expected.header_integer_enum, "Unexpected value for `header_integer_enum`");
 5262         -
        ::pretty_assertions::assert_eq!(input.header_integer_enum_list, expected.header_integer_enum_list, "Unexpected value for `header_integer_enum_list`");
 5263         -
        let response =
 5264         -
            crate::output::InputAndOutputWithHeadersOutput {
 5265         -
                header_string:
 5266         -
                    ::std::option::Option::None
 5267         -
                ,
 5268         -
                header_byte:
 5269         -
                    ::std::option::Option::None
 5270         -
                ,
 5271         -
                header_short:
 5272         -
                    ::std::option::Option::None
 5273         -
                ,
 5274         -
                header_integer:
 5275         -
                    ::std::option::Option::None
 5276         -
                ,
 5277         -
                header_long:
 5278         -
                    ::std::option::Option::None
 5279         -
                ,
 5280         -
                header_float:
 5281         -
                    ::std::option::Option::None
 5282         -
                ,
 5283         -
                header_double:
 5284         -
                    ::std::option::Option::None
 5285         -
                ,
 5286         -
                header_true_bool:
 5287         -
                    ::std::option::Option::None
 5288         -
                ,
 5289         -
                header_false_bool:
 5290         -
                    ::std::option::Option::None
 5291         -
                ,
 5292         -
                header_string_list:
 5293         -
                    ::std::option::Option::None
 5294         -
                ,
 5295         -
                header_string_set:
 5296         -
                    ::std::option::Option::None
 5297         -
                ,
 5298         -
                header_integer_list:
 5299         -
                    ::std::option::Option::None
 5300         -
                ,
 5301         -
                header_boolean_list:
 5302         -
                    ::std::option::Option::None
 5303         -
                ,
 5304         -
                header_timestamp_list:
 5305         -
                    ::std::option::Option::None
 5306         -
                ,
 5307         -
                header_enum:
 5308         -
                    ::std::option::Option::None
 5309         -
                ,
 5310         -
                header_enum_list:
 5311         -
                    ::std::option::Option::None
 5312         -
                ,
 5313         -
                header_integer_enum:
 5314         -
                    ::std::option::Option::None
 5315         -
                ,
 5316         -
                header_integer_enum_list:
 5317         -
                    ::std::option::Option::None
 5318         -
                ,
 5319         -
            }
 5320         -
        ;
 5321         -
        Ok(response) };
        3691  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 5322   3692   
                                    sender.send(()).await.expect("receiver dropped early");
 5323   3693   
                                    result
 5324   3694   
                                }
 5325   3695   
                            })
 5326   3696   
                            .build_unchecked();
 5327   3697   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5328   3698   
                .await
 5329   3699   
                .expect("unable to make an HTTP request");
 5330         -
        assert!(receiver.recv().await.is_some());
        3700  +
            ::pretty_assertions::assert_eq!(
        3701  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3702  +
                http_response.status()
        3703  +
            );
        3704  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3705  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3706  +
                http_response.headers(),
        3707  +
                expected_headers,
        3708  +
            ));
 5331   3709   
        }
 5332         -
    /// Supports handling Infinity float header values.
 5333         -
    /// Test ID: RestJsonSupportsInfinityFloatHeaderInputs
        3710  +
    }
        3711  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3712  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case3
 5334   3713   
    #[::tokio::test]
 5335         -
    async fn rest_json_supports_infinity_float_header_inputs_request() {
        3714  +
    #[::tracing_test::traced_test]
        3715  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case3_malformed_request(
        3716  +
    ) {
        3717  +
        {
 5336   3718   
            #[allow(unused_mut)]
 5337   3719   
            let mut http_request = http::Request::builder()
 5338         -
            .uri("/InputAndOutputWithHeaders")
        3720  +
                .uri("/MalformedTimestampBodyDefault")
 5339   3721   
                .method("POST")
 5340         -
            .header("X-Double", "Infinity")
 5341         -
            .header("X-Float", "Infinity")
        3722  +
                .header("content-type", "application/json")
 5342   3723   
                .body(::aws_smithy_http_server::body::Body::from(
 5343         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3724  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.123.456 }".as_bytes()),
 5344   3725   
                ))
 5345   3726   
                .unwrap();
 5346   3727   
            #[allow(unused_mut)]
 5347   3728   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5348   3729   
            let config = crate::service::RestJsonConfig::builder().build();
 5349   3730   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5350         -
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
        3731  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 5351   3732   
                                let sender = sender.clone();
 5352   3733   
                                async move {
 5353         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 5354         -
        let expected =
 5355         -
            crate::input::InputAndOutputWithHeadersInput {
 5356         -
                header_float:
 5357         -
                    ::std::option::Option::Some(
 5358         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
 5359         -
                    )
 5360         -
                ,
 5361         -
                header_double:
 5362         -
                    ::std::option::Option::Some(
 5363         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
 5364         -
                    )
 5365         -
                ,
 5366         -
                header_string:
 5367         -
                    ::std::option::Option::None
 5368         -
                ,
 5369         -
                header_byte:
 5370         -
                    ::std::option::Option::None
 5371         -
                ,
 5372         -
                header_short:
 5373         -
                    ::std::option::Option::None
 5374         -
                ,
 5375         -
                header_integer:
 5376         -
                    ::std::option::Option::None
 5377         -
                ,
 5378         -
                header_long:
 5379         -
                    ::std::option::Option::None
 5380         -
                ,
 5381         -
                header_true_bool:
 5382         -
                    ::std::option::Option::None
 5383         -
                ,
 5384         -
                header_false_bool:
 5385         -
                    ::std::option::Option::None
 5386         -
                ,
 5387         -
                header_string_list:
 5388         -
                    ::std::option::Option::None
 5389         -
                ,
 5390         -
                header_string_set:
 5391         -
                    ::std::option::Option::None
 5392         -
                ,
 5393         -
                header_integer_list:
 5394         -
                    ::std::option::Option::None
 5395         -
                ,
 5396         -
                header_boolean_list:
 5397         -
                    ::std::option::Option::None
 5398         -
                ,
 5399         -
                header_timestamp_list:
 5400         -
                    ::std::option::Option::None
 5401         -
                ,
 5402         -
                header_enum:
 5403         -
                    ::std::option::Option::None
 5404         -
                ,
 5405         -
                header_enum_list:
 5406         -
                    ::std::option::Option::None
 5407         -
                ,
 5408         -
                header_integer_enum:
 5409         -
                    ::std::option::Option::None
 5410         -
                ,
 5411         -
                header_integer_enum_list:
 5412         -
                    ::std::option::Option::None
 5413         -
                ,
 5414         -
            }
 5415         -
        ;
 5416         -
        ::pretty_assertions::assert_eq!(input.header_string, expected.header_string, "Unexpected value for `header_string`");
 5417         -
        ::pretty_assertions::assert_eq!(input.header_byte, expected.header_byte, "Unexpected value for `header_byte`");
 5418         -
        ::pretty_assertions::assert_eq!(input.header_short, expected.header_short, "Unexpected value for `header_short`");
 5419         -
        ::pretty_assertions::assert_eq!(input.header_integer, expected.header_integer, "Unexpected value for `header_integer`");
 5420         -
        ::pretty_assertions::assert_eq!(input.header_long, expected.header_long, "Unexpected value for `header_long`");
 5421         -
        assert!(input.header_float.float_equals(&expected.header_float),
 5422         -
                                            "Unexpected value for `header_float` {:?} vs. {:?}", expected.header_float, input.header_float);
 5423         -
        assert!(input.header_double.float_equals(&expected.header_double),
 5424         -
                                            "Unexpected value for `header_double` {:?} vs. {:?}", expected.header_double, input.header_double);
 5425         -
        ::pretty_assertions::assert_eq!(input.header_true_bool, expected.header_true_bool, "Unexpected value for `header_true_bool`");
 5426         -
        ::pretty_assertions::assert_eq!(input.header_false_bool, expected.header_false_bool, "Unexpected value for `header_false_bool`");
 5427         -
        ::pretty_assertions::assert_eq!(input.header_string_list, expected.header_string_list, "Unexpected value for `header_string_list`");
 5428         -
        ::pretty_assertions::assert_eq!(input.header_string_set, expected.header_string_set, "Unexpected value for `header_string_set`");
 5429         -
        ::pretty_assertions::assert_eq!(input.header_integer_list, expected.header_integer_list, "Unexpected value for `header_integer_list`");
 5430         -
        ::pretty_assertions::assert_eq!(input.header_boolean_list, expected.header_boolean_list, "Unexpected value for `header_boolean_list`");
 5431         -
        ::pretty_assertions::assert_eq!(input.header_timestamp_list, expected.header_timestamp_list, "Unexpected value for `header_timestamp_list`");
 5432         -
        ::pretty_assertions::assert_eq!(input.header_enum, expected.header_enum, "Unexpected value for `header_enum`");
 5433         -
        ::pretty_assertions::assert_eq!(input.header_enum_list, expected.header_enum_list, "Unexpected value for `header_enum_list`");
 5434         -
        ::pretty_assertions::assert_eq!(input.header_integer_enum, expected.header_integer_enum, "Unexpected value for `header_integer_enum`");
 5435         -
        ::pretty_assertions::assert_eq!(input.header_integer_enum_list, expected.header_integer_enum_list, "Unexpected value for `header_integer_enum_list`");
 5436         -
        let response =
 5437         -
            crate::output::InputAndOutputWithHeadersOutput {
 5438         -
                header_string:
 5439         -
                    ::std::option::Option::None
 5440         -
                ,
 5441         -
                header_byte:
 5442         -
                    ::std::option::Option::None
 5443         -
                ,
 5444         -
                header_short:
 5445         -
                    ::std::option::Option::None
 5446         -
                ,
 5447         -
                header_integer:
 5448         -
                    ::std::option::Option::None
 5449         -
                ,
 5450         -
                header_long:
 5451         -
                    ::std::option::Option::None
 5452         -
                ,
 5453         -
                header_float:
 5454         -
                    ::std::option::Option::None
 5455         -
                ,
 5456         -
                header_double:
 5457         -
                    ::std::option::Option::None
 5458         -
                ,
 5459         -
                header_true_bool:
 5460         -
                    ::std::option::Option::None
 5461         -
                ,
 5462         -
                header_false_bool:
 5463         -
                    ::std::option::Option::None
 5464         -
                ,
 5465         -
                header_string_list:
 5466         -
                    ::std::option::Option::None
 5467         -
                ,
 5468         -
                header_string_set:
 5469         -
                    ::std::option::Option::None
 5470         -
                ,
 5471         -
                header_integer_list:
 5472         -
                    ::std::option::Option::None
 5473         -
                ,
 5474         -
                header_boolean_list:
 5475         -
                    ::std::option::Option::None
 5476         -
                ,
 5477         -
                header_timestamp_list:
 5478         -
                    ::std::option::Option::None
 5479         -
                ,
 5480         -
                header_enum:
 5481         -
                    ::std::option::Option::None
 5482         -
                ,
 5483         -
                header_enum_list:
 5484         -
                    ::std::option::Option::None
 5485         -
                ,
 5486         -
                header_integer_enum:
 5487         -
                    ::std::option::Option::None
 5488         -
                ,
 5489         -
                header_integer_enum_list:
 5490         -
                    ::std::option::Option::None
 5491         -
                ,
 5492         -
            }
 5493         -
        ;
 5494         -
        Ok(response) };
        3734  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 5495   3735   
                                    sender.send(()).await.expect("receiver dropped early");
 5496   3736   
                                    result
 5497   3737   
                                }
 5498   3738   
                            })
 5499   3739   
                            .build_unchecked();
 5500   3740   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5501   3741   
                .await
 5502   3742   
                .expect("unable to make an HTTP request");
 5503         -
        assert!(receiver.recv().await.is_some());
        3743  +
            ::pretty_assertions::assert_eq!(
        3744  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        3745  +
                http_response.status()
        3746  +
            );
        3747  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        3748  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        3749  +
                http_response.headers(),
        3750  +
                expected_headers,
        3751  +
            ));
 5504   3752   
        }
 5505         -
    /// Supports handling -Infinity float header values.
 5506         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatHeaderInputs
        3753  +
    }
        3754  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3755  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case4
 5507   3756   
    #[::tokio::test]
 5508         -
    async fn rest_json_supports_negative_infinity_float_header_inputs_request() {
        3757  +
    #[::tracing_test::traced_test]
        3758  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case4_malformed_request(
        3759  +
    ) {
        3760  +
        {
 5509   3761   
            #[allow(unused_mut)]
 5510   3762   
            let mut http_request = http::Request::builder()
 5511         -
            .uri("/InputAndOutputWithHeaders")
        3763  +
                .uri("/MalformedTimestampBodyDefault")
 5512   3764   
                .method("POST")
 5513         -
            .header("X-Double", "-Infinity")
 5514         -
            .header("X-Float", "-Infinity")
        3765  +
                .header("content-type", "application/json")
 5515   3766   
                .body(::aws_smithy_http_server::body::Body::from(
 5516         -
                ::bytes::Bytes::from_static("".as_bytes()),
        3767  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": Infinity }".as_bytes()),
 5517   3768   
                ))
 5518   3769   
                .unwrap();
 5519   3770   
            #[allow(unused_mut)]
 5520   3771   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5521   3772   
            let config = crate::service::RestJsonConfig::builder().build();
 5522   3773   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 5523         -
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
        3774  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 5524   3775   
                                let sender = sender.clone();
 5525   3776   
                                async move {
 5526         -
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
 5527         -
        let expected =
 5528         -
            crate::input::InputAndOutputWithHeadersInput {
 5529         -
                header_float:
 5530         -
                    ::std::option::Option::Some(
 5531         -
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
 5532         -
                    )
 5533         -
                ,
 5534         -
                header_double:
 5535         -
                    ::std::option::Option::Some(
 5536         -
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
 5537         -
                    )
 5538         -
                ,
 5539         -
                header_string:
 5540         -
                    ::std::option::Option::None
 5541         -
                ,
 5542         -
                header_byte:
 5543         -
                    ::std::option::Option::None
 5544         -
                ,
 5545         -
                header_short:
 5546         -
                    ::std::option::Option::None
 5547         -
                ,
 5548         -
                header_integer:
 5549         -
                    ::std::option::Option::None
 5550         -
                ,
 5551         -
                header_long:
 5552         -
                    ::std::option::Option::None
 5553         -
                ,
 5554         -
                header_true_bool:
 5555         -
                    ::std::option::Option::None
 5556         -
                ,
 5557         -
                header_false_bool:
 5558         -
                    ::std::option::Option::None
 5559         -
                ,
 5560         -
                header_string_list:
 5561         -
                    ::std::option::Option::None
 5562         -
                ,
 5563         -
                header_string_set:
 5564         -
                    ::std::option::Option::None
 5565         -
                ,
 5566         -
                header_integer_list:
 5567         -
                    ::std::option::Option::None
 5568         -
                ,
 5569         -
                header_boolean_list:
 5570         -
                    ::std::option::Option::None
 5571         -
                ,
 5572         -
                header_timestamp_list:
 5573         -
                    ::std::option::Option::None
 5574         -
                ,
 5575         -
                header_enum:
 5576         -
                    ::std::option::Option::None
 5577         -
                ,
 5578         -
                header_enum_list:
 5579         -
                    ::std::option::Option::None
 5580         -
                ,
 5581         -
                header_integer_enum:
 5582         -
                    ::std::option::Option::None
 5583         -
                ,
 5584         -
                header_integer_enum_list:
 5585         -
                    ::std::option::Option::None
 5586         -
                ,
 5587         -
            }
 5588         -
        ;
 5589         -
        ::pretty_assertions::assert_eq!(input.header_string, expected.header_string, "Unexpected value for `header_string`");
 5590         -
        ::pretty_assertions::assert_eq!(input.header_byte, expected.header_byte, "Unexpected value for `header_byte`");
 5591         -
        ::pretty_assertions::assert_eq!(input.header_short, expected.header_short, "Unexpected value for `header_short`");
 5592         -
        ::pretty_assertions::assert_eq!(input.header_integer, expected.header_integer, "Unexpected value for `header_integer`");
 5593         -
        ::pretty_assertions::assert_eq!(input.header_long, expected.header_long, "Unexpected value for `header_long`");
 5594         -
        assert!(input.header_float.float_equals(&expected.header_float),
 5595         -
                                            "Unexpected value for `header_float` {:?} vs. {:?}", expected.header_float, input.header_float);
 5596         -
        assert!(input.header_double.float_equals(&expected.header_double),
 5597         -
                                            "Unexpected value for `header_double` {:?} vs. {:?}", expected.header_double, input.header_double);
 5598         -
        ::pretty_assertions::assert_eq!(input.header_true_bool, expected.header_true_bool, "Unexpected value for `header_true_bool`");
 5599         -
        ::pretty_assertions::assert_eq!(input.header_false_bool, expected.header_false_bool, "Unexpected value for `header_false_bool`");
 5600         -
        ::pretty_assertions::assert_eq!(input.header_string_list, expected.header_string_list, "Unexpected value for `header_string_list`");
 5601         -
        ::pretty_assertions::assert_eq!(input.header_string_set, expected.header_string_set, "Unexpected value for `header_string_set`");
 5602         -
        ::pretty_assertions::assert_eq!(input.header_integer_list, expected.header_integer_list, "Unexpected value for `header_integer_list`");
 5603         -
        ::pretty_assertions::assert_eq!(input.header_boolean_list, expected.header_boolean_list, "Unexpected value for `header_boolean_list`");
 5604         -
        ::pretty_assertions::assert_eq!(input.header_timestamp_list, expected.header_timestamp_list, "Unexpected value for `header_timestamp_list`");
 5605         -
        ::pretty_assertions::assert_eq!(input.header_enum, expected.header_enum, "Unexpected value for `header_enum`");
 5606         -
        ::pretty_assertions::assert_eq!(input.header_enum_list, expected.header_enum_list, "Unexpected value for `header_enum_list`");
 5607         -
        ::pretty_assertions::assert_eq!(input.header_integer_enum, expected.header_integer_enum, "Unexpected value for `header_integer_enum`");
 5608         -
        ::pretty_assertions::assert_eq!(input.header_integer_enum_list, expected.header_integer_enum_list, "Unexpected value for `header_integer_enum_list`");
 5609         -
        let response =
 5610         -
            crate::output::InputAndOutputWithHeadersOutput {
 5611         -
                header_string:
 5612         -
                    ::std::option::Option::None
 5613         -
                ,
 5614         -
                header_byte:
 5615         -
                    ::std::option::Option::None
 5616         -
                ,
 5617         -
                header_short:
 5618         -
                    ::std::option::Option::None
 5619         -
                ,
 5620         -
                header_integer:
 5621         -
                    ::std::option::Option::None
 5622         -
                ,
 5623         -
                header_long:
 5624         -
                    ::std::option::Option::None
 5625         -
                ,
 5626         -
                header_float:
 5627         -
                    ::std::option::Option::None
 5628         -
                ,
 5629         -
                header_double:
 5630         -
                    ::std::option::Option::None
 5631         -
                ,
 5632         -
                header_true_bool:
 5633         -
                    ::std::option::Option::None
 5634         -
                ,
 5635         -
                header_false_bool:
 5636         -
                    ::std::option::Option::None
 5637         -
                ,
 5638         -
                header_string_list:
 5639         -
                    ::std::option::Option::None
 5640         -
                ,
 5641         -
                header_string_set:
 5642         -
                    ::std::option::Option::None
 5643         -
                ,
 5644         -
                header_integer_list:
 5645         -
                    ::std::option::Option::None
 5646         -
                ,
 5647         -
                header_boolean_list:
 5648         -
                    ::std::option::Option::None
 5649         -
                ,
 5650         -
                header_timestamp_list:
 5651         -
                    ::std::option::Option::None
 5652         -
                ,
 5653         -
                header_enum:
 5654         -
                    ::std::option::Option::None
 5655         -
                ,
 5656         -
                header_enum_list:
 5657         -
                    ::std::option::Option::None
 5658         -
                ,
 5659         -
                header_integer_enum:
 5660         -
                    ::std::option::Option::None
 5661         -
                ,
 5662         -
                header_integer_enum_list:
 5663         -
                    ::std::option::Option::None
 5664         -
                ,
 5665         -
            }
 5666         -
        ;
 5667         -
        Ok(response) };
        3777  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 5668   3778   
                                    sender.send(()).await.expect("receiver dropped early");
 5669   3779   
                                    result
 5670   3780   
                                }
 5671   3781   
                            })
 5672   3782   
                            .build_unchecked();
 5673   3783   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5674   3784   
                .await
 5675   3785   
                .expect("unable to make an HTTP request");
 5676         -
        assert!(receiver.recv().await.is_some());
 5677         -
    }
 5678         -
    /// Tests responses with string header bindings
 5679         -
    /// Test ID: RestJsonInputAndOutputWithStringHeaders
 5680         -
    #[::tokio::test]
 5681         -
    async fn rest_json_input_and_output_with_string_headers_response() {
 5682         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5683         -
            header_string: ::std::option::Option::Some("Hello".to_owned()),
 5684         -
            header_string_list: ::std::option::Option::Some(vec![
 5685         -
                "a".to_owned(),
 5686         -
                "b".to_owned(),
 5687         -
                "c".to_owned(),
 5688         -
            ]),
 5689         -
            header_string_set: ::std::option::Option::Some(
 5690         -
                vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]
 5691         -
                    .try_into()
 5692         -
                    .expect("this is only used in tests"),
 5693         -
            ),
 5694         -
            header_byte: ::std::option::Option::None,
 5695         -
            header_short: ::std::option::Option::None,
 5696         -
            header_integer: ::std::option::Option::None,
 5697         -
            header_long: ::std::option::Option::None,
 5698         -
            header_float: ::std::option::Option::None,
 5699         -
            header_double: ::std::option::Option::None,
 5700         -
            header_true_bool: ::std::option::Option::None,
 5701         -
            header_false_bool: ::std::option::Option::None,
 5702         -
            header_integer_list: ::std::option::Option::None,
 5703         -
            header_boolean_list: ::std::option::Option::None,
 5704         -
            header_timestamp_list: ::std::option::Option::None,
 5705         -
            header_enum: ::std::option::Option::None,
 5706         -
            header_enum_list: ::std::option::Option::None,
 5707         -
            header_integer_enum: ::std::option::Option::None,
 5708         -
            header_integer_enum_list: ::std::option::Option::None,
 5709         -
        };
 5710         -
        use ::aws_smithy_http_server::response::IntoResponse;
 5711         -
        let http_response = output.into_response();
 5712   3786   
            ::pretty_assertions::assert_eq!(
 5713         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3787  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 5714   3788   
                http_response.status()
 5715   3789   
            );
 5716         -
        let expected_headers = [
 5717         -
            ("X-String", "Hello"),
 5718         -
            ("X-StringList", "a, b, c"),
 5719         -
            ("X-StringSet", "a, b, c"),
 5720         -
        ];
        3790  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 5721   3791   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5722   3792   
                http_response.headers(),
 5723   3793   
                expected_headers,
 5724   3794   
            ));
 5725   3795   
        }
 5726         -
    /// Tests responses with string list header bindings that require quoting
 5727         -
    /// Test ID: RestJsonInputAndOutputWithQuotedStringHeaders
        3796  +
    }
        3797  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3798  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case5
 5728   3799   
    #[::tokio::test]
 5729         -
    async fn rest_json_input_and_output_with_quoted_string_headers_response() {
 5730         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5731         -
            header_string_list: ::std::option::Option::Some(vec![
 5732         -
                "b,c".to_owned(),
 5733         -
                "\"def\"".to_owned(),
 5734         -
                "a".to_owned(),
 5735         -
            ]),
 5736         -
            header_string: ::std::option::Option::None,
 5737         -
            header_byte: ::std::option::Option::None,
 5738         -
            header_short: ::std::option::Option::None,
 5739         -
            header_integer: ::std::option::Option::None,
 5740         -
            header_long: ::std::option::Option::None,
 5741         -
            header_float: ::std::option::Option::None,
 5742         -
            header_double: ::std::option::Option::None,
 5743         -
            header_true_bool: ::std::option::Option::None,
 5744         -
            header_false_bool: ::std::option::Option::None,
 5745         -
            header_string_set: ::std::option::Option::None,
 5746         -
            header_integer_list: ::std::option::Option::None,
 5747         -
            header_boolean_list: ::std::option::Option::None,
 5748         -
            header_timestamp_list: ::std::option::Option::None,
 5749         -
            header_enum: ::std::option::Option::None,
 5750         -
            header_enum_list: ::std::option::Option::None,
 5751         -
            header_integer_enum: ::std::option::Option::None,
 5752         -
            header_integer_enum_list: ::std::option::Option::None,
 5753         -
        };
 5754         -
        use ::aws_smithy_http_server::response::IntoResponse;
 5755         -
        let http_response = output.into_response();
        3800  +
    #[::tracing_test::traced_test]
        3801  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case5_malformed_request(
        3802  +
    ) {
        3803  +
        {
        3804  +
            #[allow(unused_mut)]
        3805  +
            let mut http_request = http::Request::builder()
        3806  +
                .uri("/MalformedTimestampBodyDefault")
        3807  +
                .method("POST")
        3808  +
                .header("content-type", "application/json")
        3809  +
                .body(::aws_smithy_http_server::body::Body::from(
        3810  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"Infinity\" }".as_bytes()),
        3811  +
                ))
        3812  +
                .unwrap();
        3813  +
            #[allow(unused_mut)]
        3814  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        3815  +
            let config = crate::service::RestJsonConfig::builder().build();
        3816  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        3817  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
        3818  +
                                let sender = sender.clone();
        3819  +
                                async move {
        3820  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
        3821  +
                                    sender.send(()).await.expect("receiver dropped early");
        3822  +
                                    result
        3823  +
                                }
        3824  +
                            })
        3825  +
                            .build_unchecked();
        3826  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        3827  +
                .await
        3828  +
                .expect("unable to make an HTTP request");
 5756   3829   
            ::pretty_assertions::assert_eq!(
 5757         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3830  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 5758   3831   
                http_response.status()
 5759   3832   
            );
 5760         -
        let expected_headers = [("X-StringList", "\"b,c\", \"\\\"def\\\"\", a")];
        3833  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 5761   3834   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5762   3835   
                http_response.headers(),
 5763   3836   
                expected_headers,
 5764   3837   
            ));
 5765   3838   
        }
 5766         -
    /// Tests responses with numeric header bindings
 5767         -
    /// Test ID: RestJsonInputAndOutputWithNumericHeaders
        3839  +
    }
        3840  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3841  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case6
 5768   3842   
    #[::tokio::test]
 5769         -
    async fn rest_json_input_and_output_with_numeric_headers_response() {
 5770         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5771         -
            header_byte: ::std::option::Option::Some(1),
 5772         -
            header_short: ::std::option::Option::Some(123),
 5773         -
            header_integer: ::std::option::Option::Some(123),
 5774         -
            header_long: ::std::option::Option::Some(123),
 5775         -
            header_float: ::std::option::Option::Some(1.1_f32),
 5776         -
            header_double: ::std::option::Option::Some(1.1_f64),
 5777         -
            header_integer_list: ::std::option::Option::Some(vec![1, 2, 3]),
 5778         -
            header_string: ::std::option::Option::None,
 5779         -
            header_true_bool: ::std::option::Option::None,
 5780         -
            header_false_bool: ::std::option::Option::None,
 5781         -
            header_string_list: ::std::option::Option::None,
 5782         -
            header_string_set: ::std::option::Option::None,
 5783         -
            header_boolean_list: ::std::option::Option::None,
 5784         -
            header_timestamp_list: ::std::option::Option::None,
 5785         -
            header_enum: ::std::option::Option::None,
 5786         -
            header_enum_list: ::std::option::Option::None,
 5787         -
            header_integer_enum: ::std::option::Option::None,
 5788         -
            header_integer_enum_list: ::std::option::Option::None,
 5789         -
        };
 5790         -
        use ::aws_smithy_http_server::response::IntoResponse;
 5791         -
        let http_response = output.into_response();
        3843  +
    #[::tracing_test::traced_test]
        3844  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case6_malformed_request(
        3845  +
    ) {
        3846  +
        {
        3847  +
            #[allow(unused_mut)]
        3848  +
            let mut http_request = http::Request::builder()
        3849  +
                .uri("/MalformedTimestampBodyDefault")
        3850  +
                .method("POST")
        3851  +
                .header("content-type", "application/json")
        3852  +
                .body(::aws_smithy_http_server::body::Body::from(
        3853  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": -Infinity }".as_bytes()),
        3854  +
                ))
        3855  +
                .unwrap();
        3856  +
            #[allow(unused_mut)]
        3857  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        3858  +
            let config = crate::service::RestJsonConfig::builder().build();
        3859  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        3860  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
        3861  +
                                let sender = sender.clone();
        3862  +
                                async move {
        3863  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
        3864  +
                                    sender.send(()).await.expect("receiver dropped early");
        3865  +
                                    result
        3866  +
                                }
        3867  +
                            })
        3868  +
                            .build_unchecked();
        3869  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        3870  +
                .await
        3871  +
                .expect("unable to make an HTTP request");
 5792   3872   
            ::pretty_assertions::assert_eq!(
 5793         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3873  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 5794   3874   
                http_response.status()
 5795   3875   
            );
 5796         -
        let expected_headers = [
 5797         -
            ("X-Byte", "1"),
 5798         -
            ("X-Double", "1.1"),
 5799         -
            ("X-Float", "1.1"),
 5800         -
            ("X-Integer", "123"),
 5801         -
            ("X-IntegerList", "1, 2, 3"),
 5802         -
            ("X-Long", "123"),
 5803         -
            ("X-Short", "123"),
 5804         -
        ];
        3876  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 5805   3877   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5806   3878   
                http_response.headers(),
 5807   3879   
                expected_headers,
 5808   3880   
            ));
 5809   3881   
        }
 5810         -
    /// Tests responses with boolean header bindings
 5811         -
    /// Test ID: RestJsonInputAndOutputWithBooleanHeaders
        3882  +
    }
        3883  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3884  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case7
 5812   3885   
    #[::tokio::test]
 5813         -
    async fn rest_json_input_and_output_with_boolean_headers_response() {
 5814         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5815         -
            header_true_bool: ::std::option::Option::Some(true),
 5816         -
            header_false_bool: ::std::option::Option::Some(false),
 5817         -
            header_boolean_list: ::std::option::Option::Some(vec![true, false, true]),
 5818         -
            header_string: ::std::option::Option::None,
 5819         -
            header_byte: ::std::option::Option::None,
 5820         -
            header_short: ::std::option::Option::None,
 5821         -
            header_integer: ::std::option::Option::None,
 5822         -
            header_long: ::std::option::Option::None,
 5823         -
            header_float: ::std::option::Option::None,
 5824         -
            header_double: ::std::option::Option::None,
 5825         -
            header_string_list: ::std::option::Option::None,
 5826         -
            header_string_set: ::std::option::Option::None,
 5827         -
            header_integer_list: ::std::option::Option::None,
 5828         -
            header_timestamp_list: ::std::option::Option::None,
 5829         -
            header_enum: ::std::option::Option::None,
 5830         -
            header_enum_list: ::std::option::Option::None,
 5831         -
            header_integer_enum: ::std::option::Option::None,
 5832         -
            header_integer_enum_list: ::std::option::Option::None,
 5833         -
        };
 5834         -
        use ::aws_smithy_http_server::response::IntoResponse;
 5835         -
        let http_response = output.into_response();
 5836         -
        ::pretty_assertions::assert_eq!(
 5837         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 5838         -
            http_response.status()
 5839         -
        );
 5840         -
        let expected_headers = [
 5841         -
            ("X-Boolean1", "true"),
 5842         -
            ("X-Boolean2", "false"),
 5843         -
            ("X-BooleanList", "true, false, true"),
 5844         -
        ];
 5845         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5846         -
            http_response.headers(),
 5847         -
            expected_headers,
 5848         -
        ));
 5849         -
    }
 5850         -
    /// Tests responses with timestamp header bindings
 5851         -
    /// Test ID: RestJsonInputAndOutputWithTimestampHeaders
 5852         -
    #[::tokio::test]
 5853         -
    async fn rest_json_input_and_output_with_timestamp_headers_response() {
 5854         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5855         -
            header_timestamp_list: ::std::option::Option::Some(vec![
 5856         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
 5857         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
 5858         -
            ]),
 5859         -
            header_string: ::std::option::Option::None,
 5860         -
            header_byte: ::std::option::Option::None,
 5861         -
            header_short: ::std::option::Option::None,
 5862         -
            header_integer: ::std::option::Option::None,
 5863         -
            header_long: ::std::option::Option::None,
 5864         -
            header_float: ::std::option::Option::None,
 5865         -
            header_double: ::std::option::Option::None,
 5866         -
            header_true_bool: ::std::option::Option::None,
 5867         -
            header_false_bool: ::std::option::Option::None,
 5868         -
            header_string_list: ::std::option::Option::None,
 5869         -
            header_string_set: ::std::option::Option::None,
 5870         -
            header_integer_list: ::std::option::Option::None,
 5871         -
            header_boolean_list: ::std::option::Option::None,
 5872         -
            header_enum: ::std::option::Option::None,
 5873         -
            header_enum_list: ::std::option::Option::None,
 5874         -
            header_integer_enum: ::std::option::Option::None,
 5875         -
            header_integer_enum_list: ::std::option::Option::None,
 5876         -
        };
 5877         -
        use ::aws_smithy_http_server::response::IntoResponse;
 5878         -
        let http_response = output.into_response();
 5879         -
        ::pretty_assertions::assert_eq!(
 5880         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 5881         -
            http_response.status()
 5882         -
        );
 5883         -
        let expected_headers = [(
 5884         -
            "X-TimestampList",
 5885         -
            "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT",
 5886         -
        )];
 5887         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5888         -
            http_response.headers(),
 5889         -
            expected_headers,
 5890         -
        ));
        3886  +
    #[::tracing_test::traced_test]
        3887  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case7_malformed_request(
        3888  +
    ) {
        3889  +
        {
        3890  +
            #[allow(unused_mut)]
        3891  +
            let mut http_request = http::Request::builder()
        3892  +
                .uri("/MalformedTimestampBodyDefault")
        3893  +
                .method("POST")
        3894  +
                .header("content-type", "application/json")
        3895  +
                .body(::aws_smithy_http_server::body::Body::from(
        3896  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"-Infinity\" }".as_bytes()),
        3897  +
                ))
        3898  +
                .unwrap();
        3899  +
            #[allow(unused_mut)]
        3900  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        3901  +
            let config = crate::service::RestJsonConfig::builder().build();
        3902  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        3903  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
        3904  +
                                let sender = sender.clone();
        3905  +
                                async move {
        3906  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
        3907  +
                                    sender.send(()).await.expect("receiver dropped early");
        3908  +
                                    result
 5891   3909   
                                }
 5892         -
    /// Tests responses with enum header bindings
 5893         -
    /// Test ID: RestJsonInputAndOutputWithEnumHeaders
 5894         -
    #[::tokio::test]
 5895         -
    async fn rest_json_input_and_output_with_enum_headers_response() {
 5896         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5897         -
            header_enum: ::std::option::Option::Some(
 5898         -
                "Foo"
 5899         -
                    .parse::<crate::model::FooEnum>()
 5900         -
                    .expect("static value validated to member"),
 5901         -
            ),
 5902         -
            header_enum_list: ::std::option::Option::Some(vec![
 5903         -
                "Foo"
 5904         -
                    .parse::<crate::model::FooEnum>()
 5905         -
                    .expect("static value validated to member"),
 5906         -
                "Bar"
 5907         -
                    .parse::<crate::model::FooEnum>()
 5908         -
                    .expect("static value validated to member"),
 5909         -
                "Baz"
 5910         -
                    .parse::<crate::model::FooEnum>()
 5911         -
                    .expect("static value validated to member"),
 5912         -
            ]),
 5913         -
            header_string: ::std::option::Option::None,
 5914         -
            header_byte: ::std::option::Option::None,
 5915         -
            header_short: ::std::option::Option::None,
 5916         -
            header_integer: ::std::option::Option::None,
 5917         -
            header_long: ::std::option::Option::None,
 5918         -
            header_float: ::std::option::Option::None,
 5919         -
            header_double: ::std::option::Option::None,
 5920         -
            header_true_bool: ::std::option::Option::None,
 5921         -
            header_false_bool: ::std::option::Option::None,
 5922         -
            header_string_list: ::std::option::Option::None,
 5923         -
            header_string_set: ::std::option::Option::None,
 5924         -
            header_integer_list: ::std::option::Option::None,
 5925         -
            header_boolean_list: ::std::option::Option::None,
 5926         -
            header_timestamp_list: ::std::option::Option::None,
 5927         -
            header_integer_enum: ::std::option::Option::None,
 5928         -
            header_integer_enum_list: ::std::option::Option::None,
 5929         -
        };
 5930         -
        use ::aws_smithy_http_server::response::IntoResponse;
 5931         -
        let http_response = output.into_response();
        3910  +
                            })
        3911  +
                            .build_unchecked();
        3912  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        3913  +
                .await
        3914  +
                .expect("unable to make an HTTP request");
 5932   3915   
            ::pretty_assertions::assert_eq!(
 5933         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3916  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 5934   3917   
                http_response.status()
 5935   3918   
            );
 5936         -
        let expected_headers = [("X-Enum", "Foo"), ("X-EnumList", "Foo, Bar, Baz")];
        3919  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 5937   3920   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5938   3921   
                http_response.headers(),
 5939   3922   
                expected_headers,
 5940   3923   
            ));
 5941   3924   
        }
 5942         -
    /// Tests responses with intEnum header bindings
 5943         -
    /// Test ID: RestJsonInputAndOutputWithIntEnumHeaders
 5944         -
    #[::tokio::test]
 5945         -
    async fn rest_json_input_and_output_with_int_enum_headers_response() {
 5946         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5947         -
            header_integer_enum: ::std::option::Option::Some(1),
 5948         -
            header_integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
 5949         -
            header_string: ::std::option::Option::None,
 5950         -
            header_byte: ::std::option::Option::None,
 5951         -
            header_short: ::std::option::Option::None,
 5952         -
            header_integer: ::std::option::Option::None,
 5953         -
            header_long: ::std::option::Option::None,
 5954         -
            header_float: ::std::option::Option::None,
 5955         -
            header_double: ::std::option::Option::None,
 5956         -
            header_true_bool: ::std::option::Option::None,
 5957         -
            header_false_bool: ::std::option::Option::None,
 5958         -
            header_string_list: ::std::option::Option::None,
 5959         -
            header_string_set: ::std::option::Option::None,
 5960         -
            header_integer_list: ::std::option::Option::None,
 5961         -
            header_boolean_list: ::std::option::Option::None,
 5962         -
            header_timestamp_list: ::std::option::Option::None,
 5963         -
            header_enum: ::std::option::Option::None,
 5964         -
            header_enum_list: ::std::option::Option::None,
 5965         -
        };
 5966         -
        use ::aws_smithy_http_server::response::IntoResponse;
 5967         -
        let http_response = output.into_response();
 5968         -
        ::pretty_assertions::assert_eq!(
 5969         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 5970         -
            http_response.status()
 5971         -
        );
 5972         -
        let expected_headers = [("X-IntegerEnum", "1"), ("X-IntegerEnumList", "1, 2, 3")];
 5973         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5974         -
            http_response.headers(),
 5975         -
            expected_headers,
 5976         -
        ));
 5977   3925   
    }
 5978         -
    /// Supports handling NaN float header values.
 5979         -
    /// Test ID: RestJsonSupportsNaNFloatHeaderOutputs
        3926  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3927  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case8
 5980   3928   
    #[::tokio::test]
 5981         -
    async fn rest_json_supports_na_n_float_header_outputs_response() {
 5982         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 5983         -
            header_float: ::std::option::Option::Some(
 5984         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
 5985         -
                    .expect("invalid string for number"),
 5986         -
            ),
 5987         -
            header_double: ::std::option::Option::Some(
 5988         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
 5989         -
                    .expect("invalid string for number"),
 5990         -
            ),
 5991         -
            header_string: ::std::option::Option::None,
 5992         -
            header_byte: ::std::option::Option::None,
 5993         -
            header_short: ::std::option::Option::None,
 5994         -
            header_integer: ::std::option::Option::None,
 5995         -
            header_long: ::std::option::Option::None,
 5996         -
            header_true_bool: ::std::option::Option::None,
 5997         -
            header_false_bool: ::std::option::Option::None,
 5998         -
            header_string_list: ::std::option::Option::None,
 5999         -
            header_string_set: ::std::option::Option::None,
 6000         -
            header_integer_list: ::std::option::Option::None,
 6001         -
            header_boolean_list: ::std::option::Option::None,
 6002         -
            header_timestamp_list: ::std::option::Option::None,
 6003         -
            header_enum: ::std::option::Option::None,
 6004         -
            header_enum_list: ::std::option::Option::None,
 6005         -
            header_integer_enum: ::std::option::Option::None,
 6006         -
            header_integer_enum_list: ::std::option::Option::None,
 6007         -
        };
 6008         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6009         -
        let http_response = output.into_response();
 6010         -
        ::pretty_assertions::assert_eq!(
 6011         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6012         -
            http_response.status()
 6013         -
        );
 6014         -
        let expected_headers = [("X-Double", "NaN"), ("X-Float", "NaN")];
 6015         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6016         -
            http_response.headers(),
 6017         -
            expected_headers,
 6018         -
        ));
        3929  +
    #[::tracing_test::traced_test]
        3930  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case8_malformed_request(
        3931  +
    ) {
        3932  +
        {
        3933  +
            #[allow(unused_mut)]
        3934  +
            let mut http_request = http::Request::builder()
        3935  +
                .uri("/MalformedTimestampBodyDefault")
        3936  +
                .method("POST")
        3937  +
                .header("content-type", "application/json")
        3938  +
                .body(::aws_smithy_http_server::body::Body::from(
        3939  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": NaN }".as_bytes()),
        3940  +
                ))
        3941  +
                .unwrap();
        3942  +
            #[allow(unused_mut)]
        3943  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        3944  +
            let config = crate::service::RestJsonConfig::builder().build();
        3945  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        3946  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
        3947  +
                                let sender = sender.clone();
        3948  +
                                async move {
        3949  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
        3950  +
                                    sender.send(()).await.expect("receiver dropped early");
        3951  +
                                    result
 6019   3952   
                                }
 6020         -
    /// Supports handling Infinity float header values.
 6021         -
    /// Test ID: RestJsonSupportsInfinityFloatHeaderOutputs
 6022         -
    #[::tokio::test]
 6023         -
    async fn rest_json_supports_infinity_float_header_outputs_response() {
 6024         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 6025         -
            header_float: ::std::option::Option::Some(
 6026         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
 6027         -
                    .expect("invalid string for number"),
 6028         -
            ),
 6029         -
            header_double: ::std::option::Option::Some(
 6030         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
 6031         -
                    .expect("invalid string for number"),
 6032         -
            ),
 6033         -
            header_string: ::std::option::Option::None,
 6034         -
            header_byte: ::std::option::Option::None,
 6035         -
            header_short: ::std::option::Option::None,
 6036         -
            header_integer: ::std::option::Option::None,
 6037         -
            header_long: ::std::option::Option::None,
 6038         -
            header_true_bool: ::std::option::Option::None,
 6039         -
            header_false_bool: ::std::option::Option::None,
 6040         -
            header_string_list: ::std::option::Option::None,
 6041         -
            header_string_set: ::std::option::Option::None,
 6042         -
            header_integer_list: ::std::option::Option::None,
 6043         -
            header_boolean_list: ::std::option::Option::None,
 6044         -
            header_timestamp_list: ::std::option::Option::None,
 6045         -
            header_enum: ::std::option::Option::None,
 6046         -
            header_enum_list: ::std::option::Option::None,
 6047         -
            header_integer_enum: ::std::option::Option::None,
 6048         -
            header_integer_enum_list: ::std::option::Option::None,
 6049         -
        };
 6050         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6051         -
        let http_response = output.into_response();
        3953  +
                            })
        3954  +
                            .build_unchecked();
        3955  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        3956  +
                .await
        3957  +
                .expect("unable to make an HTTP request");
 6052   3958   
            ::pretty_assertions::assert_eq!(
 6053         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        3959  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 6054   3960   
                http_response.status()
 6055   3961   
            );
 6056         -
        let expected_headers = [("X-Double", "Infinity"), ("X-Float", "Infinity")];
        3962  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 6057   3963   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6058   3964   
                http_response.headers(),
 6059   3965   
                expected_headers,
 6060   3966   
            ));
 6061   3967   
        }
 6062         -
    /// Supports handling -Infinity float header values.
 6063         -
    /// Test ID: RestJsonSupportsNegativeInfinityFloatHeaderOutputs
 6064         -
    #[::tokio::test]
 6065         -
    async fn rest_json_supports_negative_infinity_float_header_outputs_response() {
 6066         -
        let output = crate::output::InputAndOutputWithHeadersOutput {
 6067         -
            header_float: ::std::option::Option::Some(
 6068         -
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
 6069         -
                    .expect("invalid string for number"),
 6070         -
            ),
 6071         -
            header_double: ::std::option::Option::Some(
 6072         -
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
 6073         -
                    .expect("invalid string for number"),
 6074         -
            ),
 6075         -
            header_string: ::std::option::Option::None,
 6076         -
            header_byte: ::std::option::Option::None,
 6077         -
            header_short: ::std::option::Option::None,
 6078         -
            header_integer: ::std::option::Option::None,
 6079         -
            header_long: ::std::option::Option::None,
 6080         -
            header_true_bool: ::std::option::Option::None,
 6081         -
            header_false_bool: ::std::option::Option::None,
 6082         -
            header_string_list: ::std::option::Option::None,
 6083         -
            header_string_set: ::std::option::Option::None,
 6084         -
            header_integer_list: ::std::option::Option::None,
 6085         -
            header_boolean_list: ::std::option::Option::None,
 6086         -
            header_timestamp_list: ::std::option::Option::None,
 6087         -
            header_enum: ::std::option::Option::None,
 6088         -
            header_enum_list: ::std::option::Option::None,
 6089         -
            header_integer_enum: ::std::option::Option::None,
 6090         -
            header_integer_enum_list: ::std::option::Option::None,
 6091         -
        };
 6092         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6093         -
        let http_response = output.into_response();
 6094         -
        ::pretty_assertions::assert_eq!(
 6095         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6096         -
            http_response.status()
 6097         -
        );
 6098         -
        let expected_headers = [("X-Double", "-Infinity"), ("X-Float", "-Infinity")];
 6099         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6100         -
            http_response.headers(),
 6101         -
            expected_headers,
 6102         -
        ));
 6103   3968   
    }
 6104         -
}
 6105         -
#[cfg(test)]
 6106         -
#[allow(unreachable_code, unused_variables)]
 6107         -
mod server_json_blobs_test {
 6108         -
    /// Blobs are base64 encoded
 6109         -
    /// Test ID: RestJsonJsonBlobs
        3969  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        3970  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case9
 6110   3971   
    #[::tokio::test]
 6111         -
    async fn rest_json_json_blobs_request() {
        3972  +
    #[::tracing_test::traced_test]
        3973  +
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case9_malformed_request(
        3974  +
    ) {
        3975  +
        {
 6112   3976   
            #[allow(unused_mut)]
 6113   3977   
            let mut http_request = http::Request::builder()
 6114         -
            .uri("/JsonBlobs")
        3978  +
                .uri("/MalformedTimestampBodyDefault")
 6115   3979   
                .method("POST")
 6116         -
            .header("Content-Type", "application/json")
        3980  +
                .header("content-type", "application/json")
 6117   3981   
                .body(::aws_smithy_http_server::body::Body::from(
 6118         -
                ::bytes::Bytes::from_static("{\n    \"data\": \"dmFsdWU=\"\n}".as_bytes()),
        3982  +
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"NaN\" }".as_bytes()),
 6119   3983   
                ))
 6120   3984   
                .unwrap();
 6121   3985   
            #[allow(unused_mut)]
 6122   3986   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6123   3987   
            let config = crate::service::RestJsonConfig::builder().build();
 6124   3988   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6125         -
            .json_blobs(move |input: crate::input::JsonBlobsInput| {
        3989  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 6126   3990   
                                let sender = sender.clone();
 6127   3991   
                                async move {
 6128         -
                    let result = {
 6129         -
                        let expected = crate::input::JsonBlobsInput {
 6130         -
                            data: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
 6131         -
                                "value",
 6132         -
                            )),
 6133         -
                        };
 6134         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6135         -
                        let response = crate::output::JsonBlobsOutput {
 6136         -
                            data: ::std::option::Option::None,
 6137         -
                        };
 6138         -
                        response
 6139         -
                    };
        3992  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 6140   3993   
                                    sender.send(()).await.expect("receiver dropped early");
 6141   3994   
                                    result
 6142   3995   
                                }
 6143   3996   
                            })
 6144   3997   
                            .build_unchecked();
 6145   3998   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6146   3999   
                .await
 6147   4000   
                .expect("unable to make an HTTP request");
 6148         -
        assert!(receiver.recv().await.is_some());
 6149         -
    }
 6150         -
    /// Blobs are base64 encoded
 6151         -
    /// Test ID: RestJsonJsonBlobs
 6152         -
    #[::tokio::test]
 6153         -
    async fn rest_json_json_blobs_response() {
 6154         -
        let output = crate::output::JsonBlobsOutput {
 6155         -
            data: ::std::option::Option::Some(::aws_smithy_types::Blob::new("value")),
 6156         -
        };
 6157         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6158         -
        let http_response = output.into_response();
 6159   4001   
            ::pretty_assertions::assert_eq!(
 6160         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4002  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 6161   4003   
                http_response.status()
 6162   4004   
            );
 6163         -
        let expected_headers = [("Content-Type", "application/json")];
        4005  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 6164   4006   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6165   4007   
                http_response.headers(),
 6166   4008   
                expected_headers,
 6167   4009   
            ));
 6168         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 6169         -
            .await
 6170         -
            .expect("unable to extract body to bytes");
 6171         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 6172         -
            &body,
 6173         -
            "{\n    \"data\": \"dmFsdWU=\"\n}",
 6174         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 6175         -
        ));
 6176   4010   
        }
 6177         -
}
 6178         -
#[cfg(test)]
 6179         -
#[allow(unreachable_code, unused_variables)]
 6180         -
mod server_json_enums_test {
 6181         -
    /// Serializes simple scalar properties
 6182         -
    /// Test ID: RestJsonJsonEnums
        4011  +
    }
        4012  +
    /// By default, IMF-fixdate timestamps are rejected with a
        4013  +
    /// 400 SerializationException
        4014  +
    /// Test ID: RestJsonBodyTimestampDefaultRejectsHttpDate_case0
 6183   4015   
    #[::tokio::test]
 6184         -
    async fn rest_json_json_enums_request() {
        4016  +
    #[::tracing_test::traced_test]
        4017  +
    async fn rest_json_body_timestamp_default_rejects_http_date_case0_malformed_request() {
        4018  +
        {
 6185   4019   
            #[allow(unused_mut)]
 6186   4020   
            let mut http_request = http::Request::builder()
 6187         -
                        .uri("/JsonEnums")
 6188         -
                        .method("PUT")
 6189         -
        .header("Content-Type", "application/json")
 6190         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"fooEnum1\": \"Foo\",\n    \"fooEnum2\": \"0\",\n    \"fooEnum3\": \"1\",\n    \"fooEnumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumSet\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumMap\": {\n        \"hi\": \"Foo\",\n        \"zero\": \"0\"\n    }\n}".as_bytes()))).unwrap();
        4021  +
                .uri("/MalformedTimestampBodyDefault")
        4022  +
                .method("POST")
        4023  +
                .header("content-type", "application/json")
        4024  +
                .body(::aws_smithy_http_server::body::Body::from(
        4025  +
                    ::bytes::Bytes::from_static(
        4026  +
                        "{ \"timestamp\": \"Tue, 29 Apr 2014 18:30:38 GMT\" }".as_bytes(),
        4027  +
                    ),
        4028  +
                ))
        4029  +
                .unwrap();
 6191   4030   
            #[allow(unused_mut)]
 6192   4031   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6193   4032   
            let config = crate::service::RestJsonConfig::builder().build();
 6194   4033   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6195         -
            .json_enums(move |input: crate::input::JsonEnumsInput| {
        4034  +
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
 6196   4035   
                                let sender = sender.clone();
 6197   4036   
                                async move {
 6198         -
                    let result = {
 6199         -
                        let expected = crate::input::JsonEnumsInput {
 6200         -
                            foo_enum1: ::std::option::Option::Some(
 6201         -
                                "Foo"
 6202         -
                                    .parse::<crate::model::FooEnum>()
 6203         -
                                    .expect("static value validated to member"),
 6204         -
                            ),
 6205         -
                            foo_enum2: ::std::option::Option::Some(
 6206         -
                                "0".parse::<crate::model::FooEnum>()
 6207         -
                                    .expect("static value validated to member"),
 6208         -
                            ),
 6209         -
                            foo_enum3: ::std::option::Option::Some(
 6210         -
                                "1".parse::<crate::model::FooEnum>()
 6211         -
                                    .expect("static value validated to member"),
 6212         -
                            ),
 6213         -
                            foo_enum_list: ::std::option::Option::Some(vec![
 6214         -
                                "Foo"
 6215         -
                                    .parse::<crate::model::FooEnum>()
 6216         -
                                    .expect("static value validated to member"),
 6217         -
                                "0".parse::<crate::model::FooEnum>()
 6218         -
                                    .expect("static value validated to member"),
 6219         -
                            ]),
 6220         -
                            foo_enum_set: ::std::option::Option::Some(
 6221         -
                                vec![
 6222         -
                                    "Foo"
 6223         -
                                        .parse::<crate::model::FooEnum>()
 6224         -
                                        .expect("static value validated to member"),
 6225         -
                                    "0".parse::<crate::model::FooEnum>()
 6226         -
                                        .expect("static value validated to member"),
 6227         -
                                ]
 6228         -
                                .try_into()
 6229         -
                                .expect("this is only used in tests"),
 6230         -
                            ),
 6231         -
                            foo_enum_map: ::std::option::Option::Some({
 6232         -
                                let mut ret = ::std::collections::HashMap::new();
 6233         -
                                ret.insert(
 6234         -
                                    "hi".to_owned(),
 6235         -
                                    "Foo"
 6236         -
                                        .parse::<crate::model::FooEnum>()
 6237         -
                                        .expect("static value validated to member"),
 6238         -
                                );
 6239         -
                                ret.insert(
 6240         -
                                    "zero".to_owned(),
 6241         -
                                    "0".parse::<crate::model::FooEnum>()
 6242         -
                                        .expect("static value validated to member"),
 6243         -
                                );
 6244         -
                                ret
 6245         -
                            }),
 6246         -
                        };
 6247         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6248         -
                        let response = crate::output::JsonEnumsOutput {
 6249         -
                            foo_enum1: ::std::option::Option::None,
 6250         -
                            foo_enum2: ::std::option::Option::None,
 6251         -
                            foo_enum3: ::std::option::Option::None,
 6252         -
                            foo_enum_list: ::std::option::Option::None,
 6253         -
                            foo_enum_set: ::std::option::Option::None,
 6254         -
                            foo_enum_map: ::std::option::Option::None,
 6255         -
                        };
 6256         -
                        Ok(response)
 6257         -
                    };
        4037  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
 6258   4038   
                                    sender.send(()).await.expect("receiver dropped early");
 6259   4039   
                                    result
 6260   4040   
                                }
 6261   4041   
                            })
 6262   4042   
                            .build_unchecked();
 6263   4043   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6264   4044   
                .await
 6265   4045   
                .expect("unable to make an HTTP request");
 6266         -
        assert!(receiver.recv().await.is_some());
        4046  +
            ::pretty_assertions::assert_eq!(
        4047  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4048  +
                http_response.status()
        4049  +
            );
        4050  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4051  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4052  +
                http_response.headers(),
        4053  +
                expected_headers,
        4054  +
            ));
 6267   4055   
        }
 6268         -
    /// Serializes simple scalar properties
 6269         -
    /// Test ID: RestJsonJsonEnums
 6270         -
    #[::tokio::test]
 6271         -
    async fn rest_json_json_enums_response() {
 6272         -
        let output = crate::output::JsonEnumsOutput {
 6273         -
            foo_enum1: ::std::option::Option::Some(
 6274         -
                "Foo"
 6275         -
                    .parse::<crate::model::FooEnum>()
 6276         -
                    .expect("static value validated to member"),
 6277         -
            ),
 6278         -
            foo_enum2: ::std::option::Option::Some(
 6279         -
                "0".parse::<crate::model::FooEnum>()
 6280         -
                    .expect("static value validated to member"),
 6281         -
            ),
 6282         -
            foo_enum3: ::std::option::Option::Some(
 6283         -
                "1".parse::<crate::model::FooEnum>()
 6284         -
                    .expect("static value validated to member"),
 6285         -
            ),
 6286         -
            foo_enum_list: ::std::option::Option::Some(vec![
 6287         -
                "Foo"
 6288         -
                    .parse::<crate::model::FooEnum>()
 6289         -
                    .expect("static value validated to member"),
 6290         -
                "0".parse::<crate::model::FooEnum>()
 6291         -
                    .expect("static value validated to member"),
 6292         -
            ]),
 6293         -
            foo_enum_set: ::std::option::Option::Some(
 6294         -
                vec![
 6295         -
                    "Foo"
 6296         -
                        .parse::<crate::model::FooEnum>()
 6297         -
                        .expect("static value validated to member"),
 6298         -
                    "0".parse::<crate::model::FooEnum>()
 6299         -
                        .expect("static value validated to member"),
 6300         -
                ]
 6301         -
                .try_into()
 6302         -
                .expect("this is only used in tests"),
 6303         -
            ),
 6304         -
            foo_enum_map: ::std::option::Option::Some({
 6305         -
                let mut ret = ::std::collections::HashMap::new();
 6306         -
                ret.insert(
 6307         -
                    "hi".to_owned(),
 6308         -
                    "Foo"
 6309         -
                        .parse::<crate::model::FooEnum>()
 6310         -
                        .expect("static value validated to member"),
 6311         -
                );
 6312         -
                ret.insert(
 6313         -
                    "zero".to_owned(),
 6314         -
                    "0".parse::<crate::model::FooEnum>()
 6315         -
                        .expect("static value validated to member"),
 6316         -
                );
 6317         -
                ret
 6318         -
            }),
 6319         -
        };
 6320         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6321         -
        let http_response = output.into_response();
 6322         -
        ::pretty_assertions::assert_eq!(
 6323         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6324         -
            http_response.status()
 6325         -
        );
 6326         -
        let expected_headers = [("Content-Type", "application/json")];
 6327         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6328         -
            http_response.headers(),
 6329         -
            expected_headers,
 6330         -
        ));
 6331         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
        4056  +
    }
        4057  +
}
        4058  +
        4059  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADEREPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
        4060  +
::pin_project_lite::pin_project! {
        4061  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        4062  +
    /// [`MalformedTimestampHeaderEpochInput`](crate::input::MalformedTimestampHeaderEpochInput) using modelled bindings.
        4063  +
    pub struct MalformedTimestampHeaderEpochInputFuture {
        4064  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampHeaderEpochInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        4065  +
    }
        4066  +
}
        4067  +
        4068  +
impl std::future::Future for MalformedTimestampHeaderEpochInputFuture {
        4069  +
    type Output = Result<
        4070  +
        crate::input::MalformedTimestampHeaderEpochInput,
        4071  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        4072  +
    >;
        4073  +
        4074  +
    fn poll(
        4075  +
        self: std::pin::Pin<&mut Self>,
        4076  +
        cx: &mut std::task::Context<'_>,
        4077  +
    ) -> std::task::Poll<Self::Output> {
        4078  +
        let this = self.project();
        4079  +
        this.inner.as_mut().poll(cx)
        4080  +
    }
        4081  +
}
        4082  +
        4083  +
impl<B>
        4084  +
    ::aws_smithy_http_server::request::FromRequest<
        4085  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        4086  +
        B,
        4087  +
    > for crate::input::MalformedTimestampHeaderEpochInput
        4088  +
where
        4089  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        4090  +
    B: 'static,
        4091  +
        4092  +
    B::Data: Send,
        4093  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        4094  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        4095  +
{
        4096  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        4097  +
    type Future = MalformedTimestampHeaderEpochInputFuture;
        4098  +
        4099  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        4100  +
        let fut = async move {
        4101  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        4102  +
                request.headers(),
        4103  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADEREPOCH,
        4104  +
            ) {
        4105  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        4106  +
            }
        4107  +
            crate::protocol_serde::shape_malformed_timestamp_header_epoch::de_malformed_timestamp_header_epoch_http_request(request)
 6332   4108   
                            .await
 6333         -
            .expect("unable to extract body to bytes");
 6334         -
        ::aws_smithy_protocol_test::assert_ok(
 6335         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"fooEnum1\": \"Foo\",\n    \"fooEnum2\": \"0\",\n    \"fooEnum3\": \"1\",\n    \"fooEnumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumSet\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumMap\": {\n        \"hi\": \"Foo\",\n        \"zero\": \"0\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
        4109  +
                            .map_err(Into::into)
        4110  +
        };
        4111  +
        use ::futures_util::future::TryFutureExt;
        4112  +
        let fut = fut.map_err(
        4113  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        4114  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        4115  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        4116  +
                    e,
        4117  +
                )
        4118  +
            },
 6336   4119   
        );
        4120  +
        MalformedTimestampHeaderEpochInputFuture {
        4121  +
            inner: Box::pin(fut),
        4122  +
        }
 6337   4123   
    }
 6338   4124   
}
 6339         -
#[cfg(test)]
        4125  +
impl
        4126  +
    ::aws_smithy_http_server::response::IntoResponse<
        4127  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        4128  +
    > for crate::output::MalformedTimestampHeaderEpochOutput
        4129  +
{
        4130  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        4131  +
        match crate::protocol_serde::shape_malformed_timestamp_header_epoch::ser_malformed_timestamp_header_epoch_http_response(self) {
        4132  +
                        Ok(response) => response,
        4133  +
                        Err(e) => {
        4134  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        4135  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        4136  +
                        }
        4137  +
                    }
        4138  +
    }
        4139  +
}
        4140  +
impl
        4141  +
    ::aws_smithy_http_server::response::IntoResponse<
        4142  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        4143  +
    > for crate::error::MalformedTimestampHeaderEpochError
        4144  +
{
        4145  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        4146  +
        match crate::protocol_serde::shape_malformed_timestamp_header_epoch::ser_malformed_timestamp_header_epoch_http_error(&self) {
        4147  +
            Ok(mut response) => {
        4148  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        4149  +
                response
        4150  +
            },
        4151  +
            Err(e) => {
        4152  +
                ::tracing::error!(error = %e, "failed to serialize response");
        4153  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        4154  +
            }
        4155  +
        }
        4156  +
    }
        4157  +
}
        4158  +
 6340   4159   
#[allow(unreachable_code, unused_variables)]
 6341         -
mod server_json_int_enums_test {
 6342         -
    /// Serializes intEnums as integers
 6343         -
    /// Test ID: RestJsonJsonIntEnums
        4160  +
#[cfg(test)]
        4161  +
mod malformed_timestamp_header_epoch_test {
        4162  +
        4163  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        4164  +
    /// 400 SerializationException
        4165  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case0
 6344   4166   
    #[::tokio::test]
 6345         -
    async fn rest_json_json_int_enums_request() {
        4167  +
    #[::tracing_test::traced_test]
        4168  +
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case0_malformed_request() {
        4169  +
        {
 6346   4170   
            #[allow(unused_mut)]
 6347   4171   
            let mut http_request = http::Request::builder()
 6348         -
                        .uri("/JsonIntEnums")
 6349         -
                        .method("PUT")
 6350         -
        .header("Content-Type", "application/json")
 6351         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"integerEnum1\": 1,\n    \"integerEnum2\": 2,\n    \"integerEnum3\": 3,\n    \"integerEnumList\": [\n        1,\n        2,\n        3\n    ],\n    \"integerEnumSet\": [\n        1,\n        2\n    ],\n    \"integerEnumMap\": {\n        \"abc\": 1,\n        \"def\": 2\n    }\n}".as_bytes()))).unwrap();
        4172  +
                .uri("/MalformedTimestampHeaderEpoch")
        4173  +
                .method("POST")
        4174  +
                .header("timestamp", "1985-04-12T23:20:50.52Z")
        4175  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4176  +
                .unwrap();
 6352   4177   
            #[allow(unused_mut)]
 6353   4178   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6354   4179   
            let config = crate::service::RestJsonConfig::builder().build();
 6355   4180   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6356         -
            .json_int_enums(move |input: crate::input::JsonIntEnumsInput| {
        4181  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 6357   4182   
                                let sender = sender.clone();
 6358   4183   
                                async move {
 6359         -
                    let result = {
 6360         -
                        let expected = crate::input::JsonIntEnumsInput {
 6361         -
                            integer_enum1: ::std::option::Option::Some(1),
 6362         -
                            integer_enum2: ::std::option::Option::Some(2),
 6363         -
                            integer_enum3: ::std::option::Option::Some(3),
 6364         -
                            integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
 6365         -
                            integer_enum_set: ::std::option::Option::Some(
 6366         -
                                vec![1, 2].try_into().expect("this is only used in tests"),
 6367         -
                            ),
 6368         -
                            integer_enum_map: ::std::option::Option::Some({
 6369         -
                                let mut ret = ::std::collections::HashMap::new();
 6370         -
                                ret.insert("abc".to_owned(), 1);
 6371         -
                                ret.insert("def".to_owned(), 2);
 6372         -
                                ret
 6373         -
                            }),
 6374         -
                        };
 6375         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6376         -
                        let response = crate::output::JsonIntEnumsOutput {
 6377         -
                            integer_enum1: ::std::option::Option::None,
 6378         -
                            integer_enum2: ::std::option::Option::None,
 6379         -
                            integer_enum3: ::std::option::Option::None,
 6380         -
                            integer_enum_list: ::std::option::Option::None,
 6381         -
                            integer_enum_set: ::std::option::Option::None,
 6382         -
                            integer_enum_map: ::std::option::Option::None,
 6383         -
                        };
 6384         -
                        Ok(response)
 6385         -
                    };
        4184  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 6386   4185   
                                    sender.send(()).await.expect("receiver dropped early");
 6387   4186   
                                    result
 6388   4187   
                                }
 6389   4188   
                            })
 6390   4189   
                            .build_unchecked();
 6391   4190   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6392   4191   
                .await
 6393   4192   
                .expect("unable to make an HTTP request");
 6394         -
        assert!(receiver.recv().await.is_some());
 6395         -
    }
 6396         -
    /// Serializes intEnums as integers
 6397         -
    /// Test ID: RestJsonJsonIntEnums
 6398         -
    #[::tokio::test]
 6399         -
    async fn rest_json_json_int_enums_response() {
 6400         -
        let output = crate::output::JsonIntEnumsOutput {
 6401         -
            integer_enum1: ::std::option::Option::Some(1),
 6402         -
            integer_enum2: ::std::option::Option::Some(2),
 6403         -
            integer_enum3: ::std::option::Option::Some(3),
 6404         -
            integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
 6405         -
            integer_enum_set: ::std::option::Option::Some(
 6406         -
                vec![1, 2].try_into().expect("this is only used in tests"),
 6407         -
            ),
 6408         -
            integer_enum_map: ::std::option::Option::Some({
 6409         -
                let mut ret = ::std::collections::HashMap::new();
 6410         -
                ret.insert("abc".to_owned(), 1);
 6411         -
                ret.insert("def".to_owned(), 2);
 6412         -
                ret
 6413         -
            }),
 6414         -
        };
 6415         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6416         -
        let http_response = output.into_response();
 6417   4193   
            ::pretty_assertions::assert_eq!(
 6418         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4194  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 6419   4195   
                http_response.status()
 6420   4196   
            );
 6421         -
        let expected_headers = [("Content-Type", "application/json")];
        4197  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 6422   4198   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6423   4199   
                http_response.headers(),
 6424   4200   
                expected_headers,
 6425   4201   
            ));
 6426         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 6427         -
            .await
 6428         -
            .expect("unable to extract body to bytes");
 6429         -
        ::aws_smithy_protocol_test::assert_ok(
 6430         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"integerEnum1\": 1,\n    \"integerEnum2\": 2,\n    \"integerEnum3\": 3,\n    \"integerEnumList\": [\n        1,\n        2,\n        3\n    ],\n    \"integerEnumSet\": [\n        1,\n        2\n    ],\n    \"integerEnumMap\": {\n        \"abc\": 1,\n        \"def\": 2\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 6431         -
        );
 6432   4202   
        }
 6433         -
}
 6434         -
#[cfg(test)]
 6435         -
#[allow(unreachable_code, unused_variables)]
 6436         -
mod server_json_lists_test {
 6437         -
    /// Serializes JSON lists
 6438         -
    /// Test ID: RestJsonLists
        4203  +
    }
        4204  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        4205  +
    /// 400 SerializationException
        4206  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case1
 6439   4207   
    #[::tokio::test]
 6440         -
    async fn rest_json_lists_request() {
        4208  +
    #[::tracing_test::traced_test]
        4209  +
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case1_malformed_request() {
        4210  +
        {
 6441   4211   
            #[allow(unused_mut)]
 6442   4212   
            let mut http_request = http::Request::builder()
 6443         -
                        .uri("/JsonLists")
 6444         -
                        .method("PUT")
 6445         -
        .header("Content-Type", "application/json")
 6446         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"stringList\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"stringSet\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"integerList\": [\n        1,\n        2\n    ],\n    \"booleanList\": [\n        true,\n        false\n    ],\n    \"timestampList\": [\n        1398796238,\n        1398796238\n    ],\n    \"enumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"intEnumList\": [\n        1,\n        2\n    ],\n    \"nestedStringList\": [\n        [\n            \"foo\",\n            \"bar\"\n        ],\n        [\n            \"baz\",\n            \"qux\"\n        ]\n    ],\n    \"myStructureList\": [\n        {\n            \"value\": \"1\",\n            \"other\": \"2\"\n        },\n        {\n            \"value\": \"3\",\n            \"other\": \"4\"\n        }\n    ]\n}".as_bytes()))).unwrap();
        4213  +
                .uri("/MalformedTimestampHeaderEpoch")
        4214  +
                .method("POST")
        4215  +
                .header("timestamp", "1985-04-12T23:20:50Z")
        4216  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4217  +
                .unwrap();
 6447   4218   
            #[allow(unused_mut)]
 6448   4219   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6449   4220   
            let config = crate::service::RestJsonConfig::builder().build();
 6450   4221   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6451         -
            .json_lists(move |input: crate::input::JsonListsInput| {
        4222  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 6452   4223   
                                let sender = sender.clone();
 6453   4224   
                                async move {
 6454         -
                    let result = {
 6455         -
                        let expected = crate::input::JsonListsInput {
 6456         -
                            string_list: ::std::option::Option::Some(vec![
 6457         -
                                "foo".to_owned(),
 6458         -
                                "bar".to_owned(),
 6459         -
                            ]),
 6460         -
                            string_set: ::std::option::Option::Some(
 6461         -
                                vec!["foo".to_owned(), "bar".to_owned()]
 6462         -
                                    .try_into()
 6463         -
                                    .expect("this is only used in tests"),
 6464         -
                            ),
 6465         -
                            integer_list: ::std::option::Option::Some(vec![1, 2]),
 6466         -
                            boolean_list: ::std::option::Option::Some(vec![true, false]),
 6467         -
                            timestamp_list: ::std::option::Option::Some(vec![
 6468         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 6469         -
                                    1398796238, 0_f64,
 6470         -
                                ),
 6471         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 6472         -
                                    1398796238, 0_f64,
 6473         -
                                ),
 6474         -
                            ]),
 6475         -
                            enum_list: ::std::option::Option::Some(vec![
 6476         -
                                "Foo"
 6477         -
                                    .parse::<crate::model::FooEnum>()
 6478         -
                                    .expect("static value validated to member"),
 6479         -
                                "0".parse::<crate::model::FooEnum>()
 6480         -
                                    .expect("static value validated to member"),
 6481         -
                            ]),
 6482         -
                            int_enum_list: ::std::option::Option::Some(vec![1, 2]),
 6483         -
                            nested_string_list: ::std::option::Option::Some(vec![
 6484         -
                                vec!["foo".to_owned(), "bar".to_owned()],
 6485         -
                                vec!["baz".to_owned(), "qux".to_owned()],
 6486         -
                            ]),
 6487         -
                            structure_list: ::std::option::Option::Some(vec![
 6488         -
                                crate::model::StructureListMember {
 6489         -
                                    a: ::std::option::Option::Some("1".to_owned()),
 6490         -
                                    b: ::std::option::Option::Some("2".to_owned()),
 6491         -
                                },
 6492         -
                                crate::model::StructureListMember {
 6493         -
                                    a: ::std::option::Option::Some("3".to_owned()),
 6494         -
                                    b: ::std::option::Option::Some("4".to_owned()),
 6495         -
                                },
 6496         -
                            ]),
 6497         -
                        };
 6498         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6499         -
                        let response = crate::output::JsonListsOutput {
 6500         -
                            string_list: ::std::option::Option::None,
 6501         -
                            string_set: ::std::option::Option::None,
 6502         -
                            integer_list: ::std::option::Option::None,
 6503         -
                            boolean_list: ::std::option::Option::None,
 6504         -
                            timestamp_list: ::std::option::Option::None,
 6505         -
                            enum_list: ::std::option::Option::None,
 6506         -
                            int_enum_list: ::std::option::Option::None,
 6507         -
                            nested_string_list: ::std::option::Option::None,
 6508         -
                            structure_list: ::std::option::Option::None,
 6509         -
                        };
 6510         -
                        Ok(response)
 6511         -
                    };
        4225  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 6512   4226   
                                    sender.send(()).await.expect("receiver dropped early");
 6513   4227   
                                    result
 6514   4228   
                                }
 6515   4229   
                            })
 6516   4230   
                            .build_unchecked();
 6517   4231   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6518   4232   
                .await
 6519   4233   
                .expect("unable to make an HTTP request");
 6520         -
        assert!(receiver.recv().await.is_some());
        4234  +
            ::pretty_assertions::assert_eq!(
        4235  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4236  +
                http_response.status()
        4237  +
            );
        4238  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4239  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4240  +
                http_response.headers(),
        4241  +
                expected_headers,
        4242  +
            ));
 6521   4243   
        }
 6522         -
    /// Serializes empty JSON lists
 6523         -
    /// Test ID: RestJsonListsEmpty
        4244  +
    }
        4245  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        4246  +
    /// 400 SerializationException
        4247  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case2
 6524   4248   
    #[::tokio::test]
 6525         -
    async fn rest_json_lists_empty_request() {
        4249  +
    #[::tracing_test::traced_test]
        4250  +
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case2_malformed_request() {
        4251  +
        {
 6526   4252   
            #[allow(unused_mut)]
 6527   4253   
            let mut http_request = http::Request::builder()
 6528         -
            .uri("/JsonLists")
 6529         -
            .method("PUT")
 6530         -
            .header("Content-Type", "application/json")
 6531         -
            .body(::aws_smithy_http_server::body::Body::from(
 6532         -
                ::bytes::Bytes::from_static("{\n    \"stringList\": []\n}".as_bytes()),
 6533         -
            ))
        4254  +
                .uri("/MalformedTimestampHeaderEpoch")
        4255  +
                .method("POST")
        4256  +
                .header("timestamp", "1996-12-19T16:39:57-08:00")
        4257  +
                .body(::aws_smithy_http_server::body::Body::empty())
 6534   4258   
                .unwrap();
 6535   4259   
            #[allow(unused_mut)]
 6536   4260   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6537   4261   
            let config = crate::service::RestJsonConfig::builder().build();
 6538   4262   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6539         -
            .json_lists(move |input: crate::input::JsonListsInput| {
        4263  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 6540   4264   
                                let sender = sender.clone();
 6541   4265   
                                async move {
 6542         -
                    let result = {
 6543         -
                        let expected = crate::input::JsonListsInput {
 6544         -
                            string_list: ::std::option::Option::Some(vec![]),
 6545         -
                            string_set: ::std::option::Option::None,
 6546         -
                            integer_list: ::std::option::Option::None,
 6547         -
                            boolean_list: ::std::option::Option::None,
 6548         -
                            timestamp_list: ::std::option::Option::None,
 6549         -
                            enum_list: ::std::option::Option::None,
 6550         -
                            int_enum_list: ::std::option::Option::None,
 6551         -
                            nested_string_list: ::std::option::Option::None,
 6552         -
                            structure_list: ::std::option::Option::None,
 6553         -
                        };
 6554         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6555         -
                        let response = crate::output::JsonListsOutput {
 6556         -
                            string_list: ::std::option::Option::None,
 6557         -
                            string_set: ::std::option::Option::None,
 6558         -
                            integer_list: ::std::option::Option::None,
 6559         -
                            boolean_list: ::std::option::Option::None,
 6560         -
                            timestamp_list: ::std::option::Option::None,
 6561         -
                            enum_list: ::std::option::Option::None,
 6562         -
                            int_enum_list: ::std::option::Option::None,
 6563         -
                            nested_string_list: ::std::option::Option::None,
 6564         -
                            structure_list: ::std::option::Option::None,
 6565         -
                        };
 6566         -
                        Ok(response)
 6567         -
                    };
        4266  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 6568   4267   
                                    sender.send(()).await.expect("receiver dropped early");
 6569   4268   
                                    result
 6570   4269   
                                }
 6571   4270   
                            })
 6572   4271   
                            .build_unchecked();
 6573   4272   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6574   4273   
                .await
 6575   4274   
                .expect("unable to make an HTTP request");
 6576         -
        assert!(receiver.recv().await.is_some());
 6577         -
    }
 6578         -
    /// Serializes JSON lists
 6579         -
    /// Test ID: RestJsonLists
 6580         -
    #[::tokio::test]
 6581         -
    async fn rest_json_lists_response() {
 6582         -
        let output = crate::output::JsonListsOutput {
 6583         -
            string_list: ::std::option::Option::Some(vec!["foo".to_owned(), "bar".to_owned()]),
 6584         -
            string_set: ::std::option::Option::Some(
 6585         -
                vec!["foo".to_owned(), "bar".to_owned()]
 6586         -
                    .try_into()
 6587         -
                    .expect("this is only used in tests"),
 6588         -
            ),
 6589         -
            integer_list: ::std::option::Option::Some(vec![1, 2]),
 6590         -
            boolean_list: ::std::option::Option::Some(vec![true, false]),
 6591         -
            timestamp_list: ::std::option::Option::Some(vec![
 6592         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 6593         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 6594         -
            ]),
 6595         -
            enum_list: ::std::option::Option::Some(vec![
 6596         -
                "Foo"
 6597         -
                    .parse::<crate::model::FooEnum>()
 6598         -
                    .expect("static value validated to member"),
 6599         -
                "0".parse::<crate::model::FooEnum>()
 6600         -
                    .expect("static value validated to member"),
 6601         -
            ]),
 6602         -
            int_enum_list: ::std::option::Option::Some(vec![1, 2]),
 6603         -
            nested_string_list: ::std::option::Option::Some(vec![
 6604         -
                vec!["foo".to_owned(), "bar".to_owned()],
 6605         -
                vec!["baz".to_owned(), "qux".to_owned()],
 6606         -
            ]),
 6607         -
            structure_list: ::std::option::Option::Some(vec![
 6608         -
                crate::model::StructureListMember {
 6609         -
                    a: ::std::option::Option::Some("1".to_owned()),
 6610         -
                    b: ::std::option::Option::Some("2".to_owned()),
 6611         -
                },
 6612         -
                crate::model::StructureListMember {
 6613         -
                    a: ::std::option::Option::Some("3".to_owned()),
 6614         -
                    b: ::std::option::Option::Some("4".to_owned()),
 6615         -
                },
 6616         -
            ]),
 6617         -
        };
 6618         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6619         -
        let http_response = output.into_response();
 6620   4275   
            ::pretty_assertions::assert_eq!(
 6621         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4276  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 6622   4277   
                http_response.status()
 6623   4278   
            );
 6624         -
        let expected_headers = [("Content-Type", "application/json")];
        4279  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 6625   4280   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6626   4281   
                http_response.headers(),
 6627   4282   
                expected_headers,
 6628   4283   
            ));
 6629         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 6630         -
            .await
 6631         -
            .expect("unable to extract body to bytes");
 6632         -
        ::aws_smithy_protocol_test::assert_ok(
 6633         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"stringList\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"stringSet\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"integerList\": [\n        1,\n        2\n    ],\n    \"booleanList\": [\n        true,\n        false\n    ],\n    \"timestampList\": [\n        1398796238,\n        1398796238\n    ],\n    \"enumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"intEnumList\": [\n        1,\n        2\n    ],\n    \"nestedStringList\": [\n        [\n            \"foo\",\n            \"bar\"\n        ],\n        [\n            \"baz\",\n            \"qux\"\n        ]\n    ],\n    \"myStructureList\": [\n        {\n            \"value\": \"1\",\n            \"other\": \"2\"\n        },\n        {\n            \"value\": \"3\",\n            \"other\": \"4\"\n        }\n    ]\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 6634         -
        );
 6635   4284   
        }
 6636         -
    /// Serializes empty JSON lists
 6637         -
    /// Test ID: RestJsonListsEmpty
 6638         -
    #[::tokio::test]
 6639         -
    async fn rest_json_lists_empty_response() {
 6640         -
        let output = crate::output::JsonListsOutput {
 6641         -
            string_list: ::std::option::Option::Some(vec![]),
 6642         -
            string_set: ::std::option::Option::None,
 6643         -
            integer_list: ::std::option::Option::None,
 6644         -
            boolean_list: ::std::option::Option::None,
 6645         -
            timestamp_list: ::std::option::Option::None,
 6646         -
            enum_list: ::std::option::Option::None,
 6647         -
            int_enum_list: ::std::option::Option::None,
 6648         -
            nested_string_list: ::std::option::Option::None,
 6649         -
            structure_list: ::std::option::Option::None,
 6650         -
        };
 6651         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6652         -
        let http_response = output.into_response();
 6653         -
        ::pretty_assertions::assert_eq!(
 6654         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6655         -
            http_response.status()
 6656         -
        );
 6657         -
        let expected_headers = [("Content-Type", "application/json")];
 6658         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6659         -
            http_response.headers(),
 6660         -
            expected_headers,
 6661         -
        ));
 6662         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 6663         -
            .await
 6664         -
            .expect("unable to extract body to bytes");
 6665         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 6666         -
            &body,
 6667         -
            "{\n    \"stringList\": []\n}",
 6668         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 6669         -
        ));
 6670   4285   
    }
 6671         -
}
 6672         -
#[cfg(test)]
 6673         -
#[allow(unreachable_code, unused_variables)]
 6674         -
mod server_json_maps_test {
 6675         -
    /// Serializes JSON maps
 6676         -
    /// Test ID: RestJsonJsonMaps
        4286  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        4287  +
    /// 400 SerializationException
        4288  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsHttpDate_case0
 6677   4289   
    #[::tokio::test]
 6678         -
    async fn rest_json_json_maps_request() {
        4290  +
    #[::tracing_test::traced_test]
        4291  +
    async fn rest_json_header_timestamp_epoch_rejects_http_date_case0_malformed_request() {
        4292  +
        {
 6679   4293   
            #[allow(unused_mut)]
 6680   4294   
            let mut http_request = http::Request::builder()
 6681         -
                        .uri("/JsonMaps")
        4295  +
                .uri("/MalformedTimestampHeaderEpoch")
 6682   4296   
                .method("POST")
 6683         -
        .header("Content-Type", "application/json")
 6684         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"denseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}".as_bytes()))).unwrap();
        4297  +
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
        4298  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4299  +
                .unwrap();
 6685   4300   
            #[allow(unused_mut)]
 6686   4301   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6687   4302   
            let config = crate::service::RestJsonConfig::builder().build();
 6688   4303   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6689         -
            .json_maps(move |input: crate::input::JsonMapsInput| {
        4304  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 6690   4305   
                                let sender = sender.clone();
 6691   4306   
                                async move {
 6692         -
                    let result = {
 6693         -
                        let expected = crate::input::JsonMapsInput {
 6694         -
                            dense_struct_map: ::std::option::Option::Some({
 6695         -
                                let mut ret = ::std::collections::HashMap::new();
 6696         -
                                ret.insert(
 6697         -
                                    "foo".to_owned(),
 6698         -
                                    crate::model::GreetingStruct {
 6699         -
                                        hi: ::std::option::Option::Some("there".to_owned()),
 6700         -
                                    },
 6701         -
                                );
 6702         -
                                ret.insert(
 6703         -
                                    "baz".to_owned(),
 6704         -
                                    crate::model::GreetingStruct {
 6705         -
                                        hi: ::std::option::Option::Some("bye".to_owned()),
 6706         -
                                    },
 6707         -
                                );
 6708         -
                                ret
 6709         -
                            }),
 6710         -
                            dense_number_map: ::std::option::Option::None,
 6711         -
                            dense_boolean_map: ::std::option::Option::None,
 6712         -
                            dense_string_map: ::std::option::Option::None,
 6713         -
                            dense_set_map: ::std::option::Option::None,
 6714         -
                        };
 6715         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6716         -
                        let response = crate::output::JsonMapsOutput {
 6717         -
                            dense_struct_map: ::std::option::Option::None,
 6718         -
                            dense_number_map: ::std::option::Option::None,
 6719         -
                            dense_boolean_map: ::std::option::Option::None,
 6720         -
                            dense_string_map: ::std::option::Option::None,
 6721         -
                            dense_set_map: ::std::option::Option::None,
 6722         -
                        };
 6723         -
                        Ok(response)
 6724         -
                    };
        4307  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 6725   4308   
                                    sender.send(()).await.expect("receiver dropped early");
 6726   4309   
                                    result
 6727   4310   
                                }
 6728   4311   
                            })
 6729   4312   
                            .build_unchecked();
 6730   4313   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6731   4314   
                .await
 6732   4315   
                .expect("unable to make an HTTP request");
 6733         -
        assert!(receiver.recv().await.is_some());
        4316  +
            ::pretty_assertions::assert_eq!(
        4317  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4318  +
                http_response.status()
        4319  +
            );
        4320  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4321  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4322  +
                http_response.headers(),
        4323  +
                expected_headers,
        4324  +
            ));
 6734   4325   
        }
 6735         -
    /// Ensure that 0 and false are sent over the wire in all maps and lists
 6736         -
    /// Test ID: RestJsonSerializesZeroValuesInMaps
        4326  +
    }
        4327  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4328  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case0
 6737   4329   
    #[::tokio::test]
 6738         -
    async fn rest_json_serializes_zero_values_in_maps_request() {
 6739         -
        #[allow(unused_mut)]
        4330  +
    #[::tracing_test::traced_test]
        4331  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
        4332  +
        {
        4333  +
            #[allow(unused_mut)]
 6740   4334   
            let mut http_request = http::Request::builder()
 6741         -
                        .uri("/JsonMaps")
        4335  +
                .uri("/MalformedTimestampHeaderEpoch")
 6742   4336   
                .method("POST")
 6743         -
        .header("Content-Type", "application/json")
 6744         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"denseNumberMap\": {\n        \"x\": 0\n    },\n    \"denseBooleanMap\": {\n        \"x\": false\n    }\n}".as_bytes()))).unwrap();
        4337  +
                .header("timestamp", "true")
        4338  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4339  +
                .unwrap();
 6745   4340   
            #[allow(unused_mut)]
 6746   4341   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6747   4342   
            let config = crate::service::RestJsonConfig::builder().build();
 6748   4343   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6749         -
            .json_maps(move |input: crate::input::JsonMapsInput| {
        4344  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 6750   4345   
                                let sender = sender.clone();
 6751   4346   
                                async move {
 6752         -
                    let result = {
 6753         -
                        let expected = crate::input::JsonMapsInput {
 6754         -
                            dense_number_map: ::std::option::Option::Some({
 6755         -
                                let mut ret = ::std::collections::HashMap::new();
 6756         -
                                ret.insert("x".to_owned(), 0);
 6757         -
                                ret
 6758         -
                            }),
 6759         -
                            dense_boolean_map: ::std::option::Option::Some({
 6760         -
                                let mut ret = ::std::collections::HashMap::new();
 6761         -
                                ret.insert("x".to_owned(), false);
 6762         -
                                ret
 6763         -
                            }),
 6764         -
                            dense_struct_map: ::std::option::Option::None,
 6765         -
                            dense_string_map: ::std::option::Option::None,
 6766         -
                            dense_set_map: ::std::option::Option::None,
 6767         -
                        };
 6768         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6769         -
                        let response = crate::output::JsonMapsOutput {
 6770         -
                            dense_struct_map: ::std::option::Option::None,
 6771         -
                            dense_number_map: ::std::option::Option::None,
 6772         -
                            dense_boolean_map: ::std::option::Option::None,
 6773         -
                            dense_string_map: ::std::option::Option::None,
 6774         -
                            dense_set_map: ::std::option::Option::None,
 6775         -
                        };
 6776         -
                        Ok(response)
 6777         -
                    };
        4347  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 6778   4348   
                                    sender.send(()).await.expect("receiver dropped early");
 6779   4349   
                                    result
 6780   4350   
                                }
 6781   4351   
                            })
 6782   4352   
                            .build_unchecked();
 6783   4353   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6784   4354   
                .await
 6785   4355   
                .expect("unable to make an HTTP request");
 6786         -
        assert!(receiver.recv().await.is_some());
        4356  +
            ::pretty_assertions::assert_eq!(
        4357  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4358  +
                http_response.status()
        4359  +
            );
        4360  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4361  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4362  +
                http_response.headers(),
        4363  +
                expected_headers,
        4364  +
            ));
 6787   4365   
        }
 6788         -
    /// A request that contains a dense map of sets.
 6789         -
    /// Test ID: RestJsonSerializesDenseSetMap
        4366  +
    }
        4367  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4368  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case1
 6790   4369   
    #[::tokio::test]
 6791         -
    async fn rest_json_serializes_dense_set_map_request() {
        4370  +
    #[::tracing_test::traced_test]
        4371  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
        4372  +
        {
 6792   4373   
            #[allow(unused_mut)]
 6793   4374   
            let mut http_request = http::Request::builder()
 6794         -
                        .uri("/JsonMaps")
        4375  +
                .uri("/MalformedTimestampHeaderEpoch")
 6795   4376   
                .method("POST")
 6796         -
        .header("Content-Type", "application/json")
 6797         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"denseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}".as_bytes()))).unwrap();
        4377  +
                .header("timestamp", "1515531081ABC")
        4378  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4379  +
                .unwrap();
 6798   4380   
            #[allow(unused_mut)]
 6799   4381   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6800   4382   
            let config = crate::service::RestJsonConfig::builder().build();
 6801   4383   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6802         -
            .json_maps(move |input: crate::input::JsonMapsInput| {
        4384  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 6803   4385   
                                let sender = sender.clone();
 6804   4386   
                                async move {
 6805         -
                    let result = {
 6806         -
                        let expected = crate::input::JsonMapsInput {
 6807         -
                            dense_set_map: ::std::option::Option::Some({
 6808         -
                                let mut ret = ::std::collections::HashMap::new();
 6809         -
                                ret.insert(
 6810         -
                                    "x".to_owned(),
 6811         -
                                    vec![].try_into().expect("this is only used in tests"),
 6812         -
                                );
 6813         -
                                ret.insert(
 6814         -
                                    "y".to_owned(),
 6815         -
                                    vec!["a".to_owned(), "b".to_owned()]
 6816         -
                                        .try_into()
 6817         -
                                        .expect("this is only used in tests"),
 6818         -
                                );
 6819         -
                                ret
 6820         -
                            }),
 6821         -
                            dense_struct_map: ::std::option::Option::None,
 6822         -
                            dense_number_map: ::std::option::Option::None,
 6823         -
                            dense_boolean_map: ::std::option::Option::None,
 6824         -
                            dense_string_map: ::std::option::Option::None,
 6825         -
                        };
 6826         -
                        ::pretty_assertions::assert_eq!(input, expected);
 6827         -
                        let response = crate::output::JsonMapsOutput {
 6828         -
                            dense_struct_map: ::std::option::Option::None,
 6829         -
                            dense_number_map: ::std::option::Option::None,
 6830         -
                            dense_boolean_map: ::std::option::Option::None,
 6831         -
                            dense_string_map: ::std::option::Option::None,
 6832         -
                            dense_set_map: ::std::option::Option::None,
 6833         -
                        };
 6834         -
                        Ok(response)
 6835         -
                    };
        4387  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 6836   4388   
                                    sender.send(()).await.expect("receiver dropped early");
 6837   4389   
                                    result
 6838   4390   
                                }
 6839   4391   
                            })
 6840   4392   
                            .build_unchecked();
 6841   4393   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 6842   4394   
                .await
 6843   4395   
                .expect("unable to make an HTTP request");
 6844         -
        assert!(receiver.recv().await.is_some());
 6845         -
    }
 6846         -
    /// Deserializes JSON maps
 6847         -
    /// Test ID: RestJsonJsonMaps
 6848         -
    #[::tokio::test]
 6849         -
    async fn rest_json_json_maps_response() {
 6850         -
        let output = crate::output::JsonMapsOutput {
 6851         -
            dense_struct_map: ::std::option::Option::Some({
 6852         -
                let mut ret = ::std::collections::HashMap::new();
 6853         -
                ret.insert(
 6854         -
                    "foo".to_owned(),
 6855         -
                    crate::model::GreetingStruct {
 6856         -
                        hi: ::std::option::Option::Some("there".to_owned()),
 6857         -
                    },
 6858         -
                );
 6859         -
                ret.insert(
 6860         -
                    "baz".to_owned(),
 6861         -
                    crate::model::GreetingStruct {
 6862         -
                        hi: ::std::option::Option::Some("bye".to_owned()),
 6863         -
                    },
 6864         -
                );
 6865         -
                ret
 6866         -
            }),
 6867         -
            dense_number_map: ::std::option::Option::None,
 6868         -
            dense_boolean_map: ::std::option::Option::None,
 6869         -
            dense_string_map: ::std::option::Option::None,
 6870         -
            dense_set_map: ::std::option::Option::None,
 6871         -
        };
 6872         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6873         -
        let http_response = output.into_response();
 6874         -
        ::pretty_assertions::assert_eq!(
 6875         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6876         -
            http_response.status()
 6877         -
        );
 6878         -
        let expected_headers = [("Content-Type", "application/json")];
 6879         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6880         -
            http_response.headers(),
 6881         -
            expected_headers,
 6882         -
        ));
 6883         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 6884         -
            .await
 6885         -
            .expect("unable to extract body to bytes");
 6886         -
        ::aws_smithy_protocol_test::assert_ok(
 6887         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"denseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 6888         -
        );
 6889         -
    }
 6890         -
    /// Ensure that 0 and false are sent over the wire in all maps and lists
 6891         -
    /// Test ID: RestJsonDeserializesZeroValuesInMaps
 6892         -
    #[::tokio::test]
 6893         -
    async fn rest_json_deserializes_zero_values_in_maps_response() {
 6894         -
        let output = crate::output::JsonMapsOutput {
 6895         -
            dense_number_map: ::std::option::Option::Some({
 6896         -
                let mut ret = ::std::collections::HashMap::new();
 6897         -
                ret.insert("x".to_owned(), 0);
 6898         -
                ret
 6899         -
            }),
 6900         -
            dense_boolean_map: ::std::option::Option::Some({
 6901         -
                let mut ret = ::std::collections::HashMap::new();
 6902         -
                ret.insert("x".to_owned(), false);
 6903         -
                ret
 6904         -
            }),
 6905         -
            dense_struct_map: ::std::option::Option::None,
 6906         -
            dense_string_map: ::std::option::Option::None,
 6907         -
            dense_set_map: ::std::option::Option::None,
 6908         -
        };
 6909         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6910         -
        let http_response = output.into_response();
 6911   4396   
            ::pretty_assertions::assert_eq!(
 6912         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4397  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 6913   4398   
                http_response.status()
 6914   4399   
            );
 6915         -
        let expected_headers = [("Content-Type", "application/json")];
        4400  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 6916   4401   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6917   4402   
                http_response.headers(),
 6918   4403   
                expected_headers,
 6919   4404   
            ));
 6920         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 6921         -
            .await
 6922         -
            .expect("unable to extract body to bytes");
 6923         -
        ::aws_smithy_protocol_test::assert_ok(
 6924         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"denseNumberMap\": {\n        \"x\": 0\n    },\n    \"denseBooleanMap\": {\n        \"x\": false\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 6925         -
        );
 6926   4405   
        }
 6927         -
    /// A response that contains a dense map of sets.
 6928         -
    /// Test ID: RestJsonDeserializesDenseSetMap
 6929         -
    #[::tokio::test]
 6930         -
    async fn rest_json_deserializes_dense_set_map_response() {
 6931         -
        let output = crate::output::JsonMapsOutput {
 6932         -
            dense_set_map: ::std::option::Option::Some({
 6933         -
                let mut ret = ::std::collections::HashMap::new();
 6934         -
                ret.insert(
 6935         -
                    "x".to_owned(),
 6936         -
                    vec![].try_into().expect("this is only used in tests"),
 6937         -
                );
 6938         -
                ret.insert(
 6939         -
                    "y".to_owned(),
 6940         -
                    vec!["a".to_owned(), "b".to_owned()]
 6941         -
                        .try_into()
 6942         -
                        .expect("this is only used in tests"),
 6943         -
                );
 6944         -
                ret
 6945         -
            }),
 6946         -
            dense_struct_map: ::std::option::Option::None,
 6947         -
            dense_number_map: ::std::option::Option::None,
 6948         -
            dense_boolean_map: ::std::option::Option::None,
 6949         -
            dense_string_map: ::std::option::Option::None,
 6950         -
        };
 6951         -
        use ::aws_smithy_http_server::response::IntoResponse;
 6952         -
        let http_response = output.into_response();
 6953         -
        ::pretty_assertions::assert_eq!(
 6954         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 6955         -
            http_response.status()
 6956         -
        );
 6957         -
        let expected_headers = [("Content-Type", "application/json")];
 6958         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 6959         -
            http_response.headers(),
 6960         -
            expected_headers,
 6961         -
        ));
 6962         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 6963         -
            .await
 6964         -
            .expect("unable to extract body to bytes");
 6965         -
        ::aws_smithy_protocol_test::assert_ok(
 6966         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"denseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 6967         -
        );
 6968   4406   
    }
 6969         -
}
 6970         -
#[cfg(test)]
 6971         -
#[allow(unreachable_code, unused_variables)]
 6972         -
mod server_json_timestamps_test {
 6973         -
    /// Tests how normal timestamps are serialized
 6974         -
    /// Test ID: RestJsonJsonTimestamps
        4407  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4408  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case2
 6975   4409   
    #[::tokio::test]
 6976         -
    async fn rest_json_json_timestamps_request() {
        4410  +
    #[::tracing_test::traced_test]
        4411  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
        4412  +
        {
 6977   4413   
            #[allow(unused_mut)]
 6978   4414   
            let mut http_request = http::Request::builder()
 6979         -
            .uri("/JsonTimestamps")
        4415  +
                .uri("/MalformedTimestampHeaderEpoch")
 6980   4416   
                .method("POST")
 6981         -
            .header("Content-Type", "application/json")
 6982         -
            .body(::aws_smithy_http_server::body::Body::from(
 6983         -
                ::bytes::Bytes::from_static("{\n    \"normal\": 1398796238\n}".as_bytes()),
 6984         -
            ))
        4417  +
                .header("timestamp", "0x42")
        4418  +
                .body(::aws_smithy_http_server::body::Body::empty())
 6985   4419   
                .unwrap();
 6986   4420   
            #[allow(unused_mut)]
 6987   4421   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 6988   4422   
            let config = crate::service::RestJsonConfig::builder().build();
 6989   4423   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 6990         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
        4424  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 6991   4425   
                                let sender = sender.clone();
 6992   4426   
                                async move {
 6993         -
                    let result = {
 6994         -
                        let expected = crate::input::JsonTimestampsInput {
 6995         -
                            normal: ::std::option::Option::Some(
 6996         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 6997         -
                                    1398796238, 0_f64,
 6998         -
                                ),
 6999         -
                            ),
 7000         -
                            date_time: ::std::option::Option::None,
 7001         -
                            date_time_on_target: ::std::option::Option::None,
 7002         -
                            epoch_seconds: ::std::option::Option::None,
 7003         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7004         -
                            http_date: ::std::option::Option::None,
 7005         -
                            http_date_on_target: ::std::option::Option::None,
 7006         -
                        };
 7007         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7008         -
                        let response = crate::output::JsonTimestampsOutput {
 7009         -
                            normal: ::std::option::Option::None,
 7010         -
                            date_time: ::std::option::Option::None,
 7011         -
                            date_time_on_target: ::std::option::Option::None,
 7012         -
                            epoch_seconds: ::std::option::Option::None,
 7013         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7014         -
                            http_date: ::std::option::Option::None,
 7015         -
                            http_date_on_target: ::std::option::Option::None,
 7016         -
                        };
 7017         -
                        response
 7018         -
                    };
        4427  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 7019   4428   
                                    sender.send(()).await.expect("receiver dropped early");
 7020   4429   
                                    result
 7021   4430   
                                }
 7022   4431   
                            })
 7023   4432   
                            .build_unchecked();
 7024   4433   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7025   4434   
                .await
 7026   4435   
                .expect("unable to make an HTTP request");
 7027         -
        assert!(receiver.recv().await.is_some());
        4436  +
            ::pretty_assertions::assert_eq!(
        4437  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4438  +
                http_response.status()
        4439  +
            );
        4440  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4441  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4442  +
                http_response.headers(),
        4443  +
                expected_headers,
        4444  +
            ));
 7028   4445   
        }
 7029         -
    /// Ensures that the timestampFormat of date-time works like normal timestamps
 7030         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
        4446  +
    }
        4447  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4448  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case3
 7031   4449   
    #[::tokio::test]
 7032         -
    async fn rest_json_json_timestamps_with_date_time_format_request() {
        4450  +
    #[::tracing_test::traced_test]
        4451  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
        4452  +
        {
 7033   4453   
            #[allow(unused_mut)]
 7034   4454   
            let mut http_request = http::Request::builder()
 7035         -
            .uri("/JsonTimestamps")
        4455  +
                .uri("/MalformedTimestampHeaderEpoch")
 7036   4456   
                .method("POST")
 7037         -
            .header("Content-Type", "application/json")
 7038         -
            .body(::aws_smithy_http_server::body::Body::from(
 7039         -
                ::bytes::Bytes::from_static(
 7040         -
                    "{\n    \"dateTime\": \"2014-04-29T18:30:38Z\"\n}".as_bytes(),
 7041         -
                ),
 7042         -
            ))
        4457  +
                .header("timestamp", "1515531081.123.456")
        4458  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7043   4459   
                .unwrap();
 7044   4460   
            #[allow(unused_mut)]
 7045   4461   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7046   4462   
            let config = crate::service::RestJsonConfig::builder().build();
 7047   4463   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7048         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
        4464  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 7049   4465   
                                let sender = sender.clone();
 7050   4466   
                                async move {
 7051         -
                    let result = {
 7052         -
                        let expected = crate::input::JsonTimestampsInput {
 7053         -
                            date_time: ::std::option::Option::Some(
 7054         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 7055         -
                                    1398796238, 0_f64,
 7056         -
                                ),
 7057         -
                            ),
 7058         -
                            normal: ::std::option::Option::None,
 7059         -
                            date_time_on_target: ::std::option::Option::None,
 7060         -
                            epoch_seconds: ::std::option::Option::None,
 7061         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7062         -
                            http_date: ::std::option::Option::None,
 7063         -
                            http_date_on_target: ::std::option::Option::None,
 7064         -
                        };
 7065         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7066         -
                        let response = crate::output::JsonTimestampsOutput {
 7067         -
                            normal: ::std::option::Option::None,
 7068         -
                            date_time: ::std::option::Option::None,
 7069         -
                            date_time_on_target: ::std::option::Option::None,
 7070         -
                            epoch_seconds: ::std::option::Option::None,
 7071         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7072         -
                            http_date: ::std::option::Option::None,
 7073         -
                            http_date_on_target: ::std::option::Option::None,
 7074         -
                        };
 7075         -
                        response
 7076         -
                    };
        4467  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 7077   4468   
                                    sender.send(()).await.expect("receiver dropped early");
 7078   4469   
                                    result
 7079   4470   
                                }
 7080   4471   
                            })
 7081   4472   
                            .build_unchecked();
 7082   4473   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7083   4474   
                .await
 7084   4475   
                .expect("unable to make an HTTP request");
 7085         -
        assert!(receiver.recv().await.is_some());
        4476  +
            ::pretty_assertions::assert_eq!(
        4477  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4478  +
                http_response.status()
        4479  +
            );
        4480  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4481  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4482  +
                http_response.headers(),
        4483  +
                expected_headers,
        4484  +
            ));
 7086   4485   
        }
 7087         -
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
 7088         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
        4486  +
    }
        4487  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4488  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case4
 7089   4489   
    #[::tokio::test]
 7090         -
    async fn rest_json_json_timestamps_with_date_time_on_target_format_request() {
        4490  +
    #[::tracing_test::traced_test]
        4491  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
        4492  +
        {
 7091   4493   
            #[allow(unused_mut)]
 7092   4494   
            let mut http_request = http::Request::builder()
 7093         -
            .uri("/JsonTimestamps")
        4495  +
                .uri("/MalformedTimestampHeaderEpoch")
 7094   4496   
                .method("POST")
 7095         -
            .header("Content-Type", "application/json")
 7096         -
            .body(::aws_smithy_http_server::body::Body::from(
 7097         -
                ::bytes::Bytes::from_static(
 7098         -
                    "{\n    \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\"\n}".as_bytes(),
 7099         -
                ),
 7100         -
            ))
        4497  +
                .header("timestamp", "Infinity")
        4498  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7101   4499   
                .unwrap();
 7102   4500   
            #[allow(unused_mut)]
 7103   4501   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7104   4502   
            let config = crate::service::RestJsonConfig::builder().build();
 7105   4503   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7106         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
        4504  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 7107   4505   
                                let sender = sender.clone();
 7108   4506   
                                async move {
 7109         -
                    let result = {
 7110         -
                        let expected = crate::input::JsonTimestampsInput {
 7111         -
                            date_time_on_target: ::std::option::Option::Some(
 7112         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 7113         -
                                    1398796238, 0_f64,
 7114         -
                                ),
 7115         -
                            ),
 7116         -
                            normal: ::std::option::Option::None,
 7117         -
                            date_time: ::std::option::Option::None,
 7118         -
                            epoch_seconds: ::std::option::Option::None,
 7119         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7120         -
                            http_date: ::std::option::Option::None,
 7121         -
                            http_date_on_target: ::std::option::Option::None,
 7122         -
                        };
 7123         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7124         -
                        let response = crate::output::JsonTimestampsOutput {
 7125         -
                            normal: ::std::option::Option::None,
 7126         -
                            date_time: ::std::option::Option::None,
 7127         -
                            date_time_on_target: ::std::option::Option::None,
 7128         -
                            epoch_seconds: ::std::option::Option::None,
 7129         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7130         -
                            http_date: ::std::option::Option::None,
 7131         -
                            http_date_on_target: ::std::option::Option::None,
 7132         -
                        };
 7133         -
                        response
 7134         -
                    };
        4507  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 7135   4508   
                                    sender.send(()).await.expect("receiver dropped early");
 7136   4509   
                                    result
 7137   4510   
                                }
 7138   4511   
                            })
 7139   4512   
                            .build_unchecked();
 7140   4513   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7141   4514   
                .await
 7142   4515   
                .expect("unable to make an HTTP request");
 7143         -
        assert!(receiver.recv().await.is_some());
        4516  +
            ::pretty_assertions::assert_eq!(
        4517  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4518  +
                http_response.status()
        4519  +
            );
        4520  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4521  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4522  +
                http_response.headers(),
        4523  +
                expected_headers,
        4524  +
            ));
 7144   4525   
        }
 7145         -
    /// Ensures that the timestampFormat of epoch-seconds works
 7146         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
        4526  +
    }
        4527  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4528  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case5
 7147   4529   
    #[::tokio::test]
 7148         -
    async fn rest_json_json_timestamps_with_epoch_seconds_format_request() {
        4530  +
    #[::tracing_test::traced_test]
        4531  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
        4532  +
        {
 7149   4533   
            #[allow(unused_mut)]
 7150   4534   
            let mut http_request = http::Request::builder()
 7151         -
            .uri("/JsonTimestamps")
        4535  +
                .uri("/MalformedTimestampHeaderEpoch")
 7152   4536   
                .method("POST")
 7153         -
            .header("Content-Type", "application/json")
 7154         -
            .body(::aws_smithy_http_server::body::Body::from(
 7155         -
                ::bytes::Bytes::from_static("{\n    \"epochSeconds\": 1398796238\n}".as_bytes()),
 7156         -
            ))
        4537  +
                .header("timestamp", "-Infinity")
        4538  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7157   4539   
                .unwrap();
 7158   4540   
            #[allow(unused_mut)]
 7159   4541   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7160   4542   
            let config = crate::service::RestJsonConfig::builder().build();
 7161   4543   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7162         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
        4544  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 7163   4545   
                                let sender = sender.clone();
 7164   4546   
                                async move {
 7165         -
                    let result = {
 7166         -
                        let expected = crate::input::JsonTimestampsInput {
 7167         -
                            epoch_seconds: ::std::option::Option::Some(
 7168         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 7169         -
                                    1398796238, 0_f64,
 7170         -
                                ),
 7171         -
                            ),
 7172         -
                            normal: ::std::option::Option::None,
 7173         -
                            date_time: ::std::option::Option::None,
 7174         -
                            date_time_on_target: ::std::option::Option::None,
 7175         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7176         -
                            http_date: ::std::option::Option::None,
 7177         -
                            http_date_on_target: ::std::option::Option::None,
 7178         -
                        };
 7179         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7180         -
                        let response = crate::output::JsonTimestampsOutput {
 7181         -
                            normal: ::std::option::Option::None,
 7182         -
                            date_time: ::std::option::Option::None,
 7183         -
                            date_time_on_target: ::std::option::Option::None,
 7184         -
                            epoch_seconds: ::std::option::Option::None,
 7185         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7186         -
                            http_date: ::std::option::Option::None,
 7187         -
                            http_date_on_target: ::std::option::Option::None,
 7188         -
                        };
 7189         -
                        response
 7190         -
                    };
        4547  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 7191   4548   
                                    sender.send(()).await.expect("receiver dropped early");
 7192   4549   
                                    result
 7193   4550   
                                }
 7194   4551   
                            })
 7195   4552   
                            .build_unchecked();
 7196   4553   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7197   4554   
                .await
 7198   4555   
                .expect("unable to make an HTTP request");
 7199         -
        assert!(receiver.recv().await.is_some());
        4556  +
            ::pretty_assertions::assert_eq!(
        4557  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4558  +
                http_response.status()
        4559  +
            );
        4560  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4561  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4562  +
                http_response.headers(),
        4563  +
                expected_headers,
        4564  +
            ));
 7200   4565   
        }
 7201         -
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
 7202         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
        4566  +
    }
        4567  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        4568  +
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case6
 7203   4569   
    #[::tokio::test]
 7204         -
    async fn rest_json_json_timestamps_with_epoch_seconds_on_target_format_request() {
        4570  +
    #[::tracing_test::traced_test]
        4571  +
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
        4572  +
        {
 7205   4573   
            #[allow(unused_mut)]
 7206   4574   
            let mut http_request = http::Request::builder()
 7207         -
            .uri("/JsonTimestamps")
        4575  +
                .uri("/MalformedTimestampHeaderEpoch")
 7208   4576   
                .method("POST")
 7209         -
            .header("Content-Type", "application/json")
 7210         -
            .body(::aws_smithy_http_server::body::Body::from(
 7211         -
                ::bytes::Bytes::from_static(
 7212         -
                    "{\n    \"epochSecondsOnTarget\": 1398796238\n}".as_bytes(),
 7213         -
                ),
 7214         -
            ))
        4577  +
                .header("timestamp", "NaN")
        4578  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7215   4579   
                .unwrap();
 7216   4580   
            #[allow(unused_mut)]
 7217   4581   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7218   4582   
            let config = crate::service::RestJsonConfig::builder().build();
 7219   4583   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7220         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
        4584  +
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
 7221   4585   
                                let sender = sender.clone();
 7222   4586   
                                async move {
 7223         -
                    let result = {
 7224         -
                        let expected = crate::input::JsonTimestampsInput {
 7225         -
                            epoch_seconds_on_target: ::std::option::Option::Some(
 7226         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 7227         -
                                    1398796238, 0_f64,
 7228         -
                                ),
 7229         -
                            ),
 7230         -
                            normal: ::std::option::Option::None,
 7231         -
                            date_time: ::std::option::Option::None,
 7232         -
                            date_time_on_target: ::std::option::Option::None,
 7233         -
                            epoch_seconds: ::std::option::Option::None,
 7234         -
                            http_date: ::std::option::Option::None,
 7235         -
                            http_date_on_target: ::std::option::Option::None,
 7236         -
                        };
 7237         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7238         -
                        let response = crate::output::JsonTimestampsOutput {
 7239         -
                            normal: ::std::option::Option::None,
 7240         -
                            date_time: ::std::option::Option::None,
 7241         -
                            date_time_on_target: ::std::option::Option::None,
 7242         -
                            epoch_seconds: ::std::option::Option::None,
 7243         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7244         -
                            http_date: ::std::option::Option::None,
 7245         -
                            http_date_on_target: ::std::option::Option::None,
 7246         -
                        };
 7247         -
                        response
 7248         -
                    };
        4587  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
 7249   4588   
                                    sender.send(()).await.expect("receiver dropped early");
 7250   4589   
                                    result
 7251   4590   
                                }
 7252   4591   
                            })
 7253   4592   
                            .build_unchecked();
 7254   4593   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7255   4594   
                .await
 7256   4595   
                .expect("unable to make an HTTP request");
 7257         -
        assert!(receiver.recv().await.is_some());
        4596  +
            ::pretty_assertions::assert_eq!(
        4597  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4598  +
                http_response.status()
        4599  +
            );
        4600  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4601  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4602  +
                http_response.headers(),
        4603  +
                expected_headers,
        4604  +
            ));
 7258   4605   
        }
 7259         -
    /// Ensures that the timestampFormat of http-date works
 7260         -
    /// Test ID: RestJsonJsonTimestampsWithHttpDateFormat
 7261         -
    #[::tokio::test]
 7262         -
    async fn rest_json_json_timestamps_with_http_date_format_request() {
 7263         -
        #[allow(unused_mut)]
 7264         -
        let mut http_request = http::Request::builder()
 7265         -
            .uri("/JsonTimestamps")
 7266         -
            .method("POST")
 7267         -
            .header("Content-Type", "application/json")
 7268         -
            .body(::aws_smithy_http_server::body::Body::from(
 7269         -
                ::bytes::Bytes::from_static(
 7270         -
                    "{\n    \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}".as_bytes(),
 7271         -
                ),
 7272         -
            ))
 7273         -
            .unwrap();
 7274         -
        #[allow(unused_mut)]
 7275         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7276         -
        let config = crate::service::RestJsonConfig::builder().build();
 7277         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7278         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
 7279         -
                let sender = sender.clone();
 7280         -
                async move {
 7281         -
                    let result = {
 7282         -
                        let expected = crate::input::JsonTimestampsInput {
 7283         -
                            http_date: ::std::option::Option::Some(
 7284         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 7285         -
                                    1398796238, 0_f64,
 7286         -
                                ),
 7287         -
                            ),
 7288         -
                            normal: ::std::option::Option::None,
 7289         -
                            date_time: ::std::option::Option::None,
 7290         -
                            date_time_on_target: ::std::option::Option::None,
 7291         -
                            epoch_seconds: ::std::option::Option::None,
 7292         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7293         -
                            http_date_on_target: ::std::option::Option::None,
 7294         -
                        };
 7295         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7296         -
                        let response = crate::output::JsonTimestampsOutput {
 7297         -
                            normal: ::std::option::Option::None,
 7298         -
                            date_time: ::std::option::Option::None,
 7299         -
                            date_time_on_target: ::std::option::Option::None,
 7300         -
                            epoch_seconds: ::std::option::Option::None,
 7301         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7302         -
                            http_date: ::std::option::Option::None,
 7303         -
                            http_date_on_target: ::std::option::Option::None,
        4606  +
    }
        4607  +
}
        4608  +
        4609  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDATETIME: ::mime::Mime = ::mime::APPLICATION_JSON;
        4610  +
::pin_project_lite::pin_project! {
        4611  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        4612  +
    /// [`MalformedTimestampHeaderDateTimeInput`](crate::input::MalformedTimestampHeaderDateTimeInput) using modelled bindings.
        4613  +
    pub struct MalformedTimestampHeaderDateTimeInputFuture {
        4614  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampHeaderDateTimeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        4615  +
    }
        4616  +
}
        4617  +
        4618  +
impl std::future::Future for MalformedTimestampHeaderDateTimeInputFuture {
        4619  +
    type Output = Result<
        4620  +
        crate::input::MalformedTimestampHeaderDateTimeInput,
        4621  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        4622  +
    >;
        4623  +
        4624  +
    fn poll(
        4625  +
        self: std::pin::Pin<&mut Self>,
        4626  +
        cx: &mut std::task::Context<'_>,
        4627  +
    ) -> std::task::Poll<Self::Output> {
        4628  +
        let this = self.project();
        4629  +
        this.inner.as_mut().poll(cx)
        4630  +
    }
        4631  +
}
        4632  +
        4633  +
impl<B>
        4634  +
    ::aws_smithy_http_server::request::FromRequest<
        4635  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        4636  +
        B,
        4637  +
    > for crate::input::MalformedTimestampHeaderDateTimeInput
        4638  +
where
        4639  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        4640  +
    B: 'static,
        4641  +
        4642  +
    B::Data: Send,
        4643  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        4644  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        4645  +
{
        4646  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        4647  +
    type Future = MalformedTimestampHeaderDateTimeInputFuture;
        4648  +
        4649  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        4650  +
        let fut = async move {
        4651  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        4652  +
                request.headers(),
        4653  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDATETIME,
        4654  +
            ) {
        4655  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        4656  +
            }
        4657  +
            crate::protocol_serde::shape_malformed_timestamp_header_date_time::de_malformed_timestamp_header_date_time_http_request(request)
        4658  +
                            .await
        4659  +
                            .map_err(Into::into)
 7304   4660   
        };
        4661  +
        use ::futures_util::future::TryFutureExt;
        4662  +
        let fut = fut.map_err(
        4663  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        4664  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        4665  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        4666  +
                    e,
        4667  +
                )
        4668  +
            },
        4669  +
        );
        4670  +
        MalformedTimestampHeaderDateTimeInputFuture {
        4671  +
            inner: Box::pin(fut),
        4672  +
        }
        4673  +
    }
        4674  +
}
        4675  +
impl
        4676  +
    ::aws_smithy_http_server::response::IntoResponse<
        4677  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        4678  +
    > for crate::output::MalformedTimestampHeaderDateTimeOutput
        4679  +
{
        4680  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        4681  +
        match crate::protocol_serde::shape_malformed_timestamp_header_date_time::ser_malformed_timestamp_header_date_time_http_response(self) {
        4682  +
                        Ok(response) => response,
        4683  +
                        Err(e) => {
        4684  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        4685  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        4686  +
                        }
        4687  +
                    }
        4688  +
    }
        4689  +
}
        4690  +
impl
        4691  +
    ::aws_smithy_http_server::response::IntoResponse<
        4692  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        4693  +
    > for crate::error::MalformedTimestampHeaderDateTimeError
        4694  +
{
        4695  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        4696  +
        match crate::protocol_serde::shape_malformed_timestamp_header_date_time::ser_malformed_timestamp_header_date_time_http_error(&self) {
        4697  +
            Ok(mut response) => {
        4698  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 7305   4699   
                response
 7306         -
                    };
 7307         -
                    sender.send(()).await.expect("receiver dropped early");
 7308         -
                    result
        4700  +
            },
        4701  +
            Err(e) => {
        4702  +
                ::tracing::error!(error = %e, "failed to serialize response");
        4703  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 7309   4704   
            }
 7310         -
            })
 7311         -
            .build_unchecked();
 7312         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7313         -
            .await
 7314         -
            .expect("unable to make an HTTP request");
 7315         -
        assert!(receiver.recv().await.is_some());
 7316   4705   
        }
 7317         -
    /// Ensures that the timestampFormat of http-date on the target shape works
 7318         -
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
        4706  +
    }
        4707  +
}
        4708  +
        4709  +
#[allow(unreachable_code, unused_variables)]
        4710  +
#[cfg(test)]
        4711  +
mod malformed_timestamp_header_date_time_test {
        4712  +
        4713  +
    /// When the format is date-time, IMF-fixdate timestamps are rejected with a
        4714  +
    /// 400 SerializationException
        4715  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsHttpDate_case0
 7319   4716   
    #[::tokio::test]
 7320         -
    async fn rest_json_json_timestamps_with_http_date_on_target_format_request() {
        4717  +
    #[::tracing_test::traced_test]
        4718  +
    async fn rest_json_header_timestamp_date_time_rejects_http_date_case0_malformed_request() {
        4719  +
        {
 7321   4720   
            #[allow(unused_mut)]
 7322   4721   
            let mut http_request = http::Request::builder()
 7323         -
            .uri("/JsonTimestamps")
        4722  +
                .uri("/MalformedTimestampHeaderDateTime")
 7324   4723   
                .method("POST")
 7325         -
            .header("Content-Type", "application/json")
 7326         -
            .body(::aws_smithy_http_server::body::Body::from(
 7327         -
                ::bytes::Bytes::from_static(
 7328         -
                    "{\n    \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}".as_bytes(),
 7329         -
                ),
 7330         -
            ))
        4724  +
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
        4725  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7331   4726   
                .unwrap();
 7332   4727   
            #[allow(unused_mut)]
 7333   4728   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7334   4729   
            let config = crate::service::RestJsonConfig::builder().build();
 7335   4730   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7336         -
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
        4731  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7337   4732   
                                let sender = sender.clone();
 7338   4733   
                                async move {
 7339         -
                    let result = {
 7340         -
                        let expected = crate::input::JsonTimestampsInput {
 7341         -
                            http_date_on_target: ::std::option::Option::Some(
 7342         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
 7343         -
                                    1398796238, 0_f64,
 7344         -
                                ),
 7345         -
                            ),
 7346         -
                            normal: ::std::option::Option::None,
 7347         -
                            date_time: ::std::option::Option::None,
 7348         -
                            date_time_on_target: ::std::option::Option::None,
 7349         -
                            epoch_seconds: ::std::option::Option::None,
 7350         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7351         -
                            http_date: ::std::option::Option::None,
 7352         -
                        };
 7353         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7354         -
                        let response = crate::output::JsonTimestampsOutput {
 7355         -
                            normal: ::std::option::Option::None,
 7356         -
                            date_time: ::std::option::Option::None,
 7357         -
                            date_time_on_target: ::std::option::Option::None,
 7358         -
                            epoch_seconds: ::std::option::Option::None,
 7359         -
                            epoch_seconds_on_target: ::std::option::Option::None,
 7360         -
                            http_date: ::std::option::Option::None,
 7361         -
                            http_date_on_target: ::std::option::Option::None,
 7362         -
                        };
 7363         -
                        response
 7364         -
                    };
        4734  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7365   4735   
                                    sender.send(()).await.expect("receiver dropped early");
 7366   4736   
                                    result
 7367   4737   
                                }
 7368   4738   
                            })
 7369   4739   
                            .build_unchecked();
 7370   4740   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7371   4741   
                .await
 7372   4742   
                .expect("unable to make an HTTP request");
 7373         -
        assert!(receiver.recv().await.is_some());
 7374         -
    }
 7375         -
    /// Tests how normal timestamps are serialized
 7376         -
    /// Test ID: RestJsonJsonTimestamps
 7377         -
    #[::tokio::test]
 7378         -
    async fn rest_json_json_timestamps_response() {
 7379         -
        let output = crate::output::JsonTimestampsOutput {
 7380         -
            normal: ::std::option::Option::Some(
 7381         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 7382         -
            ),
 7383         -
            date_time: ::std::option::Option::None,
 7384         -
            date_time_on_target: ::std::option::Option::None,
 7385         -
            epoch_seconds: ::std::option::Option::None,
 7386         -
            epoch_seconds_on_target: ::std::option::Option::None,
 7387         -
            http_date: ::std::option::Option::None,
 7388         -
            http_date_on_target: ::std::option::Option::None,
 7389         -
        };
 7390         -
        use ::aws_smithy_http_server::response::IntoResponse;
 7391         -
        let http_response = output.into_response();
 7392   4743   
            ::pretty_assertions::assert_eq!(
 7393         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4744  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 7394   4745   
                http_response.status()
 7395   4746   
            );
 7396         -
        let expected_headers = [("Content-Type", "application/json")];
        4747  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 7397   4748   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7398   4749   
                http_response.headers(),
 7399   4750   
                expected_headers,
 7400   4751   
            ));
 7401         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 7402         -
            .await
 7403         -
            .expect("unable to extract body to bytes");
 7404         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 7405         -
            &body,
 7406         -
            "{\n    \"normal\": 1398796238\n}",
 7407         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 7408         -
        ));
 7409   4752   
        }
 7410         -
    /// Ensures that the timestampFormat of date-time works like normal timestamps
 7411         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
        4753  +
    }
        4754  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        4755  +
    /// 400 SerializationException
        4756  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case0
 7412   4757   
    #[::tokio::test]
 7413         -
    async fn rest_json_json_timestamps_with_date_time_format_response() {
 7414         -
        let output = crate::output::JsonTimestampsOutput {
 7415         -
            date_time: ::std::option::Option::Some(
 7416         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 7417         -
            ),
 7418         -
            normal: ::std::option::Option::None,
 7419         -
            date_time_on_target: ::std::option::Option::None,
 7420         -
            epoch_seconds: ::std::option::Option::None,
 7421         -
            epoch_seconds_on_target: ::std::option::Option::None,
 7422         -
            http_date: ::std::option::Option::None,
 7423         -
            http_date_on_target: ::std::option::Option::None,
 7424         -
        };
 7425         -
        use ::aws_smithy_http_server::response::IntoResponse;
 7426         -
        let http_response = output.into_response();
        4758  +
    #[::tracing_test::traced_test]
        4759  +
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
        4760  +
        {
        4761  +
            #[allow(unused_mut)]
        4762  +
            let mut http_request = http::Request::builder()
        4763  +
                .uri("/MalformedTimestampHeaderDateTime")
        4764  +
                .method("POST")
        4765  +
                .header("timestamp", "1515531081.1234")
        4766  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4767  +
                .unwrap();
        4768  +
            #[allow(unused_mut)]
        4769  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        4770  +
            let config = crate::service::RestJsonConfig::builder().build();
        4771  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        4772  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
        4773  +
                                let sender = sender.clone();
        4774  +
                                async move {
        4775  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
        4776  +
                                    sender.send(()).await.expect("receiver dropped early");
        4777  +
                                    result
        4778  +
                                }
        4779  +
                            })
        4780  +
                            .build_unchecked();
        4781  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        4782  +
                .await
        4783  +
                .expect("unable to make an HTTP request");
 7427   4784   
            ::pretty_assertions::assert_eq!(
 7428         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4785  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 7429   4786   
                http_response.status()
 7430   4787   
            );
 7431         -
        let expected_headers = [("Content-Type", "application/json")];
        4788  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 7432   4789   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7433   4790   
                http_response.headers(),
 7434   4791   
                expected_headers,
 7435   4792   
            ));
 7436         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 7437         -
            .await
 7438         -
            .expect("unable to extract body to bytes");
 7439         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 7440         -
            &body,
 7441         -
            "{\n    \"dateTime\": \"2014-04-29T18:30:38Z\"\n}",
 7442         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 7443         -
        ));
 7444   4793   
        }
 7445         -
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
 7446         -
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
        4794  +
    }
        4795  +
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
        4796  +
    /// 400 SerializationException
        4797  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case1
 7447   4798   
    #[::tokio::test]
 7448         -
    async fn rest_json_json_timestamps_with_date_time_on_target_format_response() {
 7449         -
        let output = crate::output::JsonTimestampsOutput {
 7450         -
            date_time_on_target: ::std::option::Option::Some(
 7451         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 7452         -
            ),
 7453         -
            normal: ::std::option::Option::None,
 7454         -
            date_time: ::std::option::Option::None,
 7455         -
            epoch_seconds: ::std::option::Option::None,
 7456         -
            epoch_seconds_on_target: ::std::option::Option::None,
 7457         -
            http_date: ::std::option::Option::None,
 7458         -
            http_date_on_target: ::std::option::Option::None,
 7459         -
        };
 7460         -
        use ::aws_smithy_http_server::response::IntoResponse;
 7461         -
        let http_response = output.into_response();
        4799  +
    #[::tracing_test::traced_test]
        4800  +
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
        4801  +
        {
        4802  +
            #[allow(unused_mut)]
        4803  +
            let mut http_request = http::Request::builder()
        4804  +
                .uri("/MalformedTimestampHeaderDateTime")
        4805  +
                .method("POST")
        4806  +
                .header("timestamp", "1515531081")
        4807  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4808  +
                .unwrap();
        4809  +
            #[allow(unused_mut)]
        4810  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        4811  +
            let config = crate::service::RestJsonConfig::builder().build();
        4812  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        4813  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
        4814  +
                                let sender = sender.clone();
        4815  +
                                async move {
        4816  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
        4817  +
                                    sender.send(()).await.expect("receiver dropped early");
        4818  +
                                    result
        4819  +
                                }
        4820  +
                            })
        4821  +
                            .build_unchecked();
        4822  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        4823  +
                .await
        4824  +
                .expect("unable to make an HTTP request");
 7462   4825   
            ::pretty_assertions::assert_eq!(
 7463         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4826  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 7464   4827   
                http_response.status()
 7465   4828   
            );
 7466         -
        let expected_headers = [("Content-Type", "application/json")];
        4829  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 7467   4830   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7468   4831   
                http_response.headers(),
 7469   4832   
                expected_headers,
 7470   4833   
            ));
 7471         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 7472         -
            .await
 7473         -
            .expect("unable to extract body to bytes");
 7474         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 7475         -
            &body,
 7476         -
            "{\n    \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\"\n}",
 7477         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 7478         -
        ));
 7479   4834   
        }
 7480         -
    /// Ensures that the timestampFormat of epoch-seconds works
 7481         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
        4835  +
    }
        4836  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        4837  +
    /// are rejected with a 400 SerializationException
        4838  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case0
 7482   4839   
    #[::tokio::test]
 7483         -
    async fn rest_json_json_timestamps_with_epoch_seconds_format_response() {
 7484         -
        let output = crate::output::JsonTimestampsOutput {
 7485         -
            epoch_seconds: ::std::option::Option::Some(
 7486         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 7487         -
            ),
 7488         -
            normal: ::std::option::Option::None,
 7489         -
            date_time: ::std::option::Option::None,
 7490         -
            date_time_on_target: ::std::option::Option::None,
 7491         -
            epoch_seconds_on_target: ::std::option::Option::None,
 7492         -
            http_date: ::std::option::Option::None,
 7493         -
            http_date_on_target: ::std::option::Option::None,
 7494         -
        };
 7495         -
        use ::aws_smithy_http_server::response::IntoResponse;
 7496         -
        let http_response = output.into_response();
        4840  +
    #[::tracing_test::traced_test]
        4841  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
        4842  +
    ) {
        4843  +
        {
        4844  +
            #[allow(unused_mut)]
        4845  +
            let mut http_request = http::Request::builder()
        4846  +
                .uri("/MalformedTimestampHeaderDateTime")
        4847  +
                .method("POST")
        4848  +
                .header("timestamp", "1996-12-19T16:39:57+00")
        4849  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4850  +
                .unwrap();
        4851  +
            #[allow(unused_mut)]
        4852  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        4853  +
            let config = crate::service::RestJsonConfig::builder().build();
        4854  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        4855  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
        4856  +
                                let sender = sender.clone();
        4857  +
                                async move {
        4858  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
        4859  +
                                    sender.send(()).await.expect("receiver dropped early");
        4860  +
                                    result
        4861  +
                                }
        4862  +
                            })
        4863  +
                            .build_unchecked();
        4864  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        4865  +
                .await
        4866  +
                .expect("unable to make an HTTP request");
 7497   4867   
            ::pretty_assertions::assert_eq!(
 7498         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4868  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 7499   4869   
                http_response.status()
 7500   4870   
            );
 7501         -
        let expected_headers = [("Content-Type", "application/json")];
        4871  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 7502   4872   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7503   4873   
                http_response.headers(),
 7504   4874   
                expected_headers,
 7505   4875   
            ));
 7506         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 7507         -
            .await
 7508         -
            .expect("unable to extract body to bytes");
 7509         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 7510         -
            &body,
 7511         -
            "{\n    \"epochSeconds\": 1398796238\n}",
 7512         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 7513         -
        ));
 7514   4876   
        }
 7515         -
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
 7516         -
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
        4877  +
    }
        4878  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        4879  +
    /// are rejected with a 400 SerializationException
        4880  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case1
 7517   4881   
    #[::tokio::test]
 7518         -
    async fn rest_json_json_timestamps_with_epoch_seconds_on_target_format_response() {
 7519         -
        let output = crate::output::JsonTimestampsOutput {
 7520         -
            epoch_seconds_on_target: ::std::option::Option::Some(
 7521         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 7522         -
            ),
 7523         -
            normal: ::std::option::Option::None,
 7524         -
            date_time: ::std::option::Option::None,
 7525         -
            date_time_on_target: ::std::option::Option::None,
 7526         -
            epoch_seconds: ::std::option::Option::None,
 7527         -
            http_date: ::std::option::Option::None,
 7528         -
            http_date_on_target: ::std::option::Option::None,
 7529         -
        };
 7530         -
        use ::aws_smithy_http_server::response::IntoResponse;
 7531         -
        let http_response = output.into_response();
        4882  +
    #[::tracing_test::traced_test]
        4883  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
        4884  +
    ) {
        4885  +
        {
        4886  +
            #[allow(unused_mut)]
        4887  +
            let mut http_request = http::Request::builder()
        4888  +
                .uri("/MalformedTimestampHeaderDateTime")
        4889  +
                .method("POST")
        4890  +
                .header("timestamp", "1996-12-19T16:39:57+00Z")
        4891  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4892  +
                .unwrap();
        4893  +
            #[allow(unused_mut)]
        4894  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        4895  +
            let config = crate::service::RestJsonConfig::builder().build();
        4896  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        4897  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
        4898  +
                                let sender = sender.clone();
        4899  +
                                async move {
        4900  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
        4901  +
                                    sender.send(()).await.expect("receiver dropped early");
        4902  +
                                    result
        4903  +
                                }
        4904  +
                            })
        4905  +
                            .build_unchecked();
        4906  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        4907  +
                .await
        4908  +
                .expect("unable to make an HTTP request");
 7532   4909   
            ::pretty_assertions::assert_eq!(
 7533         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4910  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 7534   4911   
                http_response.status()
 7535   4912   
            );
 7536         -
        let expected_headers = [("Content-Type", "application/json")];
        4913  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 7537   4914   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7538   4915   
                http_response.headers(),
 7539   4916   
                expected_headers,
 7540   4917   
            ));
 7541         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 7542         -
            .await
 7543         -
            .expect("unable to extract body to bytes");
 7544         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 7545         -
            &body,
 7546         -
            "{\n    \"epochSecondsOnTarget\": 1398796238\n}",
 7547         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 7548         -
        ));
 7549   4918   
        }
 7550         -
    /// Ensures that the timestampFormat of http-date works
 7551         -
    /// Test ID: RestJsonJsonTimestampsWithHttpDateFormat
        4919  +
    }
        4920  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        4921  +
    /// are rejected with a 400 SerializationException
        4922  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case2
 7552   4923   
    #[::tokio::test]
 7553         -
    async fn rest_json_json_timestamps_with_http_date_format_response() {
 7554         -
        let output = crate::output::JsonTimestampsOutput {
 7555         -
            http_date: ::std::option::Option::Some(
 7556         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 7557         -
            ),
 7558         -
            normal: ::std::option::Option::None,
 7559         -
            date_time: ::std::option::Option::None,
 7560         -
            date_time_on_target: ::std::option::Option::None,
 7561         -
            epoch_seconds: ::std::option::Option::None,
 7562         -
            epoch_seconds_on_target: ::std::option::Option::None,
 7563         -
            http_date_on_target: ::std::option::Option::None,
 7564         -
        };
 7565         -
        use ::aws_smithy_http_server::response::IntoResponse;
 7566         -
        let http_response = output.into_response();
        4924  +
    #[::tracing_test::traced_test]
        4925  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
        4926  +
    ) {
        4927  +
        {
        4928  +
            #[allow(unused_mut)]
        4929  +
            let mut http_request = http::Request::builder()
        4930  +
                .uri("/MalformedTimestampHeaderDateTime")
        4931  +
                .method("POST")
        4932  +
                .header("timestamp", "1996-12-19T16:39:57")
        4933  +
                .body(::aws_smithy_http_server::body::Body::empty())
        4934  +
                .unwrap();
        4935  +
            #[allow(unused_mut)]
        4936  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        4937  +
            let config = crate::service::RestJsonConfig::builder().build();
        4938  +
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
        4939  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
        4940  +
                                let sender = sender.clone();
        4941  +
                                async move {
        4942  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
        4943  +
                                    sender.send(()).await.expect("receiver dropped early");
        4944  +
                                    result
        4945  +
                                }
        4946  +
                            })
        4947  +
                            .build_unchecked();
        4948  +
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        4949  +
                .await
        4950  +
                .expect("unable to make an HTTP request");
 7567   4951   
            ::pretty_assertions::assert_eq!(
 7568         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        4952  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 7569   4953   
                http_response.status()
 7570   4954   
            );
 7571         -
        let expected_headers = [("Content-Type", "application/json")];
        4955  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 7572   4956   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7573   4957   
                http_response.headers(),
 7574   4958   
                expected_headers,
 7575   4959   
            ));
 7576         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 7577         -
            .await
 7578         -
            .expect("unable to extract body to bytes");
 7579         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 7580         -
            &body,
 7581         -
            "{\n    \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}",
 7582         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 7583         -
        ));
 7584   4960   
        }
 7585         -
    /// Ensures that the timestampFormat of http-date on the target shape works
 7586         -
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
        4961  +
    }
        4962  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        4963  +
    /// are rejected with a 400 SerializationException
        4964  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case3
 7587   4965   
    #[::tokio::test]
 7588         -
    async fn rest_json_json_timestamps_with_http_date_on_target_format_response() {
 7589         -
        let output = crate::output::JsonTimestampsOutput {
 7590         -
            http_date_on_target: ::std::option::Option::Some(
 7591         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 7592         -
            ),
 7593         -
            normal: ::std::option::Option::None,
 7594         -
            date_time: ::std::option::Option::None,
 7595         -
            date_time_on_target: ::std::option::Option::None,
 7596         -
            epoch_seconds: ::std::option::Option::None,
 7597         -
            epoch_seconds_on_target: ::std::option::Option::None,
 7598         -
            http_date: ::std::option::Option::None,
 7599         -
        };
 7600         -
        use ::aws_smithy_http_server::response::IntoResponse;
 7601         -
        let http_response = output.into_response();
 7602         -
        ::pretty_assertions::assert_eq!(
 7603         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 7604         -
            http_response.status()
 7605         -
        );
 7606         -
        let expected_headers = [("Content-Type", "application/json")];
 7607         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 7608         -
            http_response.headers(),
 7609         -
            expected_headers,
 7610         -
        ));
 7611         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 7612         -
            .await
 7613         -
            .expect("unable to extract body to bytes");
 7614         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 7615         -
            &body,
 7616         -
            "{\n    \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}",
 7617         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 7618         -
        ));
 7619         -
    }
 7620         -
}
 7621         -
#[cfg(test)]
 7622         -
#[allow(unreachable_code, unused_variables)]
 7623         -
mod server_json_unions_test {
 7624         -
    /// Serializes a string union value
 7625         -
    /// Test ID: RestJsonSerializeStringUnionValue
 7626         -
    #[::tokio::test]
 7627         -
    async fn rest_json_serialize_string_union_value_request() {
        4966  +
    #[::tracing_test::traced_test]
        4967  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
        4968  +
    ) {
        4969  +
        {
 7628   4970   
            #[allow(unused_mut)]
 7629   4971   
            let mut http_request = http::Request::builder()
 7630         -
            .uri("/JsonUnions")
 7631         -
            .method("PUT")
 7632         -
            .header("Content-Type", "application/json")
 7633         -
            .body(::aws_smithy_http_server::body::Body::from(
 7634         -
                ::bytes::Bytes::from_static(
 7635         -
                    "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}".as_bytes(),
 7636         -
                ),
 7637         -
            ))
        4972  +
                .uri("/MalformedTimestampHeaderDateTime")
        4973  +
                .method("POST")
        4974  +
                .header("timestamp", "1996-12-19T163957")
        4975  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7638   4976   
                .unwrap();
 7639   4977   
            #[allow(unused_mut)]
 7640   4978   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7641   4979   
            let config = crate::service::RestJsonConfig::builder().build();
 7642   4980   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7643         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        4981  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7644   4982   
                                let sender = sender.clone();
 7645   4983   
                                async move {
 7646         -
                    let result = {
 7647         -
                        let expected = crate::input::JsonUnionsInput {
 7648         -
                            contents: ::std::option::Option::Some(
 7649         -
                                crate::model::MyUnion::StringValue("foo".to_owned()),
 7650         -
                            ),
 7651         -
                        };
 7652         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7653         -
                        let response = crate::output::JsonUnionsOutput {
 7654         -
                            contents: ::std::option::Option::None,
 7655         -
                        };
 7656         -
                        Ok(response)
 7657         -
                    };
        4984  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7658   4985   
                                    sender.send(()).await.expect("receiver dropped early");
 7659   4986   
                                    result
 7660   4987   
                                }
 7661   4988   
                            })
 7662   4989   
                            .build_unchecked();
 7663   4990   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7664   4991   
                .await
 7665   4992   
                .expect("unable to make an HTTP request");
 7666         -
        assert!(receiver.recv().await.is_some());
        4993  +
            ::pretty_assertions::assert_eq!(
        4994  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        4995  +
                http_response.status()
        4996  +
            );
        4997  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        4998  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        4999  +
                http_response.headers(),
        5000  +
                expected_headers,
        5001  +
            ));
 7667   5002   
        }
 7668         -
    /// Serializes a boolean union value
 7669         -
    /// Test ID: RestJsonSerializeBooleanUnionValue
        5003  +
    }
        5004  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5005  +
    /// are rejected with a 400 SerializationException
        5006  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case4
 7670   5007   
    #[::tokio::test]
 7671         -
    async fn rest_json_serialize_boolean_union_value_request() {
        5008  +
    #[::tracing_test::traced_test]
        5009  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
        5010  +
    ) {
        5011  +
        {
 7672   5012   
            #[allow(unused_mut)]
 7673   5013   
            let mut http_request = http::Request::builder()
 7674         -
            .uri("/JsonUnions")
 7675         -
            .method("PUT")
 7676         -
            .header("Content-Type", "application/json")
 7677         -
            .body(::aws_smithy_http_server::body::Body::from(
 7678         -
                ::bytes::Bytes::from_static(
 7679         -
                    "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}".as_bytes(),
 7680         -
                ),
 7681         -
            ))
        5014  +
                .uri("/MalformedTimestampHeaderDateTime")
        5015  +
                .method("POST")
        5016  +
                .header("timestamp", "19961219T163957Z")
        5017  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7682   5018   
                .unwrap();
 7683   5019   
            #[allow(unused_mut)]
 7684   5020   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7685   5021   
            let config = crate::service::RestJsonConfig::builder().build();
 7686   5022   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7687         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5023  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7688   5024   
                                let sender = sender.clone();
 7689   5025   
                                async move {
 7690         -
                    let result = {
 7691         -
                        let expected = crate::input::JsonUnionsInput {
 7692         -
                            contents: ::std::option::Option::Some(
 7693         -
                                crate::model::MyUnion::BooleanValue(true),
 7694         -
                            ),
 7695         -
                        };
 7696         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7697         -
                        let response = crate::output::JsonUnionsOutput {
 7698         -
                            contents: ::std::option::Option::None,
 7699         -
                        };
 7700         -
                        Ok(response)
 7701         -
                    };
        5026  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7702   5027   
                                    sender.send(()).await.expect("receiver dropped early");
 7703   5028   
                                    result
 7704   5029   
                                }
 7705   5030   
                            })
 7706   5031   
                            .build_unchecked();
 7707   5032   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7708   5033   
                .await
 7709   5034   
                .expect("unable to make an HTTP request");
 7710         -
        assert!(receiver.recv().await.is_some());
        5035  +
            ::pretty_assertions::assert_eq!(
        5036  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5037  +
                http_response.status()
        5038  +
            );
        5039  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5040  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5041  +
                http_response.headers(),
        5042  +
                expected_headers,
        5043  +
            ));
 7711   5044   
        }
 7712         -
    /// Serializes a number union value
 7713         -
    /// Test ID: RestJsonSerializeNumberUnionValue
        5045  +
    }
        5046  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5047  +
    /// are rejected with a 400 SerializationException
        5048  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case5
 7714   5049   
    #[::tokio::test]
 7715         -
    async fn rest_json_serialize_number_union_value_request() {
        5050  +
    #[::tracing_test::traced_test]
        5051  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
        5052  +
    ) {
        5053  +
        {
 7716   5054   
            #[allow(unused_mut)]
 7717   5055   
            let mut http_request = http::Request::builder()
 7718         -
            .uri("/JsonUnions")
 7719         -
            .method("PUT")
 7720         -
            .header("Content-Type", "application/json")
 7721         -
            .body(::aws_smithy_http_server::body::Body::from(
 7722         -
                ::bytes::Bytes::from_static(
 7723         -
                    "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}".as_bytes(),
 7724         -
                ),
 7725         -
            ))
        5056  +
                .uri("/MalformedTimestampHeaderDateTime")
        5057  +
                .method("POST")
        5058  +
                .header("timestamp", "19961219T163957")
        5059  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7726   5060   
                .unwrap();
 7727   5061   
            #[allow(unused_mut)]
 7728   5062   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7729   5063   
            let config = crate::service::RestJsonConfig::builder().build();
 7730   5064   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7731         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5065  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7732   5066   
                                let sender = sender.clone();
 7733   5067   
                                async move {
 7734         -
                    let result = {
 7735         -
                        let expected = crate::input::JsonUnionsInput {
 7736         -
                            contents: ::std::option::Option::Some(
 7737         -
                                crate::model::MyUnion::NumberValue(1),
 7738         -
                            ),
 7739         -
                        };
 7740         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7741         -
                        let response = crate::output::JsonUnionsOutput {
 7742         -
                            contents: ::std::option::Option::None,
 7743         -
                        };
 7744         -
                        Ok(response)
 7745         -
                    };
        5068  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7746   5069   
                                    sender.send(()).await.expect("receiver dropped early");
 7747   5070   
                                    result
 7748   5071   
                                }
 7749   5072   
                            })
 7750   5073   
                            .build_unchecked();
 7751   5074   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7752   5075   
                .await
 7753   5076   
                .expect("unable to make an HTTP request");
 7754         -
        assert!(receiver.recv().await.is_some());
        5077  +
            ::pretty_assertions::assert_eq!(
        5078  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5079  +
                http_response.status()
        5080  +
            );
        5081  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5082  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5083  +
                http_response.headers(),
        5084  +
                expected_headers,
        5085  +
            ));
 7755   5086   
        }
 7756         -
    /// Serializes a blob union value
 7757         -
    /// Test ID: RestJsonSerializeBlobUnionValue
        5087  +
    }
        5088  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5089  +
    /// are rejected with a 400 SerializationException
        5090  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case6
 7758   5091   
    #[::tokio::test]
 7759         -
    async fn rest_json_serialize_blob_union_value_request() {
        5092  +
    #[::tracing_test::traced_test]
        5093  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
        5094  +
    ) {
        5095  +
        {
 7760   5096   
            #[allow(unused_mut)]
 7761   5097   
            let mut http_request = http::Request::builder()
 7762         -
            .uri("/JsonUnions")
 7763         -
            .method("PUT")
 7764         -
            .header("Content-Type", "application/json")
 7765         -
            .body(::aws_smithy_http_server::body::Body::from(
 7766         -
                ::bytes::Bytes::from_static(
 7767         -
                    "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}".as_bytes(),
 7768         -
                ),
 7769         -
            ))
        5098  +
                .uri("/MalformedTimestampHeaderDateTime")
        5099  +
                .method("POST")
        5100  +
                .header("timestamp", "19961219T16:39:57Z")
        5101  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7770   5102   
                .unwrap();
 7771   5103   
            #[allow(unused_mut)]
 7772   5104   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7773   5105   
            let config = crate::service::RestJsonConfig::builder().build();
 7774   5106   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7775         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5107  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7776   5108   
                                let sender = sender.clone();
 7777   5109   
                                async move {
 7778         -
                    let result = {
 7779         -
                        let expected = crate::input::JsonUnionsInput {
 7780         -
                            contents: ::std::option::Option::Some(
 7781         -
                                crate::model::MyUnion::BlobValue(::aws_smithy_types::Blob::new(
 7782         -
                                    "foo",
 7783         -
                                )),
 7784         -
                            ),
 7785         -
                        };
 7786         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7787         -
                        let response = crate::output::JsonUnionsOutput {
 7788         -
                            contents: ::std::option::Option::None,
 7789         -
                        };
 7790         -
                        Ok(response)
 7791         -
                    };
        5110  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7792   5111   
                                    sender.send(()).await.expect("receiver dropped early");
 7793   5112   
                                    result
 7794   5113   
                                }
 7795   5114   
                            })
 7796   5115   
                            .build_unchecked();
 7797   5116   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7798   5117   
                .await
 7799   5118   
                .expect("unable to make an HTTP request");
 7800         -
        assert!(receiver.recv().await.is_some());
        5119  +
            ::pretty_assertions::assert_eq!(
        5120  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5121  +
                http_response.status()
        5122  +
            );
        5123  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5124  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5125  +
                http_response.headers(),
        5126  +
                expected_headers,
        5127  +
            ));
 7801   5128   
        }
 7802         -
    /// Serializes a timestamp union value
 7803         -
    /// Test ID: RestJsonSerializeTimestampUnionValue
        5129  +
    }
        5130  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5131  +
    /// are rejected with a 400 SerializationException
        5132  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case7
 7804   5133   
    #[::tokio::test]
 7805         -
    async fn rest_json_serialize_timestamp_union_value_request() {
        5134  +
    #[::tracing_test::traced_test]
        5135  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
        5136  +
    ) {
        5137  +
        {
 7806   5138   
            #[allow(unused_mut)]
 7807   5139   
            let mut http_request = http::Request::builder()
 7808         -
            .uri("/JsonUnions")
 7809         -
            .method("PUT")
 7810         -
            .header("Content-Type", "application/json")
 7811         -
            .body(::aws_smithy_http_server::body::Body::from(
 7812         -
                ::bytes::Bytes::from_static(
 7813         -
                    "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}"
 7814         -
                        .as_bytes(),
 7815         -
                ),
 7816         -
            ))
        5140  +
                .uri("/MalformedTimestampHeaderDateTime")
        5141  +
                .method("POST")
        5142  +
                .header("timestamp", "19961219T16:39:57")
        5143  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7817   5144   
                .unwrap();
 7818   5145   
            #[allow(unused_mut)]
 7819   5146   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7820   5147   
            let config = crate::service::RestJsonConfig::builder().build();
 7821   5148   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7822         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5149  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7823   5150   
                                let sender = sender.clone();
 7824   5151   
                                async move {
 7825         -
                    let result = {
 7826         -
                        let expected = crate::input::JsonUnionsInput {
 7827         -
                            contents: ::std::option::Option::Some(
 7828         -
                                crate::model::MyUnion::TimestampValue(
 7829         -
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
 7830         -
                                        1398796238, 0_f64,
 7831         -
                                    ),
 7832         -
                                ),
 7833         -
                            ),
 7834         -
                        };
 7835         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7836         -
                        let response = crate::output::JsonUnionsOutput {
 7837         -
                            contents: ::std::option::Option::None,
 7838         -
                        };
 7839         -
                        Ok(response)
 7840         -
                    };
        5152  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7841   5153   
                                    sender.send(()).await.expect("receiver dropped early");
 7842   5154   
                                    result
 7843   5155   
                                }
 7844   5156   
                            })
 7845   5157   
                            .build_unchecked();
 7846   5158   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7847   5159   
                .await
 7848   5160   
                .expect("unable to make an HTTP request");
 7849         -
        assert!(receiver.recv().await.is_some());
        5161  +
            ::pretty_assertions::assert_eq!(
        5162  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5163  +
                http_response.status()
        5164  +
            );
        5165  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5166  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5167  +
                http_response.headers(),
        5168  +
                expected_headers,
        5169  +
            ));
 7850   5170   
        }
 7851         -
    /// Serializes an enum union value
 7852         -
    /// Test ID: RestJsonSerializeEnumUnionValue
        5171  +
    }
        5172  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5173  +
    /// are rejected with a 400 SerializationException
        5174  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case8
 7853   5175   
    #[::tokio::test]
 7854         -
    async fn rest_json_serialize_enum_union_value_request() {
        5176  +
    #[::tracing_test::traced_test]
        5177  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
        5178  +
    ) {
        5179  +
        {
 7855   5180   
            #[allow(unused_mut)]
 7856   5181   
            let mut http_request = http::Request::builder()
 7857         -
            .uri("/JsonUnions")
 7858         -
            .method("PUT")
 7859         -
            .header("Content-Type", "application/json")
 7860         -
            .body(::aws_smithy_http_server::body::Body::from(
 7861         -
                ::bytes::Bytes::from_static(
 7862         -
                    "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}".as_bytes(),
 7863         -
                ),
 7864         -
            ))
        5182  +
                .uri("/MalformedTimestampHeaderDateTime")
        5183  +
                .method("POST")
        5184  +
                .header("timestamp", "1996-12-19T16:39Z")
        5185  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7865   5186   
                .unwrap();
 7866   5187   
            #[allow(unused_mut)]
 7867   5188   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7868   5189   
            let config = crate::service::RestJsonConfig::builder().build();
 7869   5190   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7870         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5191  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7871   5192   
                                let sender = sender.clone();
 7872   5193   
                                async move {
 7873         -
                    let result = {
 7874         -
                        let expected = crate::input::JsonUnionsInput {
 7875         -
                            contents: ::std::option::Option::Some(
 7876         -
                                crate::model::MyUnion::EnumValue(
 7877         -
                                    "Foo"
 7878         -
                                        .parse::<crate::model::FooEnum>()
 7879         -
                                        .expect("static value validated to member"),
 7880         -
                                ),
 7881         -
                            ),
 7882         -
                        };
 7883         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7884         -
                        let response = crate::output::JsonUnionsOutput {
 7885         -
                            contents: ::std::option::Option::None,
 7886         -
                        };
 7887         -
                        Ok(response)
 7888         -
                    };
        5194  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7889   5195   
                                    sender.send(()).await.expect("receiver dropped early");
 7890   5196   
                                    result
 7891   5197   
                                }
 7892   5198   
                            })
 7893   5199   
                            .build_unchecked();
 7894   5200   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7895   5201   
                .await
 7896   5202   
                .expect("unable to make an HTTP request");
 7897         -
        assert!(receiver.recv().await.is_some());
        5203  +
            ::pretty_assertions::assert_eq!(
        5204  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5205  +
                http_response.status()
        5206  +
            );
        5207  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5208  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5209  +
                http_response.headers(),
        5210  +
                expected_headers,
        5211  +
            ));
 7898   5212   
        }
 7899         -
    /// Serializes a list union value
 7900         -
    /// Test ID: RestJsonSerializeListUnionValue
        5213  +
    }
        5214  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5215  +
    /// are rejected with a 400 SerializationException
        5216  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case9
 7901   5217   
    #[::tokio::test]
 7902         -
    async fn rest_json_serialize_list_union_value_request() {
        5218  +
    #[::tracing_test::traced_test]
        5219  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
        5220  +
    ) {
        5221  +
        {
 7903   5222   
            #[allow(unused_mut)]
 7904   5223   
            let mut http_request = http::Request::builder()
 7905         -
            .uri("/JsonUnions")
 7906         -
            .method("PUT")
 7907         -
            .header("Content-Type", "application/json")
 7908         -
            .body(::aws_smithy_http_server::body::Body::from(
 7909         -
                ::bytes::Bytes::from_static(
 7910         -
                    "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}"
 7911         -
                        .as_bytes(),
 7912         -
                ),
 7913         -
            ))
        5224  +
                .uri("/MalformedTimestampHeaderDateTime")
        5225  +
                .method("POST")
        5226  +
                .header("timestamp", "1996-12-19T16:39")
        5227  +
                .body(::aws_smithy_http_server::body::Body::empty())
 7914   5228   
                .unwrap();
 7915   5229   
            #[allow(unused_mut)]
 7916   5230   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7917   5231   
            let config = crate::service::RestJsonConfig::builder().build();
 7918   5232   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7919         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5233  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7920   5234   
                                let sender = sender.clone();
 7921   5235   
                                async move {
 7922         -
                    let result = {
 7923         -
                        let expected = crate::input::JsonUnionsInput {
 7924         -
                            contents: ::std::option::Option::Some(
 7925         -
                                crate::model::MyUnion::ListValue(vec![
 7926         -
                                    "foo".to_owned(),
 7927         -
                                    "bar".to_owned(),
 7928         -
                                ]),
 7929         -
                            ),
 7930         -
                        };
 7931         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7932         -
                        let response = crate::output::JsonUnionsOutput {
 7933         -
                            contents: ::std::option::Option::None,
 7934         -
                        };
 7935         -
                        Ok(response)
 7936         -
                    };
        5236  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7937   5237   
                                    sender.send(()).await.expect("receiver dropped early");
 7938   5238   
                                    result
 7939   5239   
                                }
 7940   5240   
                            })
 7941   5241   
                            .build_unchecked();
 7942   5242   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7943   5243   
                .await
 7944   5244   
                .expect("unable to make an HTTP request");
 7945         -
        assert!(receiver.recv().await.is_some());
        5245  +
            ::pretty_assertions::assert_eq!(
        5246  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5247  +
                http_response.status()
        5248  +
            );
        5249  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5250  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5251  +
                http_response.headers(),
        5252  +
                expected_headers,
        5253  +
            ));
 7946   5254   
        }
 7947         -
    /// Serializes a map union value
 7948         -
    /// Test ID: RestJsonSerializeMapUnionValue
        5255  +
    }
        5256  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5257  +
    /// are rejected with a 400 SerializationException
        5258  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case10
 7949   5259   
    #[::tokio::test]
 7950         -
    async fn rest_json_serialize_map_union_value_request() {
        5260  +
    #[::tracing_test::traced_test]
        5261  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
        5262  +
    ) {
        5263  +
        {
 7951   5264   
            #[allow(unused_mut)]
 7952   5265   
            let mut http_request = http::Request::builder()
 7953         -
                        .uri("/JsonUnions")
 7954         -
                        .method("PUT")
 7955         -
        .header("Content-Type", "application/json")
 7956         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}".as_bytes()))).unwrap();
        5266  +
                .uri("/MalformedTimestampHeaderDateTime")
        5267  +
                .method("POST")
        5268  +
                .header("timestamp", "1996-12-19T1639")
        5269  +
                .body(::aws_smithy_http_server::body::Body::empty())
        5270  +
                .unwrap();
 7957   5271   
            #[allow(unused_mut)]
 7958   5272   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 7959   5273   
            let config = crate::service::RestJsonConfig::builder().build();
 7960   5274   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 7961         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5275  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 7962   5276   
                                let sender = sender.clone();
 7963   5277   
                                async move {
 7964         -
                    let result = {
 7965         -
                        let expected = crate::input::JsonUnionsInput {
 7966         -
                            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue(
 7967         -
                                {
 7968         -
                                    let mut ret = ::std::collections::HashMap::new();
 7969         -
                                    ret.insert("foo".to_owned(), "bar".to_owned());
 7970         -
                                    ret.insert("spam".to_owned(), "eggs".to_owned());
 7971         -
                                    ret
 7972         -
                                },
 7973         -
                            )),
 7974         -
                        };
 7975         -
                        ::pretty_assertions::assert_eq!(input, expected);
 7976         -
                        let response = crate::output::JsonUnionsOutput {
 7977         -
                            contents: ::std::option::Option::None,
 7978         -
                        };
 7979         -
                        Ok(response)
 7980         -
                    };
        5278  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 7981   5279   
                                    sender.send(()).await.expect("receiver dropped early");
 7982   5280   
                                    result
 7983   5281   
                                }
 7984   5282   
                            })
 7985   5283   
                            .build_unchecked();
 7986   5284   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 7987   5285   
                .await
 7988   5286   
                .expect("unable to make an HTTP request");
 7989         -
        assert!(receiver.recv().await.is_some());
        5287  +
            ::pretty_assertions::assert_eq!(
        5288  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5289  +
                http_response.status()
        5290  +
            );
        5291  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5292  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5293  +
                http_response.headers(),
        5294  +
                expected_headers,
        5295  +
            ));
 7990   5296   
        }
 7991         -
    /// Serializes a structure union value
 7992         -
    /// Test ID: RestJsonSerializeStructureUnionValue
        5297  +
    }
        5298  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5299  +
    /// are rejected with a 400 SerializationException
        5300  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case11
 7993   5301   
    #[::tokio::test]
 7994         -
    async fn rest_json_serialize_structure_union_value_request() {
        5302  +
    #[::tracing_test::traced_test]
        5303  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
        5304  +
    ) {
        5305  +
        {
 7995   5306   
            #[allow(unused_mut)]
 7996   5307   
            let mut http_request = http::Request::builder()
 7997         -
                        .uri("/JsonUnions")
 7998         -
                        .method("PUT")
 7999         -
        .header("Content-Type", "application/json")
 8000         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"contents\": {\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}".as_bytes()))).unwrap();
        5308  +
                .uri("/MalformedTimestampHeaderDateTime")
        5309  +
                .method("POST")
        5310  +
                .header("timestamp", "1996-12-19T16Z")
        5311  +
                .body(::aws_smithy_http_server::body::Body::empty())
        5312  +
                .unwrap();
 8001   5313   
            #[allow(unused_mut)]
 8002   5314   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8003   5315   
            let config = crate::service::RestJsonConfig::builder().build();
 8004   5316   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8005         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5317  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 8006   5318   
                                let sender = sender.clone();
 8007   5319   
                                async move {
 8008         -
                    let result = {
 8009         -
                        let expected = crate::input::JsonUnionsInput {
 8010         -
                            contents: ::std::option::Option::Some(
 8011         -
                                crate::model::MyUnion::StructureValue(
 8012         -
                                    crate::model::GreetingStruct {
 8013         -
                                        hi: ::std::option::Option::Some("hello".to_owned()),
 8014         -
                                    },
 8015         -
                                ),
 8016         -
                            ),
 8017         -
                        };
 8018         -
                        ::pretty_assertions::assert_eq!(input, expected);
 8019         -
                        let response = crate::output::JsonUnionsOutput {
 8020         -
                            contents: ::std::option::Option::None,
 8021         -
                        };
 8022         -
                        Ok(response)
 8023         -
                    };
        5320  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 8024   5321   
                                    sender.send(()).await.expect("receiver dropped early");
 8025   5322   
                                    result
 8026   5323   
                                }
 8027   5324   
                            })
 8028   5325   
                            .build_unchecked();
 8029   5326   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8030   5327   
                .await
 8031   5328   
                .expect("unable to make an HTTP request");
 8032         -
        assert!(receiver.recv().await.is_some());
        5329  +
            ::pretty_assertions::assert_eq!(
        5330  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
        5331  +
                http_response.status()
        5332  +
            );
        5333  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
        5334  +
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
        5335  +
                http_response.headers(),
        5336  +
                expected_headers,
        5337  +
            ));
 8033   5338   
        }
 8034         -
    /// Serializes a renamed structure union value
 8035         -
    /// Test ID: RestJsonSerializeRenamedStructureUnionValue
        5339  +
    }
        5340  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5341  +
    /// are rejected with a 400 SerializationException
        5342  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case12
 8036   5343   
    #[::tokio::test]
 8037         -
    async fn rest_json_serialize_renamed_structure_union_value_request() {
        5344  +
    #[::tracing_test::traced_test]
        5345  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
        5346  +
    ) {
        5347  +
        {
 8038   5348   
            #[allow(unused_mut)]
 8039   5349   
            let mut http_request = http::Request::builder()
 8040         -
                        .uri("/JsonUnions")
 8041         -
                        .method("PUT")
 8042         -
        .header("Content-Type", "application/json")
 8043         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"contents\": {\n        \"renamedStructureValue\": {\n            \"salutation\": \"hello!\"\n        }\n    }\n}".as_bytes()))).unwrap();
        5350  +
                .uri("/MalformedTimestampHeaderDateTime")
        5351  +
                .method("POST")
        5352  +
                .header("timestamp", "1996-12-19T16")
        5353  +
                .body(::aws_smithy_http_server::body::Body::empty())
        5354  +
                .unwrap();
 8044   5355   
            #[allow(unused_mut)]
 8045   5356   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8046   5357   
            let config = crate::service::RestJsonConfig::builder().build();
 8047   5358   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8048         -
            .json_unions(move |input: crate::input::JsonUnionsInput| {
        5359  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 8049   5360   
                                let sender = sender.clone();
 8050   5361   
                                async move {
 8051         -
                    let result = {
 8052         -
                        let expected = crate::input::JsonUnionsInput {
 8053         -
                            contents: ::std::option::Option::Some(
 8054         -
                                crate::model::MyUnion::RenamedStructureValue(
 8055         -
                                    crate::model::RenamedGreeting {
 8056         -
                                        salutation: ::std::option::Option::Some(
 8057         -
                                            "hello!".to_owned(),
 8058         -
                                        ),
 8059         -
                                    },
 8060         -
                                ),
 8061         -
                            ),
 8062         -
                        };
 8063         -
                        ::pretty_assertions::assert_eq!(input, expected);
 8064         -
                        let response = crate::output::JsonUnionsOutput {
 8065         -
                            contents: ::std::option::Option::None,
 8066         -
                        };
 8067         -
                        Ok(response)
 8068         -
                    };
        5362  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 8069   5363   
                                    sender.send(()).await.expect("receiver dropped early");
 8070   5364   
                                    result
 8071   5365   
                                }
 8072   5366   
                            })
 8073   5367   
                            .build_unchecked();
 8074   5368   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8075   5369   
                .await
 8076   5370   
                .expect("unable to make an HTTP request");
 8077         -
        assert!(receiver.recv().await.is_some());
 8078         -
    }
 8079         -
    /// Deserializes a string union value
 8080         -
    /// Test ID: RestJsonDeserializeStringUnionValue
 8081         -
    #[::tokio::test]
 8082         -
    async fn rest_json_deserialize_string_union_value_response() {
 8083         -
        let output = crate::output::JsonUnionsOutput {
 8084         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::StringValue(
 8085         -
                "foo".to_owned(),
 8086         -
            )),
 8087         -
        };
 8088         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8089         -
        let http_response = output.into_response();
 8090   5371   
            ::pretty_assertions::assert_eq!(
 8091         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
        5372  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8092   5373   
                http_response.status()
 8093   5374   
            );
 8094         -
        let expected_headers = [("Content-Type", "application/json")];
 8095         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8096         -
            http_response.headers(),
 8097         -
            expected_headers,
 8098         -
        ));
 8099         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8100         -
            .await
 8101         -
            .expect("unable to extract body to bytes");
 8102         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 8103         -
            &body,
 8104         -
            "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}",
 8105         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 8106         -
        ));
 8107         -
    }
 8108         -
    /// Deserializes a boolean union value
 8109         -
    /// Test ID: RestJsonDeserializeBooleanUnionValue
 8110         -
    #[::tokio::test]
 8111         -
    async fn rest_json_deserialize_boolean_union_value_response() {
 8112         -
        let output = crate::output::JsonUnionsOutput {
 8113         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::BooleanValue(true)),
 8114         -
        };
 8115         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8116         -
        let http_response = output.into_response();
 8117         -
        ::pretty_assertions::assert_eq!(
 8118         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8119         -
            http_response.status()
 8120         -
        );
 8121         -
        let expected_headers = [("Content-Type", "application/json")];
 8122         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8123         -
            http_response.headers(),
 8124         -
            expected_headers,
 8125         -
        ));
 8126         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8127         -
            .await
 8128         -
            .expect("unable to extract body to bytes");
 8129         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 8130         -
            &body,
 8131         -
            "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
 8132         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 8133         -
        ));
 8134         -
    }
 8135         -
    /// Deserializes a number union value
 8136         -
    /// Test ID: RestJsonDeserializeNumberUnionValue
 8137         -
    #[::tokio::test]
 8138         -
    async fn rest_json_deserialize_number_union_value_response() {
 8139         -
        let output = crate::output::JsonUnionsOutput {
 8140         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::NumberValue(1)),
 8141         -
        };
 8142         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8143         -
        let http_response = output.into_response();
 8144         -
        ::pretty_assertions::assert_eq!(
 8145         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8146         -
            http_response.status()
 8147         -
        );
 8148         -
        let expected_headers = [("Content-Type", "application/json")];
 8149         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8150         -
            http_response.headers(),
 8151         -
            expected_headers,
 8152         -
        ));
 8153         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8154         -
            .await
 8155         -
            .expect("unable to extract body to bytes");
 8156         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 8157         -
            &body,
 8158         -
            "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
 8159         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 8160         -
        ));
 8161         -
    }
 8162         -
    /// Deserializes a blob union value
 8163         -
    /// Test ID: RestJsonDeserializeBlobUnionValue
 8164         -
    #[::tokio::test]
 8165         -
    async fn rest_json_deserialize_blob_union_value_response() {
 8166         -
        let output = crate::output::JsonUnionsOutput {
 8167         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::BlobValue(
 8168         -
                ::aws_smithy_types::Blob::new("foo"),
 8169         -
            )),
 8170         -
        };
 8171         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8172         -
        let http_response = output.into_response();
 8173         -
        ::pretty_assertions::assert_eq!(
 8174         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8175         -
            http_response.status()
 8176         -
        );
 8177         -
        let expected_headers = [("Content-Type", "application/json")];
 8178         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8179         -
            http_response.headers(),
 8180         -
            expected_headers,
 8181         -
        ));
 8182         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8183         -
            .await
 8184         -
            .expect("unable to extract body to bytes");
 8185         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 8186         -
            &body,
 8187         -
            "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
 8188         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 8189         -
        ));
 8190         -
    }
 8191         -
    /// Deserializes a timestamp union value
 8192         -
    /// Test ID: RestJsonDeserializeTimestampUnionValue
 8193         -
    #[::tokio::test]
 8194         -
    async fn rest_json_deserialize_timestamp_union_value_response() {
 8195         -
        let output = crate::output::JsonUnionsOutput {
 8196         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::TimestampValue(
 8197         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
 8198         -
            )),
 8199         -
        };
 8200         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8201         -
        let http_response = output.into_response();
 8202         -
        ::pretty_assertions::assert_eq!(
 8203         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8204         -
            http_response.status()
 8205         -
        );
 8206         -
        let expected_headers = [("Content-Type", "application/json")];
 8207         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8208         -
            http_response.headers(),
 8209         -
            expected_headers,
 8210         -
        ));
 8211         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8212         -
            .await
 8213         -
            .expect("unable to extract body to bytes");
 8214         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 8215         -
            &body,
 8216         -
            "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
 8217         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 8218         -
        ));
 8219         -
    }
 8220         -
    /// Deserializes an enum union value
 8221         -
    /// Test ID: RestJsonDeserializeEnumUnionValue
 8222         -
    #[::tokio::test]
 8223         -
    async fn rest_json_deserialize_enum_union_value_response() {
 8224         -
        let output = crate::output::JsonUnionsOutput {
 8225         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::EnumValue(
 8226         -
                "Foo"
 8227         -
                    .parse::<crate::model::FooEnum>()
 8228         -
                    .expect("static value validated to member"),
 8229         -
            )),
 8230         -
        };
 8231         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8232         -
        let http_response = output.into_response();
 8233         -
        ::pretty_assertions::assert_eq!(
 8234         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8235         -
            http_response.status()
 8236         -
        );
 8237         -
        let expected_headers = [("Content-Type", "application/json")];
 8238         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8239         -
            http_response.headers(),
 8240         -
            expected_headers,
 8241         -
        ));
 8242         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8243         -
            .await
 8244         -
            .expect("unable to extract body to bytes");
 8245         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 8246         -
            &body,
 8247         -
            "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
 8248         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 8249         -
        ));
 8250         -
    }
 8251         -
    /// Deserializes a list union value
 8252         -
    /// Test ID: RestJsonDeserializeListUnionValue
 8253         -
    #[::tokio::test]
 8254         -
    async fn rest_json_deserialize_list_union_value_response() {
 8255         -
        let output = crate::output::JsonUnionsOutput {
 8256         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::ListValue(vec![
 8257         -
                "foo".to_owned(),
 8258         -
                "bar".to_owned(),
 8259         -
            ])),
 8260         -
        };
 8261         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8262         -
        let http_response = output.into_response();
 8263         -
        ::pretty_assertions::assert_eq!(
 8264         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8265         -
            http_response.status()
 8266         -
        );
 8267         -
        let expected_headers = [("Content-Type", "application/json")];
 8268         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8269         -
            http_response.headers(),
 8270         -
            expected_headers,
 8271         -
        ));
 8272         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8273         -
            .await
 8274         -
            .expect("unable to extract body to bytes");
 8275         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
 8276         -
            &body,
 8277         -
            "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
 8278         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
 8279         -
        ));
 8280         -
    }
 8281         -
    /// Deserializes a map union value
 8282         -
    /// Test ID: RestJsonDeserializeMapUnionValue
 8283         -
    #[::tokio::test]
 8284         -
    async fn rest_json_deserialize_map_union_value_response() {
 8285         -
        let output = crate::output::JsonUnionsOutput {
 8286         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue({
 8287         -
                let mut ret = ::std::collections::HashMap::new();
 8288         -
                ret.insert("foo".to_owned(), "bar".to_owned());
 8289         -
                ret.insert("spam".to_owned(), "eggs".to_owned());
 8290         -
                ret
 8291         -
            })),
 8292         -
        };
 8293         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8294         -
        let http_response = output.into_response();
 8295         -
        ::pretty_assertions::assert_eq!(
 8296         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8297         -
            http_response.status()
 8298         -
        );
 8299         -
        let expected_headers = [("Content-Type", "application/json")];
        5375  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8300   5376   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8301   5377   
                http_response.headers(),
 8302   5378   
                expected_headers,
 8303   5379   
            ));
 8304         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8305         -
            .await
 8306         -
            .expect("unable to extract body to bytes");
 8307         -
        ::aws_smithy_protocol_test::assert_ok(
 8308         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 8309         -
        );
 8310   5380   
        }
 8311         -
    /// Deserializes a structure union value
 8312         -
    /// Test ID: RestJsonDeserializeStructureUnionValue
 8313         -
    #[::tokio::test]
 8314         -
    async fn rest_json_deserialize_structure_union_value_response() {
 8315         -
        let output = crate::output::JsonUnionsOutput {
 8316         -
            contents: ::std::option::Option::Some(crate::model::MyUnion::StructureValue(
 8317         -
                crate::model::GreetingStruct {
 8318         -
                    hi: ::std::option::Option::Some("hello".to_owned()),
 8319         -
                },
 8320         -
            )),
 8321         -
        };
 8322         -
        use ::aws_smithy_http_server::response::IntoResponse;
 8323         -
        let http_response = output.into_response();
 8324         -
        ::pretty_assertions::assert_eq!(
 8325         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
 8326         -
            http_response.status()
 8327         -
        );
 8328         -
        let expected_headers = [("Content-Type", "application/json")];
 8329         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8330         -
            http_response.headers(),
 8331         -
            expected_headers,
 8332         -
        ));
 8333         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
 8334         -
            .await
 8335         -
            .expect("unable to extract body to bytes");
 8336         -
        ::aws_smithy_protocol_test::assert_ok(
 8337         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"contents\": {\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 8338         -
        );
 8339   5381   
    }
 8340         -
}
 8341         -
#[cfg(test)]
 8342         -
#[allow(unreachable_code, unused_variables)]
 8343         -
mod server_malformed_accept_with_body_test {
 8344         -
    /// When there is modeled output, the accept must be application/json
 8345         -
    /// Test ID: RestJsonWithBodyExpectsApplicationJsonAccept
        5382  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5383  +
    /// are rejected with a 400 SerializationException
        5384  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case13
 8346   5385   
    #[::tokio::test]
 8347         -
    async fn rest_json_with_body_expects_application_json_accept_malformed_request() {
        5386  +
    #[::tracing_test::traced_test]
        5387  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
        5388  +
    ) {
 8348   5389   
        {
 8349   5390   
            #[allow(unused_mut)]
 8350   5391   
            let mut http_request = http::Request::builder()
 8351         -
                .uri("/MalformedAcceptWithBody")
        5392  +
                .uri("/MalformedTimestampHeaderDateTime")
 8352   5393   
                .method("POST")
 8353         -
                .header("accept", "application/hal+json")
        5394  +
                .header("timestamp", "1996-12-19 16:39:57Z")
 8354   5395   
                .body(::aws_smithy_http_server::body::Body::empty())
 8355   5396   
                .unwrap();
 8356   5397   
            #[allow(unused_mut)]
 8357   5398   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8358   5399   
            let config = crate::service::RestJsonConfig::builder().build();
 8359   5400   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8360         -
                            .malformed_accept_with_body(move |input: crate::input::MalformedAcceptWithBodyInput| {
        5401  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 8361   5402   
                                let sender = sender.clone();
 8362   5403   
                                async move {
 8363         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithBodyOutput };
        5404  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 8364   5405   
                                    sender.send(()).await.expect("receiver dropped early");
 8365   5406   
                                    result
 8366   5407   
                                }
 8367   5408   
                            })
 8368   5409   
                            .build_unchecked();
 8369   5410   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8370   5411   
                .await
 8371   5412   
                .expect("unable to make an HTTP request");
 8372   5413   
            ::pretty_assertions::assert_eq!(
 8373         -
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
        5414  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8374   5415   
                http_response.status()
 8375   5416   
            );
 8376         -
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
        5417  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8377   5418   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8378   5419   
                http_response.headers(),
 8379   5420   
                expected_headers,
 8380   5421   
            ));
 8381   5422   
        }
 8382   5423   
    }
 8383         -
}
 8384         -
#[cfg(test)]
 8385         -
#[allow(unreachable_code, unused_variables)]
 8386         -
mod server_malformed_accept_with_generic_string_test {
 8387         -
    /// When there is a payload without a mediaType trait, the accept must match the
 8388         -
    /// implied content type of the shape.
 8389         -
    /// Test ID: RestJsonWithPayloadExpectsImpliedAccept
        5424  +
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        5425  +
    /// are rejected with a 400 SerializationException
        5426  +
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case14
 8390   5427   
    #[::tokio::test]
 8391         -
    async fn rest_json_with_payload_expects_implied_accept_malformed_request() {
        5428  +
    #[::tracing_test::traced_test]
        5429  +
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
        5430  +
    ) {
 8392   5431   
        {
 8393   5432   
            #[allow(unused_mut)]
 8394   5433   
            let mut http_request = http::Request::builder()
 8395         -
                .uri("/MalformedAcceptWithGenericString")
        5434  +
                .uri("/MalformedTimestampHeaderDateTime")
 8396   5435   
                .method("POST")
 8397         -
                .header("accept", "application/json")
        5436  +
                .header("timestamp", "2011-12-03T10:15:30+01:00[Europe/Paris]")
 8398   5437   
                .body(::aws_smithy_http_server::body::Body::empty())
 8399   5438   
                .unwrap();
 8400   5439   
            #[allow(unused_mut)]
 8401   5440   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8402   5441   
            let config = crate::service::RestJsonConfig::builder().build();
 8403   5442   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8404         -
                            .malformed_accept_with_generic_string(move |input: crate::input::MalformedAcceptWithGenericStringInput| {
        5443  +
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
 8405   5444   
                                let sender = sender.clone();
 8406   5445   
                                async move {
 8407         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithGenericStringOutput };
        5446  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
 8408   5447   
                                    sender.send(()).await.expect("receiver dropped early");
 8409   5448   
                                    result
 8410   5449   
                                }
 8411   5450   
                            })
 8412   5451   
                            .build_unchecked();
 8413   5452   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8414   5453   
                .await
 8415   5454   
                .expect("unable to make an HTTP request");
 8416   5455   
            ::pretty_assertions::assert_eq!(
 8417         -
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
        5456  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8418   5457   
                http_response.status()
 8419   5458   
            );
 8420         -
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
        5459  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8421   5460   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8422   5461   
                http_response.headers(),
 8423   5462   
                expected_headers,
 8424   5463   
            ));
 8425   5464   
        }
 8426   5465   
    }
 8427   5466   
}
 8428         -
#[cfg(test)]
        5467  +
        5468  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
        5469  +
::pin_project_lite::pin_project! {
        5470  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        5471  +
    /// [`MalformedTimestampHeaderDefaultInput`](crate::input::MalformedTimestampHeaderDefaultInput) using modelled bindings.
        5472  +
    pub struct MalformedTimestampHeaderDefaultInputFuture {
        5473  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampHeaderDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        5474  +
    }
        5475  +
}
        5476  +
        5477  +
impl std::future::Future for MalformedTimestampHeaderDefaultInputFuture {
        5478  +
    type Output = Result<
        5479  +
        crate::input::MalformedTimestampHeaderDefaultInput,
        5480  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        5481  +
    >;
        5482  +
        5483  +
    fn poll(
        5484  +
        self: std::pin::Pin<&mut Self>,
        5485  +
        cx: &mut std::task::Context<'_>,
        5486  +
    ) -> std::task::Poll<Self::Output> {
        5487  +
        let this = self.project();
        5488  +
        this.inner.as_mut().poll(cx)
        5489  +
    }
        5490  +
}
        5491  +
        5492  +
impl<B>
        5493  +
    ::aws_smithy_http_server::request::FromRequest<
        5494  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        5495  +
        B,
        5496  +
    > for crate::input::MalformedTimestampHeaderDefaultInput
        5497  +
where
        5498  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        5499  +
    B: 'static,
        5500  +
        5501  +
    B::Data: Send,
        5502  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        5503  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        5504  +
{
        5505  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        5506  +
    type Future = MalformedTimestampHeaderDefaultInputFuture;
        5507  +
        5508  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        5509  +
        let fut = async move {
        5510  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        5511  +
                request.headers(),
        5512  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDEFAULT,
        5513  +
            ) {
        5514  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        5515  +
            }
        5516  +
            crate::protocol_serde::shape_malformed_timestamp_header_default::de_malformed_timestamp_header_default_http_request(request)
        5517  +
                            .await
        5518  +
                            .map_err(Into::into)
        5519  +
        };
        5520  +
        use ::futures_util::future::TryFutureExt;
        5521  +
        let fut = fut.map_err(
        5522  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        5523  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        5524  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        5525  +
                    e,
        5526  +
                )
        5527  +
            },
        5528  +
        );
        5529  +
        MalformedTimestampHeaderDefaultInputFuture {
        5530  +
            inner: Box::pin(fut),
        5531  +
        }
        5532  +
    }
        5533  +
}
        5534  +
impl
        5535  +
    ::aws_smithy_http_server::response::IntoResponse<
        5536  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        5537  +
    > for crate::output::MalformedTimestampHeaderDefaultOutput
        5538  +
{
        5539  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        5540  +
        match crate::protocol_serde::shape_malformed_timestamp_header_default::ser_malformed_timestamp_header_default_http_response(self) {
        5541  +
                        Ok(response) => response,
        5542  +
                        Err(e) => {
        5543  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        5544  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        5545  +
                        }
        5546  +
                    }
        5547  +
    }
        5548  +
}
        5549  +
impl
        5550  +
    ::aws_smithy_http_server::response::IntoResponse<
        5551  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        5552  +
    > for crate::error::MalformedTimestampHeaderDefaultError
        5553  +
{
        5554  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        5555  +
        match crate::protocol_serde::shape_malformed_timestamp_header_default::ser_malformed_timestamp_header_default_http_error(&self) {
        5556  +
            Ok(mut response) => {
        5557  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        5558  +
                response
        5559  +
            },
        5560  +
            Err(e) => {
        5561  +
                ::tracing::error!(error = %e, "failed to serialize response");
        5562  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        5563  +
            }
        5564  +
        }
        5565  +
    }
        5566  +
}
        5567  +
 8429   5568   
#[allow(unreachable_code, unused_variables)]
 8430         -
mod server_malformed_accept_with_payload_test {
 8431         -
    /// When there is a payload with a mediaType trait, the accept must match.
 8432         -
    /// Test ID: RestJsonWithPayloadExpectsModeledAccept
        5569  +
#[cfg(test)]
        5570  +
mod malformed_timestamp_header_default_test {
        5571  +
        5572  +
    /// By default, RFC3339 timestamps are rejected with a
        5573  +
    /// 400 SerializationException
        5574  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case0
 8433   5575   
    #[::tokio::test]
 8434         -
    async fn rest_json_with_payload_expects_modeled_accept_malformed_request() {
        5576  +
    #[::tracing_test::traced_test]
        5577  +
    async fn rest_json_header_timestamp_default_rejects_date_time_case0_malformed_request() {
 8435   5578   
        {
 8436   5579   
            #[allow(unused_mut)]
 8437   5580   
            let mut http_request = http::Request::builder()
 8438         -
                .uri("/MalformedAcceptWithPayload")
        5581  +
                .uri("/MalformedTimestampHeaderDefault")
 8439   5582   
                .method("POST")
 8440         -
                .header("accept", "application/json")
        5583  +
                .header("timestamp", "1985-04-12T23:20:50.52Z")
 8441   5584   
                .body(::aws_smithy_http_server::body::Body::empty())
 8442   5585   
                .unwrap();
 8443   5586   
            #[allow(unused_mut)]
 8444   5587   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8445   5588   
            let config = crate::service::RestJsonConfig::builder().build();
 8446   5589   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8447         -
                            .malformed_accept_with_payload(move |input: crate::input::MalformedAcceptWithPayloadInput| {
        5590  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
 8448   5591   
                                let sender = sender.clone();
 8449   5592   
                                async move {
 8450         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedAcceptWithPayloadOutput };
        5593  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
 8451   5594   
                                    sender.send(()).await.expect("receiver dropped early");
 8452   5595   
                                    result
 8453   5596   
                                }
 8454   5597   
                            })
 8455   5598   
                            .build_unchecked();
 8456   5599   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8457   5600   
                .await
 8458   5601   
                .expect("unable to make an HTTP request");
 8459   5602   
            ::pretty_assertions::assert_eq!(
 8460         -
                http::StatusCode::from_u16(406).expect("invalid expected HTTP status code"),
        5603  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8461   5604   
                http_response.status()
 8462   5605   
            );
 8463         -
            let expected_headers = [("x-amzn-errortype", "NotAcceptableException")];
        5606  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8464   5607   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8465   5608   
                http_response.headers(),
 8466   5609   
                expected_headers,
 8467   5610   
            ));
 8468   5611   
        }
 8469   5612   
    }
 8470         -
}
 8471         -
#[cfg(test)]
 8472         -
#[allow(unreachable_code, unused_variables)]
 8473         -
mod server_malformed_blob_test {
 8474         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8475         -
    /// all, the response should be a 400 SerializationException.
 8476         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case0
        5613  +
    /// By default, RFC3339 timestamps are rejected with a
        5614  +
    /// 400 SerializationException
        5615  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case1
 8477   5616   
    #[::tokio::test]
 8478         -
    async fn rest_json_body_malformed_blob_invalid_base64_case0_malformed_request() {
        5617  +
    #[::tracing_test::traced_test]
        5618  +
    async fn rest_json_header_timestamp_default_rejects_date_time_case1_malformed_request() {
 8479   5619   
        {
 8480   5620   
            #[allow(unused_mut)]
 8481   5621   
            let mut http_request = http::Request::builder()
 8482         -
                .uri("/MalformedBlob")
        5622  +
                .uri("/MalformedTimestampHeaderDefault")
 8483   5623   
                .method("POST")
 8484         -
                .header("content-type", "application/json")
 8485         -
                .body(::aws_smithy_http_server::body::Body::from(
 8486         -
                    ::bytes::Bytes::from_static("{ \"blob\" : blob }".as_bytes()),
 8487         -
                ))
        5624  +
                .header("timestamp", "1985-04-12T23:20:50Z")
        5625  +
                .body(::aws_smithy_http_server::body::Body::empty())
 8488   5626   
                .unwrap();
 8489   5627   
            #[allow(unused_mut)]
 8490   5628   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8491   5629   
            let config = crate::service::RestJsonConfig::builder().build();
 8492   5630   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8493         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        5631  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
 8494   5632   
                                let sender = sender.clone();
 8495   5633   
                                async move {
 8496         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        5634  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
 8497   5635   
                                    sender.send(()).await.expect("receiver dropped early");
 8498   5636   
                                    result
 8499   5637   
                                }
 8500   5638   
                            })
 8501   5639   
                            .build_unchecked();
 8502   5640   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8503   5641   
                .await
 8504   5642   
                .expect("unable to make an HTTP request");
 8505   5643   
            ::pretty_assertions::assert_eq!(
 8506   5644   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8507   5645   
                http_response.status()
 8508   5646   
            );
 8509   5647   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8510   5648   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8511   5649   
                http_response.headers(),
 8512   5650   
                expected_headers,
 8513   5651   
            ));
 8514   5652   
        }
 8515   5653   
    }
 8516         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8517         -
    /// all, the response should be a 400 SerializationException.
 8518         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case1
        5654  +
    /// By default, RFC3339 timestamps are rejected with a
        5655  +
    /// 400 SerializationException
        5656  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case2
 8519   5657   
    #[::tokio::test]
 8520         -
    async fn rest_json_body_malformed_blob_invalid_base64_case1_malformed_request() {
        5658  +
    #[::tracing_test::traced_test]
        5659  +
    async fn rest_json_header_timestamp_default_rejects_date_time_case2_malformed_request() {
 8521   5660   
        {
 8522   5661   
            #[allow(unused_mut)]
 8523   5662   
            let mut http_request = http::Request::builder()
 8524         -
                .uri("/MalformedBlob")
        5663  +
                .uri("/MalformedTimestampHeaderDefault")
 8525   5664   
                .method("POST")
 8526         -
                .header("content-type", "application/json")
 8527         -
                .body(::aws_smithy_http_server::body::Body::from(
 8528         -
                    ::bytes::Bytes::from_static("{ \"blob\" : \"xyz\" }".as_bytes()),
 8529         -
                ))
        5665  +
                .header("timestamp", "1996-12-19T16:39:57-08:00")
        5666  +
                .body(::aws_smithy_http_server::body::Body::empty())
 8530   5667   
                .unwrap();
 8531   5668   
            #[allow(unused_mut)]
 8532   5669   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8533   5670   
            let config = crate::service::RestJsonConfig::builder().build();
 8534   5671   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8535         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        5672  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
 8536   5673   
                                let sender = sender.clone();
 8537   5674   
                                async move {
 8538         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        5675  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
 8539   5676   
                                    sender.send(()).await.expect("receiver dropped early");
 8540   5677   
                                    result
 8541   5678   
                                }
 8542   5679   
                            })
 8543   5680   
                            .build_unchecked();
 8544   5681   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8545   5682   
                .await
 8546   5683   
                .expect("unable to make an HTTP request");
 8547   5684   
            ::pretty_assertions::assert_eq!(
 8548   5685   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8549   5686   
                http_response.status()
 8550   5687   
            );
 8551   5688   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8552   5689   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8553   5690   
                http_response.headers(),
 8554   5691   
                expected_headers,
 8555   5692   
            ));
 8556   5693   
        }
 8557   5694   
    }
 8558         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8559         -
    /// all, the response should be a 400 SerializationException.
 8560         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case2
        5695  +
    /// By default, epoch second timestamps are rejected with a
        5696  +
    /// 400 SerializationException
        5697  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case0
 8561   5698   
    #[::tokio::test]
 8562         -
    async fn rest_json_body_malformed_blob_invalid_base64_case2_malformed_request() {
        5699  +
    #[::tracing_test::traced_test]
        5700  +
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
 8563   5701   
        {
 8564   5702   
            #[allow(unused_mut)]
 8565   5703   
            let mut http_request = http::Request::builder()
 8566         -
                .uri("/MalformedBlob")
        5704  +
                .uri("/MalformedTimestampHeaderDefault")
 8567   5705   
                .method("POST")
 8568         -
                .header("content-type", "application/json")
 8569         -
                .body(::aws_smithy_http_server::body::Body::from(
 8570         -
                    ::bytes::Bytes::from_static("{ \"blob\" : \"YmxvYg=\" }".as_bytes()),
 8571         -
                ))
        5706  +
                .header("timestamp", "1515531081.1234")
        5707  +
                .body(::aws_smithy_http_server::body::Body::empty())
 8572   5708   
                .unwrap();
 8573   5709   
            #[allow(unused_mut)]
 8574   5710   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8575   5711   
            let config = crate::service::RestJsonConfig::builder().build();
 8576   5712   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8577         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        5713  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
 8578   5714   
                                let sender = sender.clone();
 8579   5715   
                                async move {
 8580         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        5716  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
 8581   5717   
                                    sender.send(()).await.expect("receiver dropped early");
 8582   5718   
                                    result
 8583   5719   
                                }
 8584   5720   
                            })
 8585   5721   
                            .build_unchecked();
 8586   5722   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8587   5723   
                .await
 8588   5724   
                .expect("unable to make an HTTP request");
 8589   5725   
            ::pretty_assertions::assert_eq!(
 8590   5726   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8591   5727   
                http_response.status()
 8592   5728   
            );
 8593   5729   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8594   5730   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8595   5731   
                http_response.headers(),
 8596   5732   
                expected_headers,
 8597   5733   
            ));
 8598   5734   
        }
 8599   5735   
    }
 8600         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8601         -
    /// all, the response should be a 400 SerializationException.
 8602         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case3
        5736  +
    /// By default, epoch second timestamps are rejected with a
        5737  +
    /// 400 SerializationException
        5738  +
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case1
 8603   5739   
    #[::tokio::test]
 8604         -
    async fn rest_json_body_malformed_blob_invalid_base64_case3_malformed_request() {
        5740  +
    #[::tracing_test::traced_test]
        5741  +
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
 8605   5742   
        {
 8606   5743   
            #[allow(unused_mut)]
 8607   5744   
            let mut http_request = http::Request::builder()
 8608         -
                .uri("/MalformedBlob")
        5745  +
                .uri("/MalformedTimestampHeaderDefault")
 8609   5746   
                .method("POST")
 8610         -
                .header("content-type", "application/json")
 8611         -
                .body(::aws_smithy_http_server::body::Body::from(
 8612         -
                    ::bytes::Bytes::from_static("{ \"blob\" : [98, 108, 11, 98] }".as_bytes()),
 8613         -
                ))
        5747  +
                .header("timestamp", "1515531081")
        5748  +
                .body(::aws_smithy_http_server::body::Body::empty())
 8614   5749   
                .unwrap();
 8615   5750   
            #[allow(unused_mut)]
 8616   5751   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8617   5752   
            let config = crate::service::RestJsonConfig::builder().build();
 8618   5753   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8619         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        5754  +
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
 8620   5755   
                                let sender = sender.clone();
 8621   5756   
                                async move {
 8622         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        5757  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
 8623   5758   
                                    sender.send(()).await.expect("receiver dropped early");
 8624   5759   
                                    result
 8625   5760   
                                }
 8626   5761   
                            })
 8627   5762   
                            .build_unchecked();
 8628   5763   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8629   5764   
                .await
 8630   5765   
                .expect("unable to make an HTTP request");
 8631   5766   
            ::pretty_assertions::assert_eq!(
 8632   5767   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8633   5768   
                http_response.status()
 8634   5769   
            );
 8635   5770   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8636   5771   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8637   5772   
                http_response.headers(),
 8638   5773   
                expected_headers,
 8639   5774   
            ));
 8640   5775   
        }
 8641   5776   
    }
 8642         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8643         -
    /// all, the response should be a 400 SerializationException.
 8644         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case4
 8645         -
    #[::tokio::test]
 8646         -
    async fn rest_json_body_malformed_blob_invalid_base64_case4_malformed_request() {
 8647         -
        {
 8648         -
            #[allow(unused_mut)]
 8649         -
            let mut http_request = http::Request::builder()
 8650         -
                .uri("/MalformedBlob")
 8651         -
                .method("POST")
 8652         -
                .header("content-type", "application/json")
 8653         -
                .body(::aws_smithy_http_server::body::Body::from(
 8654         -
                    ::bytes::Bytes::from_static(
 8655         -
                        "{ \"blob\" : [\"b\", \"l\",\"o\",\"b\"] }".as_bytes(),
 8656         -
                    ),
 8657         -
                ))
 8658         -
                .unwrap();
 8659         -
            #[allow(unused_mut)]
        5777  +
}
        5778  +
        5779  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYEPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
        5780  +
::pin_project_lite::pin_project! {
        5781  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        5782  +
    /// [`MalformedTimestampQueryEpochInput`](crate::input::MalformedTimestampQueryEpochInput) using modelled bindings.
        5783  +
    pub struct MalformedTimestampQueryEpochInputFuture {
        5784  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampQueryEpochInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        5785  +
    }
        5786  +
}
        5787  +
        5788  +
impl std::future::Future for MalformedTimestampQueryEpochInputFuture {
        5789  +
    type Output = Result<
        5790  +
        crate::input::MalformedTimestampQueryEpochInput,
        5791  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        5792  +
    >;
        5793  +
        5794  +
    fn poll(
        5795  +
        self: std::pin::Pin<&mut Self>,
        5796  +
        cx: &mut std::task::Context<'_>,
        5797  +
    ) -> std::task::Poll<Self::Output> {
        5798  +
        let this = self.project();
        5799  +
        this.inner.as_mut().poll(cx)
        5800  +
    }
        5801  +
}
        5802  +
        5803  +
impl<B>
        5804  +
    ::aws_smithy_http_server::request::FromRequest<
        5805  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        5806  +
        B,
        5807  +
    > for crate::input::MalformedTimestampQueryEpochInput
        5808  +
where
        5809  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        5810  +
    B: 'static,
        5811  +
        5812  +
    B::Data: Send,
        5813  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        5814  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        5815  +
{
        5816  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        5817  +
    type Future = MalformedTimestampQueryEpochInputFuture;
        5818  +
        5819  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        5820  +
        let fut = async move {
        5821  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        5822  +
                request.headers(),
        5823  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYEPOCH,
        5824  +
            ) {
        5825  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        5826  +
            }
        5827  +
            crate::protocol_serde::shape_malformed_timestamp_query_epoch::de_malformed_timestamp_query_epoch_http_request(request)
        5828  +
                            .await
        5829  +
                            .map_err(Into::into)
        5830  +
        };
        5831  +
        use ::futures_util::future::TryFutureExt;
        5832  +
        let fut = fut.map_err(
        5833  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        5834  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        5835  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        5836  +
                    e,
        5837  +
                )
        5838  +
            },
        5839  +
        );
        5840  +
        MalformedTimestampQueryEpochInputFuture {
        5841  +
            inner: Box::pin(fut),
        5842  +
        }
        5843  +
    }
        5844  +
}
        5845  +
impl
        5846  +
    ::aws_smithy_http_server::response::IntoResponse<
        5847  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        5848  +
    > for crate::output::MalformedTimestampQueryEpochOutput
        5849  +
{
        5850  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        5851  +
        match crate::protocol_serde::shape_malformed_timestamp_query_epoch::ser_malformed_timestamp_query_epoch_http_response(self) {
        5852  +
                        Ok(response) => response,
        5853  +
                        Err(e) => {
        5854  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        5855  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        5856  +
                        }
        5857  +
                    }
        5858  +
    }
        5859  +
}
        5860  +
impl
        5861  +
    ::aws_smithy_http_server::response::IntoResponse<
        5862  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        5863  +
    > for crate::error::MalformedTimestampQueryEpochError
        5864  +
{
        5865  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        5866  +
        match crate::protocol_serde::shape_malformed_timestamp_query_epoch::ser_malformed_timestamp_query_epoch_http_error(&self) {
        5867  +
            Ok(mut response) => {
        5868  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        5869  +
                response
        5870  +
            },
        5871  +
            Err(e) => {
        5872  +
                ::tracing::error!(error = %e, "failed to serialize response");
        5873  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        5874  +
            }
        5875  +
        }
        5876  +
    }
        5877  +
}
        5878  +
        5879  +
#[allow(unreachable_code, unused_variables)]
        5880  +
#[cfg(test)]
        5881  +
mod malformed_timestamp_query_epoch_test {
        5882  +
        5883  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        5884  +
    /// 400 SerializationException
        5885  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case0
        5886  +
    #[::tokio::test]
        5887  +
    #[::tracing_test::traced_test]
        5888  +
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case0_malformed_request() {
        5889  +
        {
        5890  +
            #[allow(unused_mut)]
        5891  +
            let mut http_request = http::Request::builder()
        5892  +
                .uri("/MalformedTimestampQueryEpoch")
        5893  +
                .method("POST")
        5894  +
                .body(::aws_smithy_http_server::body::Body::empty())
        5895  +
                .unwrap();
        5896  +
            *http_request.uri_mut() =
        5897  +
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50.52Z"
        5898  +
                    .parse()
        5899  +
                    .unwrap();
        5900  +
            #[allow(unused_mut)]
 8660   5901   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8661   5902   
            let config = crate::service::RestJsonConfig::builder().build();
 8662   5903   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8663         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        5904  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8664   5905   
                                let sender = sender.clone();
 8665   5906   
                                async move {
 8666         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        5907  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8667   5908   
                                    sender.send(()).await.expect("receiver dropped early");
 8668   5909   
                                    result
 8669   5910   
                                }
 8670   5911   
                            })
 8671   5912   
                            .build_unchecked();
 8672   5913   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8673   5914   
                .await
 8674   5915   
                .expect("unable to make an HTTP request");
 8675   5916   
            ::pretty_assertions::assert_eq!(
 8676   5917   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8677   5918   
                http_response.status()
 8678   5919   
            );
 8679   5920   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8680   5921   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8681   5922   
                http_response.headers(),
 8682   5923   
                expected_headers,
 8683   5924   
            ));
 8684   5925   
        }
 8685   5926   
    }
 8686         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8687         -
    /// all, the response should be a 400 SerializationException.
 8688         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case5
        5927  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        5928  +
    /// 400 SerializationException
        5929  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case1
 8689   5930   
    #[::tokio::test]
 8690         -
    async fn rest_json_body_malformed_blob_invalid_base64_case5_malformed_request() {
        5931  +
    #[::tracing_test::traced_test]
        5932  +
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case1_malformed_request() {
 8691   5933   
        {
 8692   5934   
            #[allow(unused_mut)]
 8693   5935   
            let mut http_request = http::Request::builder()
 8694         -
                .uri("/MalformedBlob")
        5936  +
                .uri("/MalformedTimestampQueryEpoch")
 8695   5937   
                .method("POST")
 8696         -
                .header("content-type", "application/json")
 8697         -
                .body(::aws_smithy_http_server::body::Body::from(
 8698         -
                    ::bytes::Bytes::from_static("{ \"blob\" : 981081198 }".as_bytes()),
 8699         -
                ))
        5938  +
                .body(::aws_smithy_http_server::body::Body::empty())
        5939  +
                .unwrap();
        5940  +
            *http_request.uri_mut() =
        5941  +
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50Z"
        5942  +
                    .parse()
 8700   5943   
                    .unwrap();
 8701   5944   
            #[allow(unused_mut)]
 8702   5945   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8703   5946   
            let config = crate::service::RestJsonConfig::builder().build();
 8704   5947   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8705         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        5948  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8706   5949   
                                let sender = sender.clone();
 8707   5950   
                                async move {
 8708         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        5951  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8709   5952   
                                    sender.send(()).await.expect("receiver dropped early");
 8710   5953   
                                    result
 8711   5954   
                                }
 8712   5955   
                            })
 8713   5956   
                            .build_unchecked();
 8714   5957   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8715   5958   
                .await
 8716   5959   
                .expect("unable to make an HTTP request");
 8717   5960   
            ::pretty_assertions::assert_eq!(
 8718   5961   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8719   5962   
                http_response.status()
 8720   5963   
            );
 8721   5964   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8722   5965   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8723   5966   
                http_response.headers(),
 8724   5967   
                expected_headers,
 8725   5968   
            ));
 8726   5969   
        }
 8727   5970   
    }
 8728         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8729         -
    /// all, the response should be a 400 SerializationException.
 8730         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case6
        5971  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        5972  +
    /// 400 SerializationException
        5973  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case2
 8731   5974   
    #[::tokio::test]
 8732         -
    async fn rest_json_body_malformed_blob_invalid_base64_case6_malformed_request() {
        5975  +
    #[::tracing_test::traced_test]
        5976  +
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case2_malformed_request() {
 8733   5977   
        {
 8734   5978   
            #[allow(unused_mut)]
 8735   5979   
            let mut http_request = http::Request::builder()
 8736         -
                .uri("/MalformedBlob")
        5980  +
                .uri("/MalformedTimestampQueryEpoch")
 8737   5981   
                .method("POST")
 8738         -
                .header("content-type", "application/json")
 8739         -
                .body(::aws_smithy_http_server::body::Body::from(
 8740         -
                    ::bytes::Bytes::from_static("{ \"blob\" : true }".as_bytes()),
 8741         -
                ))
        5982  +
                .body(::aws_smithy_http_server::body::Body::empty())
        5983  +
                .unwrap();
        5984  +
            *http_request.uri_mut() =
        5985  +
                "/MalformedTimestampQueryEpoch?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
        5986  +
                    .parse()
 8742   5987   
                    .unwrap();
 8743   5988   
            #[allow(unused_mut)]
 8744   5989   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8745   5990   
            let config = crate::service::RestJsonConfig::builder().build();
 8746   5991   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8747         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        5992  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8748   5993   
                                let sender = sender.clone();
 8749   5994   
                                async move {
 8750         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        5995  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8751   5996   
                                    sender.send(()).await.expect("receiver dropped early");
 8752   5997   
                                    result
 8753   5998   
                                }
 8754   5999   
                            })
 8755   6000   
                            .build_unchecked();
 8756   6001   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8757   6002   
                .await
 8758   6003   
                .expect("unable to make an HTTP request");
 8759   6004   
            ::pretty_assertions::assert_eq!(
 8760   6005   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8761   6006   
                http_response.status()
 8762   6007   
            );
 8763   6008   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8764   6009   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8765   6010   
                http_response.headers(),
 8766   6011   
                expected_headers,
 8767   6012   
            ));
 8768   6013   
        }
 8769   6014   
    }
 8770         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8771         -
    /// all, the response should be a 400 SerializationException.
 8772         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case7
        6015  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        6016  +
    /// 400 SerializationException
        6017  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case0
 8773   6018   
    #[::tokio::test]
 8774         -
    async fn rest_json_body_malformed_blob_invalid_base64_case7_malformed_request() {
        6019  +
    #[::tracing_test::traced_test]
        6020  +
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case0_malformed_request() {
 8775   6021   
        {
 8776   6022   
            #[allow(unused_mut)]
 8777   6023   
            let mut http_request = http::Request::builder()
 8778         -
                .uri("/MalformedBlob")
        6024  +
                .uri("/MalformedTimestampQueryEpoch")
 8779   6025   
                .method("POST")
 8780         -
                .header("content-type", "application/json")
 8781         -
                .body(::aws_smithy_http_server::body::Body::from(
 8782         -
                    ::bytes::Bytes::from_static("{ \"blob\" : [][] }".as_bytes()),
 8783         -
                ))
        6026  +
                .body(::aws_smithy_http_server::body::Body::empty())
 8784   6027   
                .unwrap();
        6028  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
 8785   6029   
            #[allow(unused_mut)]
 8786   6030   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8787   6031   
            let config = crate::service::RestJsonConfig::builder().build();
 8788   6032   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8789         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        6033  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8790   6034   
                                let sender = sender.clone();
 8791   6035   
                                async move {
 8792         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        6036  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8793   6037   
                                    sender.send(()).await.expect("receiver dropped early");
 8794   6038   
                                    result
 8795   6039   
                                }
 8796   6040   
                            })
 8797   6041   
                            .build_unchecked();
 8798   6042   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8799   6043   
                .await
 8800   6044   
                .expect("unable to make an HTTP request");
 8801   6045   
            ::pretty_assertions::assert_eq!(
 8802   6046   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8803   6047   
                http_response.status()
 8804   6048   
            );
 8805   6049   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8806   6050   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8807   6051   
                http_response.headers(),
 8808   6052   
                expected_headers,
 8809   6053   
            ));
 8810   6054   
        }
 8811   6055   
    }
 8812         -
    /// When a blob member is not properly base64 encoded, or not encoded at
 8813         -
    /// all, the response should be a 400 SerializationException.
 8814         -
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case8
        6056  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        6057  +
    /// 400 SerializationException
        6058  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case1
 8815   6059   
    #[::tokio::test]
 8816         -
    async fn rest_json_body_malformed_blob_invalid_base64_case8_malformed_request() {
        6060  +
    #[::tracing_test::traced_test]
        6061  +
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case1_malformed_request() {
 8817   6062   
        {
 8818   6063   
            #[allow(unused_mut)]
 8819   6064   
            let mut http_request = http::Request::builder()
 8820         -
                .uri("/MalformedBlob")
        6065  +
                .uri("/MalformedTimestampQueryEpoch")
 8821   6066   
                .method("POST")
 8822         -
                .header("content-type", "application/json")
 8823         -
                .body(::aws_smithy_http_server::body::Body::from(
 8824         -
                    ::bytes::Bytes::from_static("{ \"blob\" : -_== }".as_bytes()),
 8825         -
                ))
        6067  +
                .body(::aws_smithy_http_server::body::Body::empty())
 8826   6068   
                .unwrap();
        6069  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
 8827   6070   
            #[allow(unused_mut)]
 8828   6071   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8829   6072   
            let config = crate::service::RestJsonConfig::builder().build();
 8830   6073   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8831         -
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
        6074  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8832   6075   
                                let sender = sender.clone();
 8833   6076   
                                async move {
 8834         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
        6077  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8835   6078   
                                    sender.send(()).await.expect("receiver dropped early");
 8836   6079   
                                    result
 8837   6080   
                                }
 8838   6081   
                            })
 8839   6082   
                            .build_unchecked();
 8840   6083   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8841   6084   
                .await
 8842   6085   
                .expect("unable to make an HTTP request");
 8843   6086   
            ::pretty_assertions::assert_eq!(
 8844   6087   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8845   6088   
                http_response.status()
 8846   6089   
            );
 8847   6090   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8848   6091   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8849   6092   
                http_response.headers(),
 8850   6093   
                expected_headers,
 8851   6094   
            ));
 8852   6095   
        }
 8853   6096   
    }
 8854         -
}
 8855         -
#[cfg(test)]
 8856         -
#[allow(unreachable_code, unused_variables)]
 8857         -
mod server_malformed_boolean_test {
 8858         -
    /// Attempted string coercion should result in SerializationException
 8859         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case0
        6097  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6098  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case0
 8860   6099   
    #[::tokio::test]
 8861         -
    async fn rest_json_body_boolean_string_coercion_case0_malformed_request() {
        6100  +
    #[::tracing_test::traced_test]
        6101  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
 8862   6102   
        {
 8863   6103   
            #[allow(unused_mut)]
 8864   6104   
            let mut http_request = http::Request::builder()
 8865         -
                .uri("/MalformedBoolean/true")
        6105  +
                .uri("/MalformedTimestampQueryEpoch")
 8866   6106   
                .method("POST")
 8867         -
                .header("content-type", "application/json")
 8868         -
                .body(::aws_smithy_http_server::body::Body::from(
 8869         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"true\" }".as_bytes()),
 8870         -
                ))
        6107  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6108  +
                .unwrap();
        6109  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=true"
        6110  +
                .parse()
 8871   6111   
                .unwrap();
 8872   6112   
            #[allow(unused_mut)]
 8873   6113   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8874   6114   
            let config = crate::service::RestJsonConfig::builder().build();
 8875   6115   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8876         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6116  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8877   6117   
                                let sender = sender.clone();
 8878   6118   
                                async move {
 8879         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6119  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8880   6120   
                                    sender.send(()).await.expect("receiver dropped early");
 8881   6121   
                                    result
 8882   6122   
                                }
 8883   6123   
                            })
 8884   6124   
                            .build_unchecked();
 8885   6125   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8886   6126   
                .await
 8887   6127   
                .expect("unable to make an HTTP request");
 8888   6128   
            ::pretty_assertions::assert_eq!(
 8889   6129   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8890   6130   
                http_response.status()
 8891   6131   
            );
 8892   6132   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8893   6133   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8894   6134   
                http_response.headers(),
 8895   6135   
                expected_headers,
 8896   6136   
            ));
 8897   6137   
        }
 8898   6138   
    }
 8899         -
    /// Attempted string coercion should result in SerializationException
 8900         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case1
        6139  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6140  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case1
 8901   6141   
    #[::tokio::test]
 8902         -
    async fn rest_json_body_boolean_string_coercion_case1_malformed_request() {
        6142  +
    #[::tracing_test::traced_test]
        6143  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
 8903   6144   
        {
 8904   6145   
            #[allow(unused_mut)]
 8905   6146   
            let mut http_request = http::Request::builder()
 8906         -
                .uri("/MalformedBoolean/true")
        6147  +
                .uri("/MalformedTimestampQueryEpoch")
 8907   6148   
                .method("POST")
 8908         -
                .header("content-type", "application/json")
 8909         -
                .body(::aws_smithy_http_server::body::Body::from(
 8910         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"True\" }".as_bytes()),
 8911         -
                ))
        6149  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6150  +
                .unwrap();
        6151  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081ABC"
        6152  +
                .parse()
 8912   6153   
                .unwrap();
 8913   6154   
            #[allow(unused_mut)]
 8914   6155   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8915   6156   
            let config = crate::service::RestJsonConfig::builder().build();
 8916   6157   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8917         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6158  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8918   6159   
                                let sender = sender.clone();
 8919   6160   
                                async move {
 8920         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6161  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8921   6162   
                                    sender.send(()).await.expect("receiver dropped early");
 8922   6163   
                                    result
 8923   6164   
                                }
 8924   6165   
                            })
 8925   6166   
                            .build_unchecked();
 8926   6167   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8927   6168   
                .await
 8928   6169   
                .expect("unable to make an HTTP request");
 8929   6170   
            ::pretty_assertions::assert_eq!(
 8930   6171   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8931   6172   
                http_response.status()
 8932   6173   
            );
 8933   6174   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8934   6175   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8935   6176   
                http_response.headers(),
 8936   6177   
                expected_headers,
 8937   6178   
            ));
 8938   6179   
        }
 8939   6180   
    }
 8940         -
    /// Attempted string coercion should result in SerializationException
 8941         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case2
        6181  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6182  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case2
 8942   6183   
    #[::tokio::test]
 8943         -
    async fn rest_json_body_boolean_string_coercion_case2_malformed_request() {
        6184  +
    #[::tracing_test::traced_test]
        6185  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
 8944   6186   
        {
 8945   6187   
            #[allow(unused_mut)]
 8946   6188   
            let mut http_request = http::Request::builder()
 8947         -
                .uri("/MalformedBoolean/true")
        6189  +
                .uri("/MalformedTimestampQueryEpoch")
 8948   6190   
                .method("POST")
 8949         -
                .header("content-type", "application/json")
 8950         -
                .body(::aws_smithy_http_server::body::Body::from(
 8951         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"TRUE\" }".as_bytes()),
 8952         -
                ))
        6191  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6192  +
                .unwrap();
        6193  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=0x42"
        6194  +
                .parse()
 8953   6195   
                .unwrap();
 8954   6196   
            #[allow(unused_mut)]
 8955   6197   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8956   6198   
            let config = crate::service::RestJsonConfig::builder().build();
 8957   6199   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8958         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6200  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 8959   6201   
                                let sender = sender.clone();
 8960   6202   
                                async move {
 8961         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6203  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 8962   6204   
                                    sender.send(()).await.expect("receiver dropped early");
 8963   6205   
                                    result
 8964   6206   
                                }
 8965   6207   
                            })
 8966   6208   
                            .build_unchecked();
 8967   6209   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 8968   6210   
                .await
 8969   6211   
                .expect("unable to make an HTTP request");
 8970   6212   
            ::pretty_assertions::assert_eq!(
 8971   6213   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 8972   6214   
                http_response.status()
 8973   6215   
            );
 8974   6216   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 8975   6217   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 8976   6218   
                http_response.headers(),
 8977   6219   
                expected_headers,
 8978   6220   
            ));
 8979   6221   
        }
 8980   6222   
    }
 8981         -
    /// Attempted string coercion should result in SerializationException
 8982         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case3
        6223  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6224  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case3
 8983   6225   
    #[::tokio::test]
 8984         -
    async fn rest_json_body_boolean_string_coercion_case3_malformed_request() {
        6226  +
    #[::tracing_test::traced_test]
        6227  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
 8985   6228   
        {
 8986   6229   
            #[allow(unused_mut)]
 8987   6230   
            let mut http_request = http::Request::builder()
 8988         -
                .uri("/MalformedBoolean/true")
        6231  +
                .uri("/MalformedTimestampQueryEpoch")
 8989   6232   
                .method("POST")
 8990         -
                .header("content-type", "application/json")
 8991         -
                .body(::aws_smithy_http_server::body::Body::from(
 8992         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"y\" }".as_bytes()),
 8993         -
                ))
        6233  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6234  +
                .unwrap();
        6235  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081.123.456"
        6236  +
                .parse()
 8994   6237   
                .unwrap();
 8995   6238   
            #[allow(unused_mut)]
 8996   6239   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 8997   6240   
            let config = crate::service::RestJsonConfig::builder().build();
 8998   6241   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 8999         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6242  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 9000   6243   
                                let sender = sender.clone();
 9001   6244   
                                async move {
 9002         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6245  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 9003   6246   
                                    sender.send(()).await.expect("receiver dropped early");
 9004   6247   
                                    result
 9005   6248   
                                }
 9006   6249   
                            })
 9007   6250   
                            .build_unchecked();
 9008   6251   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9009   6252   
                .await
 9010   6253   
                .expect("unable to make an HTTP request");
 9011   6254   
            ::pretty_assertions::assert_eq!(
 9012   6255   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9013   6256   
                http_response.status()
 9014   6257   
            );
 9015   6258   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9016   6259   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9017   6260   
                http_response.headers(),
 9018   6261   
                expected_headers,
 9019   6262   
            ));
 9020   6263   
        }
 9021   6264   
    }
 9022         -
    /// Attempted string coercion should result in SerializationException
 9023         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case4
        6265  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6266  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case4
 9024   6267   
    #[::tokio::test]
 9025         -
    async fn rest_json_body_boolean_string_coercion_case4_malformed_request() {
        6268  +
    #[::tracing_test::traced_test]
        6269  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
 9026   6270   
        {
 9027   6271   
            #[allow(unused_mut)]
 9028   6272   
            let mut http_request = http::Request::builder()
 9029         -
                .uri("/MalformedBoolean/true")
        6273  +
                .uri("/MalformedTimestampQueryEpoch")
 9030   6274   
                .method("POST")
 9031         -
                .header("content-type", "application/json")
 9032         -
                .body(::aws_smithy_http_server::body::Body::from(
 9033         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Y\" }".as_bytes()),
 9034         -
                ))
        6275  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6276  +
                .unwrap();
        6277  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Infinity"
        6278  +
                .parse()
 9035   6279   
                .unwrap();
 9036   6280   
            #[allow(unused_mut)]
 9037   6281   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9038   6282   
            let config = crate::service::RestJsonConfig::builder().build();
 9039   6283   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9040         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6284  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 9041   6285   
                                let sender = sender.clone();
 9042   6286   
                                async move {
 9043         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6287  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 9044   6288   
                                    sender.send(()).await.expect("receiver dropped early");
 9045   6289   
                                    result
 9046   6290   
                                }
 9047   6291   
                            })
 9048   6292   
                            .build_unchecked();
 9049   6293   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9050   6294   
                .await
 9051   6295   
                .expect("unable to make an HTTP request");
 9052   6296   
            ::pretty_assertions::assert_eq!(
 9053   6297   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9054   6298   
                http_response.status()
 9055   6299   
            );
 9056   6300   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9057   6301   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9058   6302   
                http_response.headers(),
 9059   6303   
                expected_headers,
 9060   6304   
            ));
 9061   6305   
        }
 9062   6306   
    }
 9063         -
    /// Attempted string coercion should result in SerializationException
 9064         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case5
        6307  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6308  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case5
 9065   6309   
    #[::tokio::test]
 9066         -
    async fn rest_json_body_boolean_string_coercion_case5_malformed_request() {
        6310  +
    #[::tracing_test::traced_test]
        6311  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
 9067   6312   
        {
 9068   6313   
            #[allow(unused_mut)]
 9069   6314   
            let mut http_request = http::Request::builder()
 9070         -
                .uri("/MalformedBoolean/true")
        6315  +
                .uri("/MalformedTimestampQueryEpoch")
 9071   6316   
                .method("POST")
 9072         -
                .header("content-type", "application/json")
 9073         -
                .body(::aws_smithy_http_server::body::Body::from(
 9074         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"yes\" }".as_bytes()),
 9075         -
                ))
        6317  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6318  +
                .unwrap();
        6319  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=-Infinity"
        6320  +
                .parse()
 9076   6321   
                .unwrap();
 9077   6322   
            #[allow(unused_mut)]
 9078   6323   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9079   6324   
            let config = crate::service::RestJsonConfig::builder().build();
 9080   6325   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9081         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6326  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 9082   6327   
                                let sender = sender.clone();
 9083   6328   
                                async move {
 9084         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6329  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 9085   6330   
                                    sender.send(()).await.expect("receiver dropped early");
 9086   6331   
                                    result
 9087   6332   
                                }
 9088   6333   
                            })
 9089   6334   
                            .build_unchecked();
 9090   6335   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9091   6336   
                .await
 9092   6337   
                .expect("unable to make an HTTP request");
 9093   6338   
            ::pretty_assertions::assert_eq!(
 9094   6339   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9095   6340   
                http_response.status()
 9096   6341   
            );
 9097   6342   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9098   6343   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9099   6344   
                http_response.headers(),
 9100   6345   
                expected_headers,
 9101   6346   
            ));
 9102   6347   
        }
 9103   6348   
    }
 9104         -
    /// Attempted string coercion should result in SerializationException
 9105         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case6
        6349  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        6350  +
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case6
 9106   6351   
    #[::tokio::test]
 9107         -
    async fn rest_json_body_boolean_string_coercion_case6_malformed_request() {
        6352  +
    #[::tracing_test::traced_test]
        6353  +
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
 9108   6354   
        {
 9109   6355   
            #[allow(unused_mut)]
 9110   6356   
            let mut http_request = http::Request::builder()
 9111         -
                .uri("/MalformedBoolean/true")
        6357  +
                .uri("/MalformedTimestampQueryEpoch")
 9112   6358   
                .method("POST")
 9113         -
                .header("content-type", "application/json")
 9114         -
                .body(::aws_smithy_http_server::body::Body::from(
 9115         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Yes\" }".as_bytes()),
 9116         -
                ))
        6359  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6360  +
                .unwrap();
        6361  +
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=NaN"
        6362  +
                .parse()
 9117   6363   
                .unwrap();
 9118   6364   
            #[allow(unused_mut)]
 9119   6365   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9120   6366   
            let config = crate::service::RestJsonConfig::builder().build();
 9121   6367   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9122         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6368  +
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
 9123   6369   
                                let sender = sender.clone();
 9124   6370   
                                async move {
 9125         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6371  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
 9126   6372   
                                    sender.send(()).await.expect("receiver dropped early");
 9127   6373   
                                    result
 9128   6374   
                                }
 9129   6375   
                            })
 9130   6376   
                            .build_unchecked();
 9131   6377   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9132   6378   
                .await
 9133   6379   
                .expect("unable to make an HTTP request");
 9134   6380   
            ::pretty_assertions::assert_eq!(
 9135   6381   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9136   6382   
                http_response.status()
 9137   6383   
            );
 9138   6384   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9139   6385   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9140   6386   
                http_response.headers(),
 9141   6387   
                expected_headers,
 9142   6388   
            ));
 9143   6389   
        }
 9144   6390   
    }
 9145         -
    /// Attempted string coercion should result in SerializationException
 9146         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case7
        6391  +
}
        6392  +
        6393  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
        6394  +
::pin_project_lite::pin_project! {
        6395  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        6396  +
    /// [`MalformedTimestampQueryHttpDateInput`](crate::input::MalformedTimestampQueryHttpDateInput) using modelled bindings.
        6397  +
    pub struct MalformedTimestampQueryHttpDateInputFuture {
        6398  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampQueryHttpDateInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        6399  +
    }
        6400  +
}
        6401  +
        6402  +
impl std::future::Future for MalformedTimestampQueryHttpDateInputFuture {
        6403  +
    type Output = Result<
        6404  +
        crate::input::MalformedTimestampQueryHttpDateInput,
        6405  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        6406  +
    >;
        6407  +
        6408  +
    fn poll(
        6409  +
        self: std::pin::Pin<&mut Self>,
        6410  +
        cx: &mut std::task::Context<'_>,
        6411  +
    ) -> std::task::Poll<Self::Output> {
        6412  +
        let this = self.project();
        6413  +
        this.inner.as_mut().poll(cx)
        6414  +
    }
        6415  +
}
        6416  +
        6417  +
impl<B>
        6418  +
    ::aws_smithy_http_server::request::FromRequest<
        6419  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        6420  +
        B,
        6421  +
    > for crate::input::MalformedTimestampQueryHttpDateInput
        6422  +
where
        6423  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        6424  +
    B: 'static,
        6425  +
        6426  +
    B::Data: Send,
        6427  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        6428  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        6429  +
{
        6430  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        6431  +
    type Future = MalformedTimestampQueryHttpDateInputFuture;
        6432  +
        6433  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        6434  +
        let fut = async move {
        6435  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        6436  +
                request.headers(),
        6437  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYHTTPDATE,
        6438  +
            ) {
        6439  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        6440  +
            }
        6441  +
            crate::protocol_serde::shape_malformed_timestamp_query_http_date::de_malformed_timestamp_query_http_date_http_request(request)
        6442  +
                            .await
        6443  +
                            .map_err(Into::into)
        6444  +
        };
        6445  +
        use ::futures_util::future::TryFutureExt;
        6446  +
        let fut = fut.map_err(
        6447  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        6448  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        6449  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        6450  +
                    e,
        6451  +
                )
        6452  +
            },
        6453  +
        );
        6454  +
        MalformedTimestampQueryHttpDateInputFuture {
        6455  +
            inner: Box::pin(fut),
        6456  +
        }
        6457  +
    }
        6458  +
}
        6459  +
impl
        6460  +
    ::aws_smithy_http_server::response::IntoResponse<
        6461  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        6462  +
    > for crate::output::MalformedTimestampQueryHttpDateOutput
        6463  +
{
        6464  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        6465  +
        match crate::protocol_serde::shape_malformed_timestamp_query_http_date::ser_malformed_timestamp_query_http_date_http_response(self) {
        6466  +
                        Ok(response) => response,
        6467  +
                        Err(e) => {
        6468  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        6469  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        6470  +
                        }
        6471  +
                    }
        6472  +
    }
        6473  +
}
        6474  +
impl
        6475  +
    ::aws_smithy_http_server::response::IntoResponse<
        6476  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        6477  +
    > for crate::error::MalformedTimestampQueryHttpDateError
        6478  +
{
        6479  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        6480  +
        match crate::protocol_serde::shape_malformed_timestamp_query_http_date::ser_malformed_timestamp_query_http_date_http_error(&self) {
        6481  +
            Ok(mut response) => {
        6482  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        6483  +
                response
        6484  +
            },
        6485  +
            Err(e) => {
        6486  +
                ::tracing::error!(error = %e, "failed to serialize response");
        6487  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        6488  +
            }
        6489  +
        }
        6490  +
    }
        6491  +
}
        6492  +
        6493  +
#[allow(unreachable_code, unused_variables)]
        6494  +
#[cfg(test)]
        6495  +
mod malformed_timestamp_query_http_date_test {
        6496  +
        6497  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        6498  +
    /// 400 SerializationException
        6499  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case0
 9147   6500   
    #[::tokio::test]
 9148         -
    async fn rest_json_body_boolean_string_coercion_case7_malformed_request() {
        6501  +
    #[::tracing_test::traced_test]
        6502  +
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case0_malformed_request() {
 9149   6503   
        {
 9150   6504   
            #[allow(unused_mut)]
 9151   6505   
            let mut http_request = http::Request::builder()
 9152         -
                .uri("/MalformedBoolean/true")
        6506  +
                .uri("/MalformedTimestampQueryHttpDate")
 9153   6507   
                .method("POST")
 9154         -
                .header("content-type", "application/json")
 9155         -
                .body(::aws_smithy_http_server::body::Body::from(
 9156         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"YES\" }".as_bytes()),
 9157         -
                ))
        6508  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6509  +
                .unwrap();
        6510  +
            *http_request.uri_mut() =
        6511  +
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50.52Z"
        6512  +
                    .parse()
 9158   6513   
                    .unwrap();
 9159   6514   
            #[allow(unused_mut)]
 9160   6515   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9161   6516   
            let config = crate::service::RestJsonConfig::builder().build();
 9162   6517   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9163         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6518  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
 9164   6519   
                                let sender = sender.clone();
 9165   6520   
                                async move {
 9166         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6521  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
 9167   6522   
                                    sender.send(()).await.expect("receiver dropped early");
 9168   6523   
                                    result
 9169   6524   
                                }
 9170   6525   
                            })
 9171   6526   
                            .build_unchecked();
 9172   6527   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9173   6528   
                .await
 9174   6529   
                .expect("unable to make an HTTP request");
 9175   6530   
            ::pretty_assertions::assert_eq!(
 9176   6531   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9177   6532   
                http_response.status()
 9178   6533   
            );
 9179   6534   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9180   6535   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9181   6536   
                http_response.headers(),
 9182   6537   
                expected_headers,
 9183   6538   
            ));
 9184   6539   
        }
 9185   6540   
    }
 9186         -
    /// Attempted string coercion should result in SerializationException
 9187         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case8
        6541  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        6542  +
    /// 400 SerializationException
        6543  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case1
 9188   6544   
    #[::tokio::test]
 9189         -
    async fn rest_json_body_boolean_string_coercion_case8_malformed_request() {
        6545  +
    #[::tracing_test::traced_test]
        6546  +
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case1_malformed_request() {
 9190   6547   
        {
 9191   6548   
            #[allow(unused_mut)]
 9192   6549   
            let mut http_request = http::Request::builder()
 9193         -
                .uri("/MalformedBoolean/true")
        6550  +
                .uri("/MalformedTimestampQueryHttpDate")
 9194   6551   
                .method("POST")
 9195         -
                .header("content-type", "application/json")
 9196         -
                .body(::aws_smithy_http_server::body::Body::from(
 9197         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"1\" }".as_bytes()),
 9198         -
                ))
        6552  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6553  +
                .unwrap();
        6554  +
            *http_request.uri_mut() =
        6555  +
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50Z"
        6556  +
                    .parse()
 9199   6557   
                    .unwrap();
 9200   6558   
            #[allow(unused_mut)]
 9201   6559   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9202   6560   
            let config = crate::service::RestJsonConfig::builder().build();
 9203   6561   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9204         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6562  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
 9205   6563   
                                let sender = sender.clone();
 9206   6564   
                                async move {
 9207         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6565  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
 9208   6566   
                                    sender.send(()).await.expect("receiver dropped early");
 9209   6567   
                                    result
 9210   6568   
                                }
 9211   6569   
                            })
 9212   6570   
                            .build_unchecked();
 9213   6571   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9214   6572   
                .await
 9215   6573   
                .expect("unable to make an HTTP request");
 9216   6574   
            ::pretty_assertions::assert_eq!(
 9217   6575   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9218   6576   
                http_response.status()
 9219   6577   
            );
 9220   6578   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9221   6579   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9222   6580   
                http_response.headers(),
 9223   6581   
                expected_headers,
 9224   6582   
            ));
 9225   6583   
        }
 9226   6584   
    }
 9227         -
    /// Attempted string coercion should result in SerializationException
 9228         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case9
        6585  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        6586  +
    /// 400 SerializationException
        6587  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case2
 9229   6588   
    #[::tokio::test]
 9230         -
    async fn rest_json_body_boolean_string_coercion_case9_malformed_request() {
        6589  +
    #[::tracing_test::traced_test]
        6590  +
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case2_malformed_request() {
 9231   6591   
        {
 9232   6592   
            #[allow(unused_mut)]
 9233   6593   
            let mut http_request = http::Request::builder()
 9234         -
                .uri("/MalformedBoolean/true")
        6594  +
                .uri("/MalformedTimestampQueryHttpDate")
 9235   6595   
                .method("POST")
 9236         -
                .header("content-type", "application/json")
 9237         -
                .body(::aws_smithy_http_server::body::Body::from(
 9238         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"on\" }".as_bytes()),
 9239         -
                ))
        6596  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6597  +
                .unwrap();
        6598  +
            *http_request.uri_mut() =
        6599  +
                "/MalformedTimestampQueryHttpDate?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
        6600  +
                    .parse()
 9240   6601   
                    .unwrap();
 9241   6602   
            #[allow(unused_mut)]
 9242   6603   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9243   6604   
            let config = crate::service::RestJsonConfig::builder().build();
 9244   6605   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9245         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6606  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
 9246   6607   
                                let sender = sender.clone();
 9247   6608   
                                async move {
 9248         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6609  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
 9249   6610   
                                    sender.send(()).await.expect("receiver dropped early");
 9250   6611   
                                    result
 9251   6612   
                                }
 9252   6613   
                            })
 9253   6614   
                            .build_unchecked();
 9254   6615   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9255   6616   
                .await
 9256   6617   
                .expect("unable to make an HTTP request");
 9257   6618   
            ::pretty_assertions::assert_eq!(
 9258   6619   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9259   6620   
                http_response.status()
 9260   6621   
            );
 9261   6622   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9262   6623   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9263   6624   
                http_response.headers(),
 9264   6625   
                expected_headers,
 9265   6626   
            ));
 9266   6627   
        }
 9267   6628   
    }
 9268         -
    /// Attempted string coercion should result in SerializationException
 9269         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case10
        6629  +
    /// When the format is http-date, epoch second timestamps are rejected with a
        6630  +
    /// 400 SerializationException
        6631  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case0
 9270   6632   
    #[::tokio::test]
 9271         -
    async fn rest_json_body_boolean_string_coercion_case10_malformed_request() {
        6633  +
    #[::tracing_test::traced_test]
        6634  +
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
 9272   6635   
        {
 9273   6636   
            #[allow(unused_mut)]
 9274   6637   
            let mut http_request = http::Request::builder()
 9275         -
                .uri("/MalformedBoolean/true")
        6638  +
                .uri("/MalformedTimestampQueryHttpDate")
 9276   6639   
                .method("POST")
 9277         -
                .header("content-type", "application/json")
 9278         -
                .body(::aws_smithy_http_server::body::Body::from(
 9279         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"On\" }".as_bytes()),
 9280         -
                ))
        6640  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6641  +
                .unwrap();
        6642  +
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081.1234"
        6643  +
                .parse()
 9281   6644   
                .unwrap();
 9282   6645   
            #[allow(unused_mut)]
 9283   6646   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9284   6647   
            let config = crate::service::RestJsonConfig::builder().build();
 9285   6648   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9286         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6649  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
 9287   6650   
                                let sender = sender.clone();
 9288   6651   
                                async move {
 9289         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6652  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
 9290   6653   
                                    sender.send(()).await.expect("receiver dropped early");
 9291   6654   
                                    result
 9292   6655   
                                }
 9293   6656   
                            })
 9294   6657   
                            .build_unchecked();
 9295   6658   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9296   6659   
                .await
 9297   6660   
                .expect("unable to make an HTTP request");
 9298   6661   
            ::pretty_assertions::assert_eq!(
 9299   6662   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9300   6663   
                http_response.status()
 9301   6664   
            );
 9302   6665   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9303   6666   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9304   6667   
                http_response.headers(),
 9305   6668   
                expected_headers,
 9306   6669   
            ));
 9307   6670   
        }
 9308   6671   
    }
 9309         -
    /// Attempted string coercion should result in SerializationException
 9310         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case11
        6672  +
    /// When the format is http-date, epoch second timestamps are rejected with a
        6673  +
    /// 400 SerializationException
        6674  +
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case1
 9311   6675   
    #[::tokio::test]
 9312         -
    async fn rest_json_body_boolean_string_coercion_case11_malformed_request() {
        6676  +
    #[::tracing_test::traced_test]
        6677  +
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
 9313   6678   
        {
 9314   6679   
            #[allow(unused_mut)]
 9315   6680   
            let mut http_request = http::Request::builder()
 9316         -
                .uri("/MalformedBoolean/true")
        6681  +
                .uri("/MalformedTimestampQueryHttpDate")
 9317   6682   
                .method("POST")
 9318         -
                .header("content-type", "application/json")
 9319         -
                .body(::aws_smithy_http_server::body::Body::from(
 9320         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"ON\" }".as_bytes()),
 9321         -
                ))
        6683  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6684  +
                .unwrap();
        6685  +
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081"
        6686  +
                .parse()
 9322   6687   
                .unwrap();
 9323   6688   
            #[allow(unused_mut)]
 9324   6689   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9325   6690   
            let config = crate::service::RestJsonConfig::builder().build();
 9326   6691   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9327         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6692  +
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
 9328   6693   
                                let sender = sender.clone();
 9329   6694   
                                async move {
 9330         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6695  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
 9331   6696   
                                    sender.send(()).await.expect("receiver dropped early");
 9332   6697   
                                    result
 9333   6698   
                                }
 9334   6699   
                            })
 9335   6700   
                            .build_unchecked();
 9336   6701   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9337   6702   
                .await
 9338   6703   
                .expect("unable to make an HTTP request");
 9339   6704   
            ::pretty_assertions::assert_eq!(
 9340   6705   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9341   6706   
                http_response.status()
 9342   6707   
            );
 9343   6708   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9344   6709   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9345   6710   
                http_response.headers(),
 9346   6711   
                expected_headers,
 9347   6712   
            ));
 9348   6713   
        }
 9349   6714   
    }
 9350         -
    /// Attempted string coercion should result in SerializationException
 9351         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case12
        6715  +
}
        6716  +
        6717  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
        6718  +
::pin_project_lite::pin_project! {
        6719  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        6720  +
    /// [`MalformedTimestampQueryDefaultInput`](crate::input::MalformedTimestampQueryDefaultInput) using modelled bindings.
        6721  +
    pub struct MalformedTimestampQueryDefaultInputFuture {
        6722  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampQueryDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        6723  +
    }
        6724  +
}
        6725  +
        6726  +
impl std::future::Future for MalformedTimestampQueryDefaultInputFuture {
        6727  +
    type Output = Result<
        6728  +
        crate::input::MalformedTimestampQueryDefaultInput,
        6729  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        6730  +
    >;
        6731  +
        6732  +
    fn poll(
        6733  +
        self: std::pin::Pin<&mut Self>,
        6734  +
        cx: &mut std::task::Context<'_>,
        6735  +
    ) -> std::task::Poll<Self::Output> {
        6736  +
        let this = self.project();
        6737  +
        this.inner.as_mut().poll(cx)
        6738  +
    }
        6739  +
}
        6740  +
        6741  +
impl<B>
        6742  +
    ::aws_smithy_http_server::request::FromRequest<
        6743  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        6744  +
        B,
        6745  +
    > for crate::input::MalformedTimestampQueryDefaultInput
        6746  +
where
        6747  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        6748  +
    B: 'static,
        6749  +
        6750  +
    B::Data: Send,
        6751  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        6752  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        6753  +
{
        6754  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        6755  +
    type Future = MalformedTimestampQueryDefaultInputFuture;
        6756  +
        6757  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        6758  +
        let fut = async move {
        6759  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        6760  +
                request.headers(),
        6761  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYDEFAULT,
        6762  +
            ) {
        6763  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        6764  +
            }
        6765  +
            crate::protocol_serde::shape_malformed_timestamp_query_default::de_malformed_timestamp_query_default_http_request(request)
        6766  +
                            .await
        6767  +
                            .map_err(Into::into)
        6768  +
        };
        6769  +
        use ::futures_util::future::TryFutureExt;
        6770  +
        let fut = fut.map_err(
        6771  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        6772  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        6773  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        6774  +
                    e,
        6775  +
                )
        6776  +
            },
        6777  +
        );
        6778  +
        MalformedTimestampQueryDefaultInputFuture {
        6779  +
            inner: Box::pin(fut),
        6780  +
        }
        6781  +
    }
        6782  +
}
        6783  +
impl
        6784  +
    ::aws_smithy_http_server::response::IntoResponse<
        6785  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        6786  +
    > for crate::output::MalformedTimestampQueryDefaultOutput
        6787  +
{
        6788  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        6789  +
        match crate::protocol_serde::shape_malformed_timestamp_query_default::ser_malformed_timestamp_query_default_http_response(self) {
        6790  +
                        Ok(response) => response,
        6791  +
                        Err(e) => {
        6792  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        6793  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        6794  +
                        }
        6795  +
                    }
        6796  +
    }
        6797  +
}
        6798  +
impl
        6799  +
    ::aws_smithy_http_server::response::IntoResponse<
        6800  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        6801  +
    > for crate::error::MalformedTimestampQueryDefaultError
        6802  +
{
        6803  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        6804  +
        match crate::protocol_serde::shape_malformed_timestamp_query_default::ser_malformed_timestamp_query_default_http_error(&self) {
        6805  +
            Ok(mut response) => {
        6806  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        6807  +
                response
        6808  +
            },
        6809  +
            Err(e) => {
        6810  +
                ::tracing::error!(error = %e, "failed to serialize response");
        6811  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        6812  +
            }
        6813  +
        }
        6814  +
    }
        6815  +
}
        6816  +
        6817  +
#[allow(unreachable_code, unused_variables)]
        6818  +
#[cfg(test)]
        6819  +
mod malformed_timestamp_query_default_test {
        6820  +
        6821  +
    /// By default, IMF-fixdate timestamps are rejected with a
        6822  +
    /// 400 SerializationException
        6823  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsHttpDate_case0
 9352   6824   
    #[::tokio::test]
 9353         -
    async fn rest_json_body_boolean_string_coercion_case12_malformed_request() {
        6825  +
    #[::tracing_test::traced_test]
        6826  +
    async fn rest_json_query_timestamp_default_rejects_http_date_case0_malformed_request() {
 9354   6827   
        {
 9355   6828   
            #[allow(unused_mut)]
 9356   6829   
            let mut http_request = http::Request::builder()
 9357         -
                .uri("/MalformedBoolean/true")
        6830  +
                .uri("/MalformedTimestampQueryDefault")
 9358   6831   
                .method("POST")
 9359         -
                .header("content-type", "application/json")
 9360         -
                .body(::aws_smithy_http_server::body::Body::from(
 9361         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"false\" }".as_bytes()),
 9362         -
                ))
        6832  +
                .body(::aws_smithy_http_server::body::Body::empty())
 9363   6833   
                .unwrap();
        6834  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
 9364   6835   
            #[allow(unused_mut)]
 9365   6836   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9366   6837   
            let config = crate::service::RestJsonConfig::builder().build();
 9367   6838   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9368         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6839  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9369   6840   
                                let sender = sender.clone();
 9370   6841   
                                async move {
 9371         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6842  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9372   6843   
                                    sender.send(()).await.expect("receiver dropped early");
 9373   6844   
                                    result
 9374   6845   
                                }
 9375   6846   
                            })
 9376   6847   
                            .build_unchecked();
 9377   6848   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9378   6849   
                .await
 9379   6850   
                .expect("unable to make an HTTP request");
 9380   6851   
            ::pretty_assertions::assert_eq!(
 9381   6852   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9382   6853   
                http_response.status()
 9383   6854   
            );
 9384   6855   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9385   6856   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9386   6857   
                http_response.headers(),
 9387   6858   
                expected_headers,
 9388   6859   
            ));
 9389   6860   
        }
 9390   6861   
    }
 9391         -
    /// Attempted string coercion should result in SerializationException
 9392         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case13
        6862  +
    /// By default, IMF-fixdate timestamps are rejected with a
        6863  +
    /// 400 SerializationException
        6864  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsHttpDate_case1
 9393   6865   
    #[::tokio::test]
 9394         -
    async fn rest_json_body_boolean_string_coercion_case13_malformed_request() {
        6866  +
    #[::tracing_test::traced_test]
        6867  +
    async fn rest_json_query_timestamp_default_rejects_http_date_case1_malformed_request() {
 9395   6868   
        {
 9396   6869   
            #[allow(unused_mut)]
 9397   6870   
            let mut http_request = http::Request::builder()
 9398         -
                .uri("/MalformedBoolean/true")
        6871  +
                .uri("/MalformedTimestampQueryDefault")
 9399   6872   
                .method("POST")
 9400         -
                .header("content-type", "application/json")
 9401         -
                .body(::aws_smithy_http_server::body::Body::from(
 9402         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"False\" }".as_bytes()),
 9403         -
                ))
        6873  +
                .body(::aws_smithy_http_server::body::Body::empty())
 9404   6874   
                .unwrap();
        6875  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
 9405   6876   
            #[allow(unused_mut)]
 9406   6877   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9407   6878   
            let config = crate::service::RestJsonConfig::builder().build();
 9408   6879   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9409         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6880  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9410   6881   
                                let sender = sender.clone();
 9411   6882   
                                async move {
 9412         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6883  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9413   6884   
                                    sender.send(()).await.expect("receiver dropped early");
 9414   6885   
                                    result
 9415   6886   
                                }
 9416   6887   
                            })
 9417   6888   
                            .build_unchecked();
 9418   6889   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9419   6890   
                .await
 9420   6891   
                .expect("unable to make an HTTP request");
 9421   6892   
            ::pretty_assertions::assert_eq!(
 9422   6893   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9423   6894   
                http_response.status()
 9424   6895   
            );
 9425   6896   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9426   6897   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9427   6898   
                http_response.headers(),
 9428   6899   
                expected_headers,
 9429   6900   
            ));
 9430   6901   
        }
 9431   6902   
    }
 9432         -
    /// Attempted string coercion should result in SerializationException
 9433         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case14
        6903  +
    /// By default, epoch second timestamps are rejected with a
        6904  +
    /// 400 SerializationException
        6905  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case0
 9434   6906   
    #[::tokio::test]
 9435         -
    async fn rest_json_body_boolean_string_coercion_case14_malformed_request() {
        6907  +
    #[::tracing_test::traced_test]
        6908  +
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
 9436   6909   
        {
 9437   6910   
            #[allow(unused_mut)]
 9438   6911   
            let mut http_request = http::Request::builder()
 9439         -
                .uri("/MalformedBoolean/true")
        6912  +
                .uri("/MalformedTimestampQueryDefault")
 9440   6913   
                .method("POST")
 9441         -
                .header("content-type", "application/json")
 9442         -
                .body(::aws_smithy_http_server::body::Body::from(
 9443         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"FALSE\" }".as_bytes()),
 9444         -
                ))
        6914  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6915  +
                .unwrap();
        6916  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081.1234"
        6917  +
                .parse()
 9445   6918   
                .unwrap();
 9446   6919   
            #[allow(unused_mut)]
 9447   6920   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9448   6921   
            let config = crate::service::RestJsonConfig::builder().build();
 9449   6922   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9450         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6923  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9451   6924   
                                let sender = sender.clone();
 9452   6925   
                                async move {
 9453         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6926  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9454   6927   
                                    sender.send(()).await.expect("receiver dropped early");
 9455   6928   
                                    result
 9456   6929   
                                }
 9457   6930   
                            })
 9458   6931   
                            .build_unchecked();
 9459   6932   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9460   6933   
                .await
 9461   6934   
                .expect("unable to make an HTTP request");
 9462   6935   
            ::pretty_assertions::assert_eq!(
 9463   6936   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9464   6937   
                http_response.status()
 9465   6938   
            );
 9466   6939   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9467   6940   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9468   6941   
                http_response.headers(),
 9469   6942   
                expected_headers,
 9470   6943   
            ));
 9471   6944   
        }
 9472   6945   
    }
 9473         -
    /// Attempted string coercion should result in SerializationException
 9474         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case15
        6946  +
    /// By default, epoch second timestamps are rejected with a
        6947  +
    /// 400 SerializationException
        6948  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case1
 9475   6949   
    #[::tokio::test]
 9476         -
    async fn rest_json_body_boolean_string_coercion_case15_malformed_request() {
        6950  +
    #[::tracing_test::traced_test]
        6951  +
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
 9477   6952   
        {
 9478   6953   
            #[allow(unused_mut)]
 9479   6954   
            let mut http_request = http::Request::builder()
 9480         -
                .uri("/MalformedBoolean/true")
        6955  +
                .uri("/MalformedTimestampQueryDefault")
 9481   6956   
                .method("POST")
 9482         -
                .header("content-type", "application/json")
 9483         -
                .body(::aws_smithy_http_server::body::Body::from(
 9484         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"n\" }".as_bytes()),
 9485         -
                ))
        6957  +
                .body(::aws_smithy_http_server::body::Body::empty())
        6958  +
                .unwrap();
        6959  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081"
        6960  +
                .parse()
 9486   6961   
                .unwrap();
 9487   6962   
            #[allow(unused_mut)]
 9488   6963   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9489   6964   
            let config = crate::service::RestJsonConfig::builder().build();
 9490   6965   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9491         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        6966  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9492   6967   
                                let sender = sender.clone();
 9493   6968   
                                async move {
 9494         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        6969  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9495   6970   
                                    sender.send(()).await.expect("receiver dropped early");
 9496   6971   
                                    result
 9497   6972   
                                }
 9498   6973   
                            })
 9499   6974   
                            .build_unchecked();
 9500   6975   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9501   6976   
                .await
 9502   6977   
                .expect("unable to make an HTTP request");
 9503   6978   
            ::pretty_assertions::assert_eq!(
 9504   6979   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9505   6980   
                http_response.status()
 9506   6981   
            );
 9507   6982   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9508   6983   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9509   6984   
                http_response.headers(),
 9510   6985   
                expected_headers,
 9511   6986   
            ));
 9512   6987   
        }
 9513   6988   
    }
 9514         -
    /// Attempted string coercion should result in SerializationException
 9515         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case16
        6989  +
    /// UTC offsets must be rejected with a
        6990  +
    /// 400 SerializationException
        6991  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsUTCOffsets
 9516   6992   
    #[::tokio::test]
 9517         -
    async fn rest_json_body_boolean_string_coercion_case16_malformed_request() {
        6993  +
    #[::tracing_test::traced_test]
        6994  +
    async fn rest_json_query_timestamp_default_rejects_utc_offsets_malformed_request() {
 9518   6995   
        {
 9519   6996   
            #[allow(unused_mut)]
 9520   6997   
            let mut http_request = http::Request::builder()
 9521         -
                .uri("/MalformedBoolean/true")
        6998  +
                .uri("/MalformedTimestampQueryDefault")
 9522   6999   
                .method("POST")
 9523         -
                .header("content-type", "application/json")
 9524         -
                .body(::aws_smithy_http_server::body::Body::from(
 9525         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"N\" }".as_bytes()),
 9526         -
                ))
        7000  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7001  +
                .unwrap();
        7002  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=$value:L"
        7003  +
                .parse()
 9527   7004   
                .unwrap();
 9528   7005   
            #[allow(unused_mut)]
 9529   7006   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9530   7007   
            let config = crate::service::RestJsonConfig::builder().build();
 9531   7008   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9532         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7009  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9533   7010   
                                let sender = sender.clone();
 9534   7011   
                                async move {
 9535         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7012  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9536   7013   
                                    sender.send(()).await.expect("receiver dropped early");
 9537   7014   
                                    result
 9538   7015   
                                }
 9539   7016   
                            })
 9540   7017   
                            .build_unchecked();
 9541   7018   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9542   7019   
                .await
 9543   7020   
                .expect("unable to make an HTTP request");
 9544   7021   
            ::pretty_assertions::assert_eq!(
 9545   7022   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9546   7023   
                http_response.status()
 9547   7024   
            );
 9548   7025   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9549   7026   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9550   7027   
                http_response.headers(),
 9551   7028   
                expected_headers,
 9552   7029   
            ));
 9553   7030   
        }
 9554   7031   
    }
 9555         -
    /// Attempted string coercion should result in SerializationException
 9556         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case17
        7032  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7033  +
    /// are rejected with a 400 SerializationException
        7034  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case0
 9557   7035   
    #[::tokio::test]
 9558         -
    async fn rest_json_body_boolean_string_coercion_case17_malformed_request() {
        7036  +
    #[::tracing_test::traced_test]
        7037  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case0_malformed_request(
        7038  +
    ) {
 9559   7039   
        {
 9560   7040   
            #[allow(unused_mut)]
 9561   7041   
            let mut http_request = http::Request::builder()
 9562         -
                .uri("/MalformedBoolean/true")
        7042  +
                .uri("/MalformedTimestampQueryDefault")
 9563   7043   
                .method("POST")
 9564         -
                .header("content-type", "application/json")
 9565         -
                .body(::aws_smithy_http_server::body::Body::from(
 9566         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"no\" }".as_bytes()),
 9567         -
                ))
        7044  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7045  +
                .unwrap();
        7046  +
            *http_request.uri_mut() =
        7047  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00"
        7048  +
                    .parse()
 9568   7049   
                    .unwrap();
 9569   7050   
            #[allow(unused_mut)]
 9570   7051   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9571   7052   
            let config = crate::service::RestJsonConfig::builder().build();
 9572   7053   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9573         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7054  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9574   7055   
                                let sender = sender.clone();
 9575   7056   
                                async move {
 9576         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7057  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9577   7058   
                                    sender.send(()).await.expect("receiver dropped early");
 9578   7059   
                                    result
 9579   7060   
                                }
 9580   7061   
                            })
 9581   7062   
                            .build_unchecked();
 9582   7063   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9583   7064   
                .await
 9584   7065   
                .expect("unable to make an HTTP request");
 9585   7066   
            ::pretty_assertions::assert_eq!(
 9586   7067   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9587   7068   
                http_response.status()
 9588   7069   
            );
 9589   7070   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9590   7071   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9591   7072   
                http_response.headers(),
 9592   7073   
                expected_headers,
 9593   7074   
            ));
 9594   7075   
        }
 9595   7076   
    }
 9596         -
    /// Attempted string coercion should result in SerializationException
 9597         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case18
        7077  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7078  +
    /// are rejected with a 400 SerializationException
        7079  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case1
 9598   7080   
    #[::tokio::test]
 9599         -
    async fn rest_json_body_boolean_string_coercion_case18_malformed_request() {
        7081  +
    #[::tracing_test::traced_test]
        7082  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case1_malformed_request(
        7083  +
    ) {
 9600   7084   
        {
 9601   7085   
            #[allow(unused_mut)]
 9602   7086   
            let mut http_request = http::Request::builder()
 9603         -
                .uri("/MalformedBoolean/true")
        7087  +
                .uri("/MalformedTimestampQueryDefault")
 9604   7088   
                .method("POST")
 9605         -
                .header("content-type", "application/json")
 9606         -
                .body(::aws_smithy_http_server::body::Body::from(
 9607         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"No\" }".as_bytes()),
 9608         -
                ))
        7089  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7090  +
                .unwrap();
        7091  +
            *http_request.uri_mut() =
        7092  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00Z"
        7093  +
                    .parse()
 9609   7094   
                    .unwrap();
 9610   7095   
            #[allow(unused_mut)]
 9611   7096   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9612   7097   
            let config = crate::service::RestJsonConfig::builder().build();
 9613   7098   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9614         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7099  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9615   7100   
                                let sender = sender.clone();
 9616   7101   
                                async move {
 9617         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7102  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9618   7103   
                                    sender.send(()).await.expect("receiver dropped early");
 9619   7104   
                                    result
 9620   7105   
                                }
 9621   7106   
                            })
 9622   7107   
                            .build_unchecked();
 9623   7108   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9624   7109   
                .await
 9625   7110   
                .expect("unable to make an HTTP request");
 9626   7111   
            ::pretty_assertions::assert_eq!(
 9627   7112   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9628   7113   
                http_response.status()
 9629   7114   
            );
 9630   7115   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9631   7116   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9632   7117   
                http_response.headers(),
 9633   7118   
                expected_headers,
 9634   7119   
            ));
 9635   7120   
        }
 9636   7121   
    }
 9637         -
    /// Attempted string coercion should result in SerializationException
 9638         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case19
        7122  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7123  +
    /// are rejected with a 400 SerializationException
        7124  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case2
 9639   7125   
    #[::tokio::test]
 9640         -
    async fn rest_json_body_boolean_string_coercion_case19_malformed_request() {
        7126  +
    #[::tracing_test::traced_test]
        7127  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case2_malformed_request(
        7128  +
    ) {
 9641   7129   
        {
 9642   7130   
            #[allow(unused_mut)]
 9643   7131   
            let mut http_request = http::Request::builder()
 9644         -
                .uri("/MalformedBoolean/true")
        7132  +
                .uri("/MalformedTimestampQueryDefault")
 9645   7133   
                .method("POST")
 9646         -
                .header("content-type", "application/json")
 9647         -
                .body(::aws_smithy_http_server::body::Body::from(
 9648         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"NO\" }".as_bytes()),
 9649         -
                ))
        7134  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7135  +
                .unwrap();
        7136  +
            *http_request.uri_mut() =
        7137  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57"
        7138  +
                    .parse()
 9650   7139   
                    .unwrap();
 9651   7140   
            #[allow(unused_mut)]
 9652   7141   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9653   7142   
            let config = crate::service::RestJsonConfig::builder().build();
 9654   7143   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9655         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7144  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9656   7145   
                                let sender = sender.clone();
 9657   7146   
                                async move {
 9658         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7147  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9659   7148   
                                    sender.send(()).await.expect("receiver dropped early");
 9660   7149   
                                    result
 9661   7150   
                                }
 9662   7151   
                            })
 9663   7152   
                            .build_unchecked();
 9664   7153   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9665   7154   
                .await
 9666   7155   
                .expect("unable to make an HTTP request");
 9667   7156   
            ::pretty_assertions::assert_eq!(
 9668   7157   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9669   7158   
                http_response.status()
 9670   7159   
            );
 9671   7160   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9672   7161   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9673   7162   
                http_response.headers(),
 9674   7163   
                expected_headers,
 9675   7164   
            ));
 9676   7165   
        }
 9677   7166   
    }
 9678         -
    /// Attempted string coercion should result in SerializationException
 9679         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case20
        7167  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7168  +
    /// are rejected with a 400 SerializationException
        7169  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case3
 9680   7170   
    #[::tokio::test]
 9681         -
    async fn rest_json_body_boolean_string_coercion_case20_malformed_request() {
        7171  +
    #[::tracing_test::traced_test]
        7172  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case3_malformed_request(
        7173  +
    ) {
 9682   7174   
        {
 9683   7175   
            #[allow(unused_mut)]
 9684   7176   
            let mut http_request = http::Request::builder()
 9685         -
                .uri("/MalformedBoolean/true")
        7177  +
                .uri("/MalformedTimestampQueryDefault")
 9686   7178   
                .method("POST")
 9687         -
                .header("content-type", "application/json")
 9688         -
                .body(::aws_smithy_http_server::body::Body::from(
 9689         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"0\" }".as_bytes()),
 9690         -
                ))
        7179  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7180  +
                .unwrap();
        7181  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T163957"
        7182  +
                .parse()
 9691   7183   
                .unwrap();
 9692   7184   
            #[allow(unused_mut)]
 9693   7185   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9694   7186   
            let config = crate::service::RestJsonConfig::builder().build();
 9695   7187   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9696         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7188  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9697   7189   
                                let sender = sender.clone();
 9698   7190   
                                async move {
 9699         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7191  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9700   7192   
                                    sender.send(()).await.expect("receiver dropped early");
 9701   7193   
                                    result
 9702   7194   
                                }
 9703   7195   
                            })
 9704   7196   
                            .build_unchecked();
 9705   7197   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9706   7198   
                .await
 9707   7199   
                .expect("unable to make an HTTP request");
 9708   7200   
            ::pretty_assertions::assert_eq!(
 9709   7201   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9710   7202   
                http_response.status()
 9711   7203   
            );
 9712   7204   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9713   7205   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9714   7206   
                http_response.headers(),
 9715   7207   
                expected_headers,
 9716   7208   
            ));
 9717   7209   
        }
 9718   7210   
    }
 9719         -
    /// Attempted string coercion should result in SerializationException
 9720         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case21
        7211  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7212  +
    /// are rejected with a 400 SerializationException
        7213  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case4
 9721   7214   
    #[::tokio::test]
 9722         -
    async fn rest_json_body_boolean_string_coercion_case21_malformed_request() {
        7215  +
    #[::tracing_test::traced_test]
        7216  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case4_malformed_request(
        7217  +
    ) {
 9723   7218   
        {
 9724   7219   
            #[allow(unused_mut)]
 9725   7220   
            let mut http_request = http::Request::builder()
 9726         -
                .uri("/MalformedBoolean/true")
        7221  +
                .uri("/MalformedTimestampQueryDefault")
 9727   7222   
                .method("POST")
 9728         -
                .header("content-type", "application/json")
 9729         -
                .body(::aws_smithy_http_server::body::Body::from(
 9730         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"off\" }".as_bytes()),
 9731         -
                ))
        7223  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7224  +
                .unwrap();
        7225  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957Z"
        7226  +
                .parse()
 9732   7227   
                .unwrap();
 9733   7228   
            #[allow(unused_mut)]
 9734   7229   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9735   7230   
            let config = crate::service::RestJsonConfig::builder().build();
 9736   7231   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9737         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7232  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9738   7233   
                                let sender = sender.clone();
 9739   7234   
                                async move {
 9740         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7235  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9741   7236   
                                    sender.send(()).await.expect("receiver dropped early");
 9742   7237   
                                    result
 9743   7238   
                                }
 9744   7239   
                            })
 9745   7240   
                            .build_unchecked();
 9746   7241   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9747   7242   
                .await
 9748   7243   
                .expect("unable to make an HTTP request");
 9749   7244   
            ::pretty_assertions::assert_eq!(
 9750   7245   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9751   7246   
                http_response.status()
 9752   7247   
            );
 9753   7248   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9754   7249   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9755   7250   
                http_response.headers(),
 9756   7251   
                expected_headers,
 9757   7252   
            ));
 9758   7253   
        }
 9759   7254   
    }
 9760         -
    /// Attempted string coercion should result in SerializationException
 9761         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case22
        7255  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7256  +
    /// are rejected with a 400 SerializationException
        7257  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case5
 9762   7258   
    #[::tokio::test]
 9763         -
    async fn rest_json_body_boolean_string_coercion_case22_malformed_request() {
        7259  +
    #[::tracing_test::traced_test]
        7260  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case5_malformed_request(
        7261  +
    ) {
 9764   7262   
        {
 9765   7263   
            #[allow(unused_mut)]
 9766   7264   
            let mut http_request = http::Request::builder()
 9767         -
                .uri("/MalformedBoolean/true")
        7265  +
                .uri("/MalformedTimestampQueryDefault")
 9768   7266   
                .method("POST")
 9769         -
                .header("content-type", "application/json")
 9770         -
                .body(::aws_smithy_http_server::body::Body::from(
 9771         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Off\" }".as_bytes()),
 9772         -
                ))
        7267  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7268  +
                .unwrap();
        7269  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957"
        7270  +
                .parse()
 9773   7271   
                .unwrap();
 9774   7272   
            #[allow(unused_mut)]
 9775   7273   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9776   7274   
            let config = crate::service::RestJsonConfig::builder().build();
 9777   7275   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9778         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7276  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9779   7277   
                                let sender = sender.clone();
 9780   7278   
                                async move {
 9781         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7279  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9782   7280   
                                    sender.send(()).await.expect("receiver dropped early");
 9783   7281   
                                    result
 9784   7282   
                                }
 9785   7283   
                            })
 9786   7284   
                            .build_unchecked();
 9787   7285   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9788   7286   
                .await
 9789   7287   
                .expect("unable to make an HTTP request");
 9790   7288   
            ::pretty_assertions::assert_eq!(
 9791   7289   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9792   7290   
                http_response.status()
 9793   7291   
            );
 9794   7292   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9795   7293   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9796   7294   
                http_response.headers(),
 9797   7295   
                expected_headers,
 9798   7296   
            ));
 9799   7297   
        }
 9800   7298   
    }
 9801         -
    /// Attempted string coercion should result in SerializationException
 9802         -
    /// Test ID: RestJsonBodyBooleanStringCoercion_case23
        7299  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7300  +
    /// are rejected with a 400 SerializationException
        7301  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case6
 9803   7302   
    #[::tokio::test]
 9804         -
    async fn rest_json_body_boolean_string_coercion_case23_malformed_request() {
        7303  +
    #[::tracing_test::traced_test]
        7304  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case6_malformed_request(
        7305  +
    ) {
 9805   7306   
        {
 9806   7307   
            #[allow(unused_mut)]
 9807   7308   
            let mut http_request = http::Request::builder()
 9808         -
                .uri("/MalformedBoolean/true")
        7309  +
                .uri("/MalformedTimestampQueryDefault")
 9809   7310   
                .method("POST")
 9810         -
                .header("content-type", "application/json")
 9811         -
                .body(::aws_smithy_http_server::body::Body::from(
 9812         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"OFF\" }".as_bytes()),
 9813         -
                ))
        7311  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7312  +
                .unwrap();
        7313  +
            *http_request.uri_mut() =
        7314  +
                "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57Z"
        7315  +
                    .parse()
 9814   7316   
                    .unwrap();
 9815   7317   
            #[allow(unused_mut)]
 9816   7318   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9817   7319   
            let config = crate::service::RestJsonConfig::builder().build();
 9818   7320   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9819         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7321  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9820   7322   
                                let sender = sender.clone();
 9821   7323   
                                async move {
 9822         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7324  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9823   7325   
                                    sender.send(()).await.expect("receiver dropped early");
 9824   7326   
                                    result
 9825   7327   
                                }
 9826   7328   
                            })
 9827   7329   
                            .build_unchecked();
 9828   7330   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9829   7331   
                .await
 9830   7332   
                .expect("unable to make an HTTP request");
 9831   7333   
            ::pretty_assertions::assert_eq!(
 9832   7334   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9833   7335   
                http_response.status()
 9834   7336   
            );
 9835   7337   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9836   7338   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9837   7339   
                http_response.headers(),
 9838   7340   
                expected_headers,
 9839   7341   
            ));
 9840   7342   
        }
 9841   7343   
    }
 9842         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9843         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case0
        7344  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7345  +
    /// are rejected with a 400 SerializationException
        7346  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case7
 9844   7347   
    #[::tokio::test]
 9845         -
    async fn rest_json_body_boolean_bad_literal_case0_malformed_request() {
        7348  +
    #[::tracing_test::traced_test]
        7349  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case7_malformed_request(
        7350  +
    ) {
 9846   7351   
        {
 9847   7352   
            #[allow(unused_mut)]
 9848   7353   
            let mut http_request = http::Request::builder()
 9849         -
                .uri("/MalformedBoolean/true")
        7354  +
                .uri("/MalformedTimestampQueryDefault")
 9850   7355   
                .method("POST")
 9851         -
                .header("content-type", "application/json")
 9852         -
                .body(::aws_smithy_http_server::body::Body::from(
 9853         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : True }".as_bytes()),
 9854         -
                ))
        7356  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7357  +
                .unwrap();
        7358  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57"
        7359  +
                .parse()
 9855   7360   
                .unwrap();
 9856   7361   
            #[allow(unused_mut)]
 9857   7362   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9858   7363   
            let config = crate::service::RestJsonConfig::builder().build();
 9859   7364   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9860         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7365  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9861   7366   
                                let sender = sender.clone();
 9862   7367   
                                async move {
 9863         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7368  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9864   7369   
                                    sender.send(()).await.expect("receiver dropped early");
 9865   7370   
                                    result
 9866   7371   
                                }
 9867   7372   
                            })
 9868   7373   
                            .build_unchecked();
 9869   7374   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9870   7375   
                .await
 9871   7376   
                .expect("unable to make an HTTP request");
 9872   7377   
            ::pretty_assertions::assert_eq!(
 9873   7378   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9874   7379   
                http_response.status()
 9875   7380   
            );
 9876   7381   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9877   7382   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9878   7383   
                http_response.headers(),
 9879   7384   
                expected_headers,
 9880   7385   
            ));
 9881   7386   
        }
 9882   7387   
    }
 9883         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9884         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case1
        7388  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7389  +
    /// are rejected with a 400 SerializationException
        7390  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case8
 9885   7391   
    #[::tokio::test]
 9886         -
    async fn rest_json_body_boolean_bad_literal_case1_malformed_request() {
        7392  +
    #[::tracing_test::traced_test]
        7393  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case8_malformed_request(
        7394  +
    ) {
 9887   7395   
        {
 9888   7396   
            #[allow(unused_mut)]
 9889   7397   
            let mut http_request = http::Request::builder()
 9890         -
                .uri("/MalformedBoolean/true")
        7398  +
                .uri("/MalformedTimestampQueryDefault")
 9891   7399   
                .method("POST")
 9892         -
                .header("content-type", "application/json")
 9893         -
                .body(::aws_smithy_http_server::body::Body::from(
 9894         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : TRUE }".as_bytes()),
 9895         -
                ))
        7400  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7401  +
                .unwrap();
        7402  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39Z"
        7403  +
                .parse()
 9896   7404   
                .unwrap();
 9897   7405   
            #[allow(unused_mut)]
 9898   7406   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9899   7407   
            let config = crate::service::RestJsonConfig::builder().build();
 9900   7408   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9901         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7409  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9902   7410   
                                let sender = sender.clone();
 9903   7411   
                                async move {
 9904         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7412  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9905   7413   
                                    sender.send(()).await.expect("receiver dropped early");
 9906   7414   
                                    result
 9907   7415   
                                }
 9908   7416   
                            })
 9909   7417   
                            .build_unchecked();
 9910   7418   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9911   7419   
                .await
 9912   7420   
                .expect("unable to make an HTTP request");
 9913   7421   
            ::pretty_assertions::assert_eq!(
 9914   7422   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9915   7423   
                http_response.status()
 9916   7424   
            );
 9917   7425   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9918   7426   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9919   7427   
                http_response.headers(),
 9920   7428   
                expected_headers,
 9921   7429   
            ));
 9922   7430   
        }
 9923   7431   
    }
 9924         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9925         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case2
        7432  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7433  +
    /// are rejected with a 400 SerializationException
        7434  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case9
 9926   7435   
    #[::tokio::test]
 9927         -
    async fn rest_json_body_boolean_bad_literal_case2_malformed_request() {
        7436  +
    #[::tracing_test::traced_test]
        7437  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case9_malformed_request(
        7438  +
    ) {
 9928   7439   
        {
 9929   7440   
            #[allow(unused_mut)]
 9930   7441   
            let mut http_request = http::Request::builder()
 9931         -
                .uri("/MalformedBoolean/true")
        7442  +
                .uri("/MalformedTimestampQueryDefault")
 9932   7443   
                .method("POST")
 9933         -
                .header("content-type", "application/json")
 9934         -
                .body(::aws_smithy_http_server::body::Body::from(
 9935         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : y }".as_bytes()),
 9936         -
                ))
        7444  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7445  +
                .unwrap();
        7446  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39"
        7447  +
                .parse()
 9937   7448   
                .unwrap();
 9938   7449   
            #[allow(unused_mut)]
 9939   7450   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9940   7451   
            let config = crate::service::RestJsonConfig::builder().build();
 9941   7452   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9942         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7453  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9943   7454   
                                let sender = sender.clone();
 9944   7455   
                                async move {
 9945         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7456  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9946   7457   
                                    sender.send(()).await.expect("receiver dropped early");
 9947   7458   
                                    result
 9948   7459   
                                }
 9949   7460   
                            })
 9950   7461   
                            .build_unchecked();
 9951   7462   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9952   7463   
                .await
 9953   7464   
                .expect("unable to make an HTTP request");
 9954   7465   
            ::pretty_assertions::assert_eq!(
 9955   7466   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9956   7467   
                http_response.status()
 9957   7468   
            );
 9958   7469   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
 9959   7470   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 9960   7471   
                http_response.headers(),
 9961   7472   
                expected_headers,
 9962   7473   
            ));
 9963   7474   
        }
 9964   7475   
    }
 9965         -
    /// YAML-style alternate boolean literals should result in SerializationException
 9966         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case3
        7476  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7477  +
    /// are rejected with a 400 SerializationException
        7478  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case10
 9967   7479   
    #[::tokio::test]
 9968         -
    async fn rest_json_body_boolean_bad_literal_case3_malformed_request() {
        7480  +
    #[::tracing_test::traced_test]
        7481  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case10_malformed_request(
        7482  +
    ) {
 9969   7483   
        {
 9970   7484   
            #[allow(unused_mut)]
 9971   7485   
            let mut http_request = http::Request::builder()
 9972         -
                .uri("/MalformedBoolean/true")
        7486  +
                .uri("/MalformedTimestampQueryDefault")
 9973   7487   
                .method("POST")
 9974         -
                .header("content-type", "application/json")
 9975         -
                .body(::aws_smithy_http_server::body::Body::from(
 9976         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Y }".as_bytes()),
 9977         -
                ))
        7488  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7489  +
                .unwrap();
        7490  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T1639"
        7491  +
                .parse()
 9978   7492   
                .unwrap();
 9979   7493   
            #[allow(unused_mut)]
 9980   7494   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 9981   7495   
            let config = crate::service::RestJsonConfig::builder().build();
 9982   7496   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
 9983         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7497  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
 9984   7498   
                                let sender = sender.clone();
 9985   7499   
                                async move {
 9986         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7500  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
 9987   7501   
                                    sender.send(()).await.expect("receiver dropped early");
 9988   7502   
                                    result
 9989   7503   
                                }
 9990   7504   
                            })
 9991   7505   
                            .build_unchecked();
 9992   7506   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 9993   7507   
                .await
 9994   7508   
                .expect("unable to make an HTTP request");
 9995   7509   
            ::pretty_assertions::assert_eq!(
 9996   7510   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 9997   7511   
                http_response.status()
 9998   7512   
            );
 9999   7513   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10000   7514   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10001   7515   
                http_response.headers(),
10002   7516   
                expected_headers,
10003   7517   
            ));
10004   7518   
        }
10005   7519   
    }
10006         -
    /// YAML-style alternate boolean literals should result in SerializationException
10007         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case4
10008         -
    #[::tokio::test]
10009         -
    async fn rest_json_body_boolean_bad_literal_case4_malformed_request() {
        7520  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7521  +
    /// are rejected with a 400 SerializationException
        7522  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case11
        7523  +
    #[::tokio::test]
        7524  +
    #[::tracing_test::traced_test]
        7525  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case11_malformed_request(
        7526  +
    ) {
10010   7527   
        {
10011   7528   
            #[allow(unused_mut)]
10012   7529   
            let mut http_request = http::Request::builder()
10013         -
                .uri("/MalformedBoolean/true")
        7530  +
                .uri("/MalformedTimestampQueryDefault")
10014   7531   
                .method("POST")
10015         -
                .header("content-type", "application/json")
10016         -
                .body(::aws_smithy_http_server::body::Body::from(
10017         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : yes }".as_bytes()),
10018         -
                ))
        7532  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7533  +
                .unwrap();
        7534  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16Z"
        7535  +
                .parse()
10019   7536   
                .unwrap();
10020   7537   
            #[allow(unused_mut)]
10021   7538   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10022   7539   
            let config = crate::service::RestJsonConfig::builder().build();
10023   7540   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10024         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7541  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
10025   7542   
                                let sender = sender.clone();
10026   7543   
                                async move {
10027         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7544  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
10028   7545   
                                    sender.send(()).await.expect("receiver dropped early");
10029   7546   
                                    result
10030   7547   
                                }
10031   7548   
                            })
10032   7549   
                            .build_unchecked();
10033   7550   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10034   7551   
                .await
10035   7552   
                .expect("unable to make an HTTP request");
10036   7553   
            ::pretty_assertions::assert_eq!(
10037   7554   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10038   7555   
                http_response.status()
10039   7556   
            );
10040   7557   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10041   7558   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10042   7559   
                http_response.headers(),
10043   7560   
                expected_headers,
10044   7561   
            ));
10045   7562   
        }
10046   7563   
    }
10047         -
    /// YAML-style alternate boolean literals should result in SerializationException
10048         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case5
        7564  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7565  +
    /// are rejected with a 400 SerializationException
        7566  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case12
10049   7567   
    #[::tokio::test]
10050         -
    async fn rest_json_body_boolean_bad_literal_case5_malformed_request() {
        7568  +
    #[::tracing_test::traced_test]
        7569  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case12_malformed_request(
        7570  +
    ) {
10051   7571   
        {
10052   7572   
            #[allow(unused_mut)]
10053   7573   
            let mut http_request = http::Request::builder()
10054         -
                .uri("/MalformedBoolean/true")
        7574  +
                .uri("/MalformedTimestampQueryDefault")
10055   7575   
                .method("POST")
10056         -
                .header("content-type", "application/json")
10057         -
                .body(::aws_smithy_http_server::body::Body::from(
10058         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Yes }".as_bytes()),
10059         -
                ))
        7576  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7577  +
                .unwrap();
        7578  +
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16"
        7579  +
                .parse()
10060   7580   
                .unwrap();
10061   7581   
            #[allow(unused_mut)]
10062   7582   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10063   7583   
            let config = crate::service::RestJsonConfig::builder().build();
10064   7584   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10065         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7585  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
10066   7586   
                                let sender = sender.clone();
10067   7587   
                                async move {
10068         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7588  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
10069   7589   
                                    sender.send(()).await.expect("receiver dropped early");
10070   7590   
                                    result
10071   7591   
                                }
10072   7592   
                            })
10073   7593   
                            .build_unchecked();
10074   7594   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10075   7595   
                .await
10076   7596   
                .expect("unable to make an HTTP request");
10077   7597   
            ::pretty_assertions::assert_eq!(
10078   7598   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10079   7599   
                http_response.status()
10080   7600   
            );
10081   7601   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10082   7602   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10083   7603   
                http_response.headers(),
10084   7604   
                expected_headers,
10085   7605   
            ));
10086   7606   
        }
10087   7607   
    }
10088         -
    /// YAML-style alternate boolean literals should result in SerializationException
10089         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case6
        7608  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7609  +
    /// are rejected with a 400 SerializationException
        7610  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case13
10090   7611   
    #[::tokio::test]
10091         -
    async fn rest_json_body_boolean_bad_literal_case6_malformed_request() {
        7612  +
    #[::tracing_test::traced_test]
        7613  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case13_malformed_request(
        7614  +
    ) {
10092   7615   
        {
10093   7616   
            #[allow(unused_mut)]
10094   7617   
            let mut http_request = http::Request::builder()
10095         -
                .uri("/MalformedBoolean/true")
        7618  +
                .uri("/MalformedTimestampQueryDefault")
10096   7619   
                .method("POST")
10097         -
                .header("content-type", "application/json")
10098         -
                .body(::aws_smithy_http_server::body::Body::from(
10099         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : YES }".as_bytes()),
10100         -
                ))
        7620  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7621  +
                .unwrap();
        7622  +
            *http_request.uri_mut() =
        7623  +
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19%2016:39:57Z"
        7624  +
                    .parse()
10101   7625   
                    .unwrap();
10102   7626   
            #[allow(unused_mut)]
10103   7627   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10104   7628   
            let config = crate::service::RestJsonConfig::builder().build();
10105   7629   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10106         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7630  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
10107   7631   
                                let sender = sender.clone();
10108   7632   
                                async move {
10109         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7633  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
10110   7634   
                                    sender.send(()).await.expect("receiver dropped early");
10111   7635   
                                    result
10112   7636   
                                }
10113   7637   
                            })
10114   7638   
                            .build_unchecked();
10115   7639   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10116   7640   
                .await
10117   7641   
                .expect("unable to make an HTTP request");
10118   7642   
            ::pretty_assertions::assert_eq!(
10119   7643   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10120   7644   
                http_response.status()
10121   7645   
            );
10122   7646   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10123   7647   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10124   7648   
                http_response.headers(),
10125   7649   
                expected_headers,
10126   7650   
            ));
10127   7651   
        }
10128   7652   
    }
10129         -
    /// YAML-style alternate boolean literals should result in SerializationException
10130         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case7
        7653  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        7654  +
    /// are rejected with a 400 SerializationException
        7655  +
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case14
10131   7656   
    #[::tokio::test]
10132         -
    async fn rest_json_body_boolean_bad_literal_case7_malformed_request() {
        7657  +
    #[::tracing_test::traced_test]
        7658  +
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case14_malformed_request(
        7659  +
    ) {
10133   7660   
        {
10134   7661   
            #[allow(unused_mut)]
10135   7662   
            let mut http_request = http::Request::builder()
10136         -
                .uri("/MalformedBoolean/true")
        7663  +
                .uri("/MalformedTimestampQueryDefault")
10137   7664   
                .method("POST")
10138         -
                .header("content-type", "application/json")
10139         -
                .body(::aws_smithy_http_server::body::Body::from(
10140         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : 1 }".as_bytes()),
10141         -
                ))
        7665  +
                .body(::aws_smithy_http_server::body::Body::empty())
        7666  +
                .unwrap();
        7667  +
            *http_request.uri_mut() =
        7668  +
                "/MalformedTimestampQueryDefault?timestamp=2011-12-03T10:15:30+01:00[Europe/Paris]"
        7669  +
                    .parse()
10142   7670   
                    .unwrap();
10143   7671   
            #[allow(unused_mut)]
10144   7672   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10145   7673   
            let config = crate::service::RestJsonConfig::builder().build();
10146   7674   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10147         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7675  +
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
10148   7676   
                                let sender = sender.clone();
10149   7677   
                                async move {
10150         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7678  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
10151   7679   
                                    sender.send(()).await.expect("receiver dropped early");
10152   7680   
                                    result
10153   7681   
                                }
10154   7682   
                            })
10155   7683   
                            .build_unchecked();
10156   7684   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10157   7685   
                .await
10158   7686   
                .expect("unable to make an HTTP request");
10159   7687   
            ::pretty_assertions::assert_eq!(
10160   7688   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10161   7689   
                http_response.status()
10162   7690   
            );
10163   7691   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10164   7692   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10165   7693   
                http_response.headers(),
10166   7694   
                expected_headers,
10167   7695   
            ));
10168   7696   
        }
10169   7697   
    }
10170         -
    /// YAML-style alternate boolean literals should result in SerializationException
10171         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case8
10172         -
    #[::tokio::test]
10173         -
    async fn rest_json_body_boolean_bad_literal_case8_malformed_request() {
10174         -
        {
10175         -
            #[allow(unused_mut)]
10176         -
            let mut http_request = http::Request::builder()
10177         -
                .uri("/MalformedBoolean/true")
10178         -
                .method("POST")
10179         -
                .header("content-type", "application/json")
10180         -
                .body(::aws_smithy_http_server::body::Body::from(
10181         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : on }".as_bytes()),
10182         -
                ))
10183         -
                .unwrap();
10184         -
            #[allow(unused_mut)]
10185         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10186         -
            let config = crate::service::RestJsonConfig::builder().build();
10187         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10188         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
10189         -
                                let sender = sender.clone();
10190         -
                                async move {
10191         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
10192         -
                                    sender.send(()).await.expect("receiver dropped early");
10193         -
                                    result
        7698  +
}
        7699  +
        7700  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHEPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
        7701  +
::pin_project_lite::pin_project! {
        7702  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        7703  +
    /// [`MalformedTimestampPathEpochInput`](crate::input::MalformedTimestampPathEpochInput) using modelled bindings.
        7704  +
    pub struct MalformedTimestampPathEpochInputFuture {
        7705  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampPathEpochInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
10194   7706   
    }
10195         -
                            })
10196         -
                            .build_unchecked();
10197         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
        7707  +
}
        7708  +
        7709  +
impl std::future::Future for MalformedTimestampPathEpochInputFuture {
        7710  +
    type Output = Result<
        7711  +
        crate::input::MalformedTimestampPathEpochInput,
        7712  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        7713  +
    >;
        7714  +
        7715  +
    fn poll(
        7716  +
        self: std::pin::Pin<&mut Self>,
        7717  +
        cx: &mut std::task::Context<'_>,
        7718  +
    ) -> std::task::Poll<Self::Output> {
        7719  +
        let this = self.project();
        7720  +
        this.inner.as_mut().poll(cx)
        7721  +
    }
        7722  +
}
        7723  +
        7724  +
impl<B>
        7725  +
    ::aws_smithy_http_server::request::FromRequest<
        7726  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        7727  +
        B,
        7728  +
    > for crate::input::MalformedTimestampPathEpochInput
        7729  +
where
        7730  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        7731  +
    B: 'static,
        7732  +
        7733  +
    B::Data: Send,
        7734  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        7735  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        7736  +
{
        7737  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        7738  +
    type Future = MalformedTimestampPathEpochInputFuture;
        7739  +
        7740  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        7741  +
        let fut = async move {
        7742  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        7743  +
                request.headers(),
        7744  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHEPOCH,
        7745  +
            ) {
        7746  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        7747  +
            }
        7748  +
            crate::protocol_serde::shape_malformed_timestamp_path_epoch::de_malformed_timestamp_path_epoch_http_request(request)
10198   7749   
                            .await
10199         -
                .expect("unable to make an HTTP request");
10200         -
            ::pretty_assertions::assert_eq!(
10201         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10202         -
                http_response.status()
        7750  +
                            .map_err(Into::into)
        7751  +
        };
        7752  +
        use ::futures_util::future::TryFutureExt;
        7753  +
        let fut = fut.map_err(
        7754  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        7755  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        7756  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        7757  +
                    e,
        7758  +
                )
        7759  +
            },
10203   7760   
        );
10204         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10205         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10206         -
                http_response.headers(),
10207         -
                expected_headers,
10208         -
            ));
        7761  +
        MalformedTimestampPathEpochInputFuture {
        7762  +
            inner: Box::pin(fut),
10209   7763   
        }
10210   7764   
    }
10211         -
    /// YAML-style alternate boolean literals should result in SerializationException
10212         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case9
10213         -
    #[::tokio::test]
10214         -
    async fn rest_json_body_boolean_bad_literal_case9_malformed_request() {
10215         -
        {
10216         -
            #[allow(unused_mut)]
10217         -
            let mut http_request = http::Request::builder()
10218         -
                .uri("/MalformedBoolean/true")
10219         -
                .method("POST")
10220         -
                .header("content-type", "application/json")
10221         -
                .body(::aws_smithy_http_server::body::Body::from(
10222         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : On }".as_bytes()),
10223         -
                ))
10224         -
                .unwrap();
10225         -
            #[allow(unused_mut)]
10226         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10227         -
            let config = crate::service::RestJsonConfig::builder().build();
10228         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10229         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
10230         -
                                let sender = sender.clone();
10231         -
                                async move {
10232         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
10233         -
                                    sender.send(()).await.expect("receiver dropped early");
10234         -
                                    result
        7765  +
}
        7766  +
impl
        7767  +
    ::aws_smithy_http_server::response::IntoResponse<
        7768  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        7769  +
    > for crate::output::MalformedTimestampPathEpochOutput
        7770  +
{
        7771  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        7772  +
        match crate::protocol_serde::shape_malformed_timestamp_path_epoch::ser_malformed_timestamp_path_epoch_http_response(self) {
        7773  +
                        Ok(response) => response,
        7774  +
                        Err(e) => {
        7775  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        7776  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
10235   7777   
                        }
10236         -
                            })
10237         -
                            .build_unchecked();
10238         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10239         -
                .await
10240         -
                .expect("unable to make an HTTP request");
10241         -
            ::pretty_assertions::assert_eq!(
10242         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10243         -
                http_response.status()
10244         -
            );
10245         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10246         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10247         -
                http_response.headers(),
10248         -
                expected_headers,
10249         -
            ));
10250   7778   
                    }
10251   7779   
    }
10252         -
    /// YAML-style alternate boolean literals should result in SerializationException
10253         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case10
10254         -
    #[::tokio::test]
10255         -
    async fn rest_json_body_boolean_bad_literal_case10_malformed_request() {
10256         -
        {
10257         -
            #[allow(unused_mut)]
10258         -
            let mut http_request = http::Request::builder()
10259         -
                .uri("/MalformedBoolean/true")
10260         -
                .method("POST")
10261         -
                .header("content-type", "application/json")
10262         -
                .body(::aws_smithy_http_server::body::Body::from(
10263         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : ON }".as_bytes()),
10264         -
                ))
10265         -
                .unwrap();
10266         -
            #[allow(unused_mut)]
10267         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10268         -
            let config = crate::service::RestJsonConfig::builder().build();
10269         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10270         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
10271         -
                                let sender = sender.clone();
10272         -
                                async move {
10273         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
10274         -
                                    sender.send(()).await.expect("receiver dropped early");
10275         -
                                    result
        7780  +
}
        7781  +
impl
        7782  +
    ::aws_smithy_http_server::response::IntoResponse<
        7783  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        7784  +
    > for crate::error::MalformedTimestampPathEpochError
        7785  +
{
        7786  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        7787  +
        match crate::protocol_serde::shape_malformed_timestamp_path_epoch::ser_malformed_timestamp_path_epoch_http_error(&self) {
        7788  +
            Ok(mut response) => {
        7789  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        7790  +
                response
        7791  +
            },
        7792  +
            Err(e) => {
        7793  +
                ::tracing::error!(error = %e, "failed to serialize response");
        7794  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
10276   7795   
            }
10277         -
                            })
10278         -
                            .build_unchecked();
10279         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10280         -
                .await
10281         -
                .expect("unable to make an HTTP request");
10282         -
            ::pretty_assertions::assert_eq!(
10283         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10284         -
                http_response.status()
10285         -
            );
10286         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10287         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10288         -
                http_response.headers(),
10289         -
                expected_headers,
10290         -
            ));
10291   7796   
        }
10292   7797   
    }
10293         -
    /// YAML-style alternate boolean literals should result in SerializationException
10294         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case11
        7798  +
}
        7799  +
        7800  +
#[allow(unreachable_code, unused_variables)]
        7801  +
#[cfg(test)]
        7802  +
mod malformed_timestamp_path_epoch_test {
        7803  +
        7804  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        7805  +
    /// 400 SerializationException
        7806  +
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case0
10295   7807   
    #[::tokio::test]
10296         -
    async fn rest_json_body_boolean_bad_literal_case11_malformed_request() {
        7808  +
    #[::tracing_test::traced_test]
        7809  +
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case0_malformed_request() {
10297   7810   
        {
10298   7811   
            #[allow(unused_mut)]
10299   7812   
            let mut http_request = http::Request::builder()
10300         -
                .uri("/MalformedBoolean/true")
        7813  +
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50.52Z")
10301   7814   
                .method("POST")
10302         -
                .header("content-type", "application/json")
10303         -
                .body(::aws_smithy_http_server::body::Body::from(
10304         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : False }".as_bytes()),
10305         -
                ))
        7815  +
                .body(::aws_smithy_http_server::body::Body::empty())
10306   7816   
                .unwrap();
10307   7817   
            #[allow(unused_mut)]
10308   7818   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10309   7819   
            let config = crate::service::RestJsonConfig::builder().build();
10310   7820   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10311         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7821  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10312   7822   
                                let sender = sender.clone();
10313   7823   
                                async move {
10314         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7824  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10315   7825   
                                    sender.send(()).await.expect("receiver dropped early");
10316   7826   
                                    result
10317   7827   
                                }
10318   7828   
                            })
10319   7829   
                            .build_unchecked();
10320   7830   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10321   7831   
                .await
10322   7832   
                .expect("unable to make an HTTP request");
10323   7833   
            ::pretty_assertions::assert_eq!(
10324   7834   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10325   7835   
                http_response.status()
10326   7836   
            );
10327   7837   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10328   7838   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10329   7839   
                http_response.headers(),
10330   7840   
                expected_headers,
10331   7841   
            ));
10332   7842   
        }
10333   7843   
    }
10334         -
    /// YAML-style alternate boolean literals should result in SerializationException
10335         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case12
        7844  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        7845  +
    /// 400 SerializationException
        7846  +
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case1
10336   7847   
    #[::tokio::test]
10337         -
    async fn rest_json_body_boolean_bad_literal_case12_malformed_request() {
        7848  +
    #[::tracing_test::traced_test]
        7849  +
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case1_malformed_request() {
10338   7850   
        {
10339   7851   
            #[allow(unused_mut)]
10340   7852   
            let mut http_request = http::Request::builder()
10341         -
                .uri("/MalformedBoolean/true")
        7853  +
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50Z")
10342   7854   
                .method("POST")
10343         -
                .header("content-type", "application/json")
10344         -
                .body(::aws_smithy_http_server::body::Body::from(
10345         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : FALSE }".as_bytes()),
10346         -
                ))
        7855  +
                .body(::aws_smithy_http_server::body::Body::empty())
10347   7856   
                .unwrap();
10348   7857   
            #[allow(unused_mut)]
10349   7858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10350   7859   
            let config = crate::service::RestJsonConfig::builder().build();
10351   7860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10352         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7861  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10353   7862   
                                let sender = sender.clone();
10354   7863   
                                async move {
10355         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7864  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10356   7865   
                                    sender.send(()).await.expect("receiver dropped early");
10357   7866   
                                    result
10358   7867   
                                }
10359   7868   
                            })
10360   7869   
                            .build_unchecked();
10361   7870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10362   7871   
                .await
10363   7872   
                .expect("unable to make an HTTP request");
10364   7873   
            ::pretty_assertions::assert_eq!(
10365   7874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10366   7875   
                http_response.status()
10367   7876   
            );
10368   7877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10369   7878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10370   7879   
                http_response.headers(),
10371   7880   
                expected_headers,
10372   7881   
            ));
10373   7882   
        }
10374   7883   
    }
10375         -
    /// YAML-style alternate boolean literals should result in SerializationException
10376         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case13
        7884  +
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
        7885  +
    /// 400 SerializationException
        7886  +
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case2
10377   7887   
    #[::tokio::test]
10378         -
    async fn rest_json_body_boolean_bad_literal_case13_malformed_request() {
        7888  +
    #[::tracing_test::traced_test]
        7889  +
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case2_malformed_request() {
10379   7890   
        {
10380   7891   
            #[allow(unused_mut)]
10381   7892   
            let mut http_request = http::Request::builder()
10382         -
                .uri("/MalformedBoolean/true")
        7893  +
                .uri("/MalformedTimestampPathEpoch/1996-12-19T16%3A39%3A57-08%3A00")
10383   7894   
                .method("POST")
10384         -
                .header("content-type", "application/json")
10385         -
                .body(::aws_smithy_http_server::body::Body::from(
10386         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : n }".as_bytes()),
10387         -
                ))
        7895  +
                .body(::aws_smithy_http_server::body::Body::empty())
10388   7896   
                .unwrap();
10389   7897   
            #[allow(unused_mut)]
10390   7898   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10391   7899   
            let config = crate::service::RestJsonConfig::builder().build();
10392   7900   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10393         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7901  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10394   7902   
                                let sender = sender.clone();
10395   7903   
                                async move {
10396         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7904  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10397   7905   
                                    sender.send(()).await.expect("receiver dropped early");
10398   7906   
                                    result
10399   7907   
                                }
10400   7908   
                            })
10401   7909   
                            .build_unchecked();
10402   7910   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10403   7911   
                .await
10404   7912   
                .expect("unable to make an HTTP request");
10405   7913   
            ::pretty_assertions::assert_eq!(
10406   7914   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10407   7915   
                http_response.status()
10408   7916   
            );
10409   7917   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10410   7918   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10411   7919   
                http_response.headers(),
10412   7920   
                expected_headers,
10413   7921   
            ));
10414   7922   
        }
10415   7923   
    }
10416         -
    /// YAML-style alternate boolean literals should result in SerializationException
10417         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case14
        7924  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        7925  +
    /// 400 SerializationException
        7926  +
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case0
10418   7927   
    #[::tokio::test]
10419         -
    async fn rest_json_body_boolean_bad_literal_case14_malformed_request() {
        7928  +
    #[::tracing_test::traced_test]
        7929  +
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case0_malformed_request() {
10420   7930   
        {
10421   7931   
            #[allow(unused_mut)]
10422   7932   
            let mut http_request = http::Request::builder()
10423         -
                .uri("/MalformedBoolean/true")
        7933  +
                .uri("/MalformedTimestampPathEpoch/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
10424   7934   
                .method("POST")
10425         -
                .header("content-type", "application/json")
10426         -
                .body(::aws_smithy_http_server::body::Body::from(
10427         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : N }".as_bytes()),
10428         -
                ))
        7935  +
                .body(::aws_smithy_http_server::body::Body::empty())
10429   7936   
                .unwrap();
10430   7937   
            #[allow(unused_mut)]
10431   7938   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10432   7939   
            let config = crate::service::RestJsonConfig::builder().build();
10433   7940   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10434         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7941  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10435   7942   
                                let sender = sender.clone();
10436   7943   
                                async move {
10437         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7944  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10438   7945   
                                    sender.send(()).await.expect("receiver dropped early");
10439   7946   
                                    result
10440   7947   
                                }
10441   7948   
                            })
10442   7949   
                            .build_unchecked();
10443   7950   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10444   7951   
                .await
10445   7952   
                .expect("unable to make an HTTP request");
10446   7953   
            ::pretty_assertions::assert_eq!(
10447   7954   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10448   7955   
                http_response.status()
10449   7956   
            );
10450   7957   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10451   7958   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10452   7959   
                http_response.headers(),
10453   7960   
                expected_headers,
10454   7961   
            ));
10455   7962   
        }
10456   7963   
    }
10457         -
    /// YAML-style alternate boolean literals should result in SerializationException
10458         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case15
        7964  +
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
        7965  +
    /// 400 SerializationException
        7966  +
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case1
10459   7967   
    #[::tokio::test]
10460         -
    async fn rest_json_body_boolean_bad_literal_case15_malformed_request() {
        7968  +
    #[::tracing_test::traced_test]
        7969  +
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case1_malformed_request() {
10461   7970   
        {
10462   7971   
            #[allow(unused_mut)]
10463   7972   
                        let mut http_request = http::Request::builder()
10464         -
                .uri("/MalformedBoolean/true")
        7973  +
                            .uri("/MalformedTimestampPathEpoch/Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT")
10465   7974   
                            .method("POST")
10466         -
                .header("content-type", "application/json")
10467         -
                .body(::aws_smithy_http_server::body::Body::from(
10468         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : no }".as_bytes()),
10469         -
                ))
10470         -
                .unwrap();
        7975  +
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
10471   7976   
            #[allow(unused_mut)]
10472   7977   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10473   7978   
            let config = crate::service::RestJsonConfig::builder().build();
10474   7979   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10475         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        7980  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10476   7981   
                                let sender = sender.clone();
10477   7982   
                                async move {
10478         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        7983  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10479   7984   
                                    sender.send(()).await.expect("receiver dropped early");
10480   7985   
                                    result
10481   7986   
                                }
10482   7987   
                            })
10483   7988   
                            .build_unchecked();
10484   7989   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10485   7990   
                .await
10486   7991   
                .expect("unable to make an HTTP request");
10487   7992   
            ::pretty_assertions::assert_eq!(
10488   7993   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10489   7994   
                http_response.status()
10490   7995   
            );
10491   7996   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10492   7997   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10493   7998   
                http_response.headers(),
10494   7999   
                expected_headers,
10495   8000   
            ));
10496   8001   
        }
10497   8002   
    }
10498         -
    /// YAML-style alternate boolean literals should result in SerializationException
10499         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case16
        8003  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8004  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case0
10500   8005   
    #[::tokio::test]
10501         -
    async fn rest_json_body_boolean_bad_literal_case16_malformed_request() {
        8006  +
    #[::tracing_test::traced_test]
        8007  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
10502   8008   
        {
10503   8009   
            #[allow(unused_mut)]
10504   8010   
            let mut http_request = http::Request::builder()
10505         -
                .uri("/MalformedBoolean/true")
        8011  +
                .uri("/MalformedTimestampPathEpoch/true")
10506   8012   
                .method("POST")
10507         -
                .header("content-type", "application/json")
10508         -
                .body(::aws_smithy_http_server::body::Body::from(
10509         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : No }".as_bytes()),
10510         -
                ))
        8013  +
                .body(::aws_smithy_http_server::body::Body::empty())
10511   8014   
                .unwrap();
10512   8015   
            #[allow(unused_mut)]
10513   8016   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10514   8017   
            let config = crate::service::RestJsonConfig::builder().build();
10515   8018   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10516         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8019  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10517   8020   
                                let sender = sender.clone();
10518   8021   
                                async move {
10519         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8022  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10520   8023   
                                    sender.send(()).await.expect("receiver dropped early");
10521   8024   
                                    result
10522   8025   
                                }
10523   8026   
                            })
10524   8027   
                            .build_unchecked();
10525   8028   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10526   8029   
                .await
10527   8030   
                .expect("unable to make an HTTP request");
10528   8031   
            ::pretty_assertions::assert_eq!(
10529   8032   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10530   8033   
                http_response.status()
10531   8034   
            );
10532   8035   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10533   8036   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10534   8037   
                http_response.headers(),
10535   8038   
                expected_headers,
10536   8039   
            ));
10537   8040   
        }
10538   8041   
    }
10539         -
    /// YAML-style alternate boolean literals should result in SerializationException
10540         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case17
        8042  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8043  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case1
10541   8044   
    #[::tokio::test]
10542         -
    async fn rest_json_body_boolean_bad_literal_case17_malformed_request() {
        8045  +
    #[::tracing_test::traced_test]
        8046  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
10543   8047   
        {
10544   8048   
            #[allow(unused_mut)]
10545   8049   
            let mut http_request = http::Request::builder()
10546         -
                .uri("/MalformedBoolean/true")
        8050  +
                .uri("/MalformedTimestampPathEpoch/1515531081ABC")
10547   8051   
                .method("POST")
10548         -
                .header("content-type", "application/json")
10549         -
                .body(::aws_smithy_http_server::body::Body::from(
10550         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : NO }".as_bytes()),
10551         -
                ))
        8052  +
                .body(::aws_smithy_http_server::body::Body::empty())
10552   8053   
                .unwrap();
10553   8054   
            #[allow(unused_mut)]
10554   8055   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10555   8056   
            let config = crate::service::RestJsonConfig::builder().build();
10556   8057   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10557         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8058  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10558   8059   
                                let sender = sender.clone();
10559   8060   
                                async move {
10560         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8061  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10561   8062   
                                    sender.send(()).await.expect("receiver dropped early");
10562   8063   
                                    result
10563   8064   
                                }
10564   8065   
                            })
10565   8066   
                            .build_unchecked();
10566   8067   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10567   8068   
                .await
10568   8069   
                .expect("unable to make an HTTP request");
10569   8070   
            ::pretty_assertions::assert_eq!(
10570   8071   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10571   8072   
                http_response.status()
10572   8073   
            );
10573   8074   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10574   8075   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10575   8076   
                http_response.headers(),
10576   8077   
                expected_headers,
10577   8078   
            ));
10578   8079   
        }
10579   8080   
    }
10580         -
    /// YAML-style alternate boolean literals should result in SerializationException
10581         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case18
        8081  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8082  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case2
10582   8083   
    #[::tokio::test]
10583         -
    async fn rest_json_body_boolean_bad_literal_case18_malformed_request() {
        8084  +
    #[::tracing_test::traced_test]
        8085  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
10584   8086   
        {
10585   8087   
            #[allow(unused_mut)]
10586   8088   
            let mut http_request = http::Request::builder()
10587         -
                .uri("/MalformedBoolean/true")
        8089  +
                .uri("/MalformedTimestampPathEpoch/0x42")
10588   8090   
                .method("POST")
10589         -
                .header("content-type", "application/json")
10590         -
                .body(::aws_smithy_http_server::body::Body::from(
10591         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : 0 }".as_bytes()),
10592         -
                ))
        8091  +
                .body(::aws_smithy_http_server::body::Body::empty())
10593   8092   
                .unwrap();
10594   8093   
            #[allow(unused_mut)]
10595   8094   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10596   8095   
            let config = crate::service::RestJsonConfig::builder().build();
10597   8096   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10598         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8097  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10599   8098   
                                let sender = sender.clone();
10600   8099   
                                async move {
10601         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8100  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10602   8101   
                                    sender.send(()).await.expect("receiver dropped early");
10603   8102   
                                    result
10604   8103   
                                }
10605   8104   
                            })
10606   8105   
                            .build_unchecked();
10607   8106   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10608   8107   
                .await
10609   8108   
                .expect("unable to make an HTTP request");
10610   8109   
            ::pretty_assertions::assert_eq!(
10611   8110   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10612   8111   
                http_response.status()
10613   8112   
            );
10614   8113   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10615   8114   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10616   8115   
                http_response.headers(),
10617   8116   
                expected_headers,
10618   8117   
            ));
10619   8118   
        }
10620   8119   
    }
10621         -
    /// YAML-style alternate boolean literals should result in SerializationException
10622         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case19
        8120  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8121  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case3
10623   8122   
    #[::tokio::test]
10624         -
    async fn rest_json_body_boolean_bad_literal_case19_malformed_request() {
        8123  +
    #[::tracing_test::traced_test]
        8124  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
10625   8125   
        {
10626   8126   
            #[allow(unused_mut)]
10627   8127   
            let mut http_request = http::Request::builder()
10628         -
                .uri("/MalformedBoolean/true")
        8128  +
                .uri("/MalformedTimestampPathEpoch/1515531081.123.456")
10629   8129   
                .method("POST")
10630         -
                .header("content-type", "application/json")
10631         -
                .body(::aws_smithy_http_server::body::Body::from(
10632         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : off }".as_bytes()),
10633         -
                ))
        8130  +
                .body(::aws_smithy_http_server::body::Body::empty())
10634   8131   
                .unwrap();
10635   8132   
            #[allow(unused_mut)]
10636   8133   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10637   8134   
            let config = crate::service::RestJsonConfig::builder().build();
10638   8135   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10639         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8136  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10640   8137   
                                let sender = sender.clone();
10641   8138   
                                async move {
10642         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8139  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10643   8140   
                                    sender.send(()).await.expect("receiver dropped early");
10644   8141   
                                    result
10645   8142   
                                }
10646   8143   
                            })
10647   8144   
                            .build_unchecked();
10648   8145   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10649   8146   
                .await
10650   8147   
                .expect("unable to make an HTTP request");
10651   8148   
            ::pretty_assertions::assert_eq!(
10652   8149   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10653   8150   
                http_response.status()
10654   8151   
            );
10655   8152   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10656   8153   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10657   8154   
                http_response.headers(),
10658   8155   
                expected_headers,
10659   8156   
            ));
10660   8157   
        }
10661   8158   
    }
10662         -
    /// YAML-style alternate boolean literals should result in SerializationException
10663         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case20
        8159  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8160  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case4
10664   8161   
    #[::tokio::test]
10665         -
    async fn rest_json_body_boolean_bad_literal_case20_malformed_request() {
        8162  +
    #[::tracing_test::traced_test]
        8163  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
10666   8164   
        {
10667   8165   
            #[allow(unused_mut)]
10668   8166   
            let mut http_request = http::Request::builder()
10669         -
                .uri("/MalformedBoolean/true")
        8167  +
                .uri("/MalformedTimestampPathEpoch/Infinity")
10670   8168   
                .method("POST")
10671         -
                .header("content-type", "application/json")
10672         -
                .body(::aws_smithy_http_server::body::Body::from(
10673         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Off }".as_bytes()),
10674         -
                ))
        8169  +
                .body(::aws_smithy_http_server::body::Body::empty())
10675   8170   
                .unwrap();
10676   8171   
            #[allow(unused_mut)]
10677   8172   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10678   8173   
            let config = crate::service::RestJsonConfig::builder().build();
10679   8174   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10680         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8175  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10681   8176   
                                let sender = sender.clone();
10682   8177   
                                async move {
10683         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8178  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10684   8179   
                                    sender.send(()).await.expect("receiver dropped early");
10685   8180   
                                    result
10686   8181   
                                }
10687   8182   
                            })
10688   8183   
                            .build_unchecked();
10689   8184   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10690   8185   
                .await
10691   8186   
                .expect("unable to make an HTTP request");
10692   8187   
            ::pretty_assertions::assert_eq!(
10693   8188   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10694   8189   
                http_response.status()
10695   8190   
            );
10696   8191   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10697   8192   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10698   8193   
                http_response.headers(),
10699   8194   
                expected_headers,
10700   8195   
            ));
10701   8196   
        }
10702   8197   
    }
10703         -
    /// YAML-style alternate boolean literals should result in SerializationException
10704         -
    /// Test ID: RestJsonBodyBooleanBadLiteral_case21
        8198  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8199  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case5
10705   8200   
    #[::tokio::test]
10706         -
    async fn rest_json_body_boolean_bad_literal_case21_malformed_request() {
        8201  +
    #[::tracing_test::traced_test]
        8202  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
10707   8203   
        {
10708   8204   
            #[allow(unused_mut)]
10709   8205   
            let mut http_request = http::Request::builder()
10710         -
                .uri("/MalformedBoolean/true")
        8206  +
                .uri("/MalformedTimestampPathEpoch/-Infinity")
10711   8207   
                .method("POST")
10712         -
                .header("content-type", "application/json")
10713         -
                .body(::aws_smithy_http_server::body::Body::from(
10714         -
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : OFF }".as_bytes()),
10715         -
                ))
        8208  +
                .body(::aws_smithy_http_server::body::Body::empty())
10716   8209   
                .unwrap();
10717   8210   
            #[allow(unused_mut)]
10718   8211   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10719   8212   
            let config = crate::service::RestJsonConfig::builder().build();
10720   8213   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10721         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8214  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10722   8215   
                                let sender = sender.clone();
10723   8216   
                                async move {
10724         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8217  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10725   8218   
                                    sender.send(()).await.expect("receiver dropped early");
10726   8219   
                                    result
10727   8220   
                                }
10728   8221   
                            })
10729   8222   
                            .build_unchecked();
10730   8223   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10731   8224   
                .await
10732   8225   
                .expect("unable to make an HTTP request");
10733   8226   
            ::pretty_assertions::assert_eq!(
10734   8227   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10735   8228   
                http_response.status()
10736   8229   
            );
10737   8230   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10738   8231   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10739   8232   
                http_response.headers(),
10740   8233   
                expected_headers,
10741   8234   
            ));
10742   8235   
        }
10743   8236   
    }
10744         -
    /// Attempted string coercion should result in SerializationException
10745         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case0
        8237  +
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
        8238  +
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case6
10746   8239   
    #[::tokio::test]
10747         -
    async fn rest_json_path_boolean_string_coercion_case0_malformed_request() {
        8240  +
    #[::tracing_test::traced_test]
        8241  +
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
10748   8242   
        {
10749   8243   
            #[allow(unused_mut)]
10750   8244   
            let mut http_request = http::Request::builder()
10751         -
                .uri("/MalformedBoolean/True")
        8245  +
                .uri("/MalformedTimestampPathEpoch/NaN")
10752   8246   
                .method("POST")
10753   8247   
                .body(::aws_smithy_http_server::body::Body::empty())
10754   8248   
                .unwrap();
10755   8249   
            #[allow(unused_mut)]
10756   8250   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10757   8251   
            let config = crate::service::RestJsonConfig::builder().build();
10758   8252   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10759         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8253  +
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
10760   8254   
                                let sender = sender.clone();
10761   8255   
                                async move {
10762         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8256  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
10763   8257   
                                    sender.send(()).await.expect("receiver dropped early");
10764   8258   
                                    result
10765   8259   
                                }
10766   8260   
                            })
10767   8261   
                            .build_unchecked();
10768   8262   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10769   8263   
                .await
10770   8264   
                .expect("unable to make an HTTP request");
10771   8265   
            ::pretty_assertions::assert_eq!(
10772   8266   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10773   8267   
                http_response.status()
10774   8268   
            );
10775   8269   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10776   8270   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10777   8271   
                http_response.headers(),
10778   8272   
                expected_headers,
10779   8273   
            ));
10780   8274   
        }
10781   8275   
    }
10782         -
    /// Attempted string coercion should result in SerializationException
10783         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case1
10784         -
    #[::tokio::test]
10785         -
    async fn rest_json_path_boolean_string_coercion_case1_malformed_request() {
10786         -
        {
10787         -
            #[allow(unused_mut)]
10788         -
            let mut http_request = http::Request::builder()
10789         -
                .uri("/MalformedBoolean/TRUE")
10790         -
                .method("POST")
10791         -
                .body(::aws_smithy_http_server::body::Body::empty())
10792         -
                .unwrap();
10793         -
            #[allow(unused_mut)]
10794         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
        8276  +
}
        8277  +
        8278  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
        8279  +
::pin_project_lite::pin_project! {
        8280  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        8281  +
    /// [`MalformedTimestampPathHttpDateInput`](crate::input::MalformedTimestampPathHttpDateInput) using modelled bindings.
        8282  +
    pub struct MalformedTimestampPathHttpDateInputFuture {
        8283  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampPathHttpDateInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        8284  +
    }
        8285  +
}
        8286  +
        8287  +
impl std::future::Future for MalformedTimestampPathHttpDateInputFuture {
        8288  +
    type Output = Result<
        8289  +
        crate::input::MalformedTimestampPathHttpDateInput,
        8290  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        8291  +
    >;
        8292  +
        8293  +
    fn poll(
        8294  +
        self: std::pin::Pin<&mut Self>,
        8295  +
        cx: &mut std::task::Context<'_>,
        8296  +
    ) -> std::task::Poll<Self::Output> {
        8297  +
        let this = self.project();
        8298  +
        this.inner.as_mut().poll(cx)
        8299  +
    }
        8300  +
}
        8301  +
        8302  +
impl<B>
        8303  +
    ::aws_smithy_http_server::request::FromRequest<
        8304  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        8305  +
        B,
        8306  +
    > for crate::input::MalformedTimestampPathHttpDateInput
        8307  +
where
        8308  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        8309  +
    B: 'static,
        8310  +
        8311  +
    B::Data: Send,
        8312  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        8313  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        8314  +
{
        8315  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        8316  +
    type Future = MalformedTimestampPathHttpDateInputFuture;
        8317  +
        8318  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        8319  +
        let fut = async move {
        8320  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        8321  +
                request.headers(),
        8322  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHHTTPDATE,
        8323  +
            ) {
        8324  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        8325  +
            }
        8326  +
            crate::protocol_serde::shape_malformed_timestamp_path_http_date::de_malformed_timestamp_path_http_date_http_request(request)
        8327  +
                            .await
        8328  +
                            .map_err(Into::into)
        8329  +
        };
        8330  +
        use ::futures_util::future::TryFutureExt;
        8331  +
        let fut = fut.map_err(
        8332  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        8333  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        8334  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        8335  +
                    e,
        8336  +
                )
        8337  +
            },
        8338  +
        );
        8339  +
        MalformedTimestampPathHttpDateInputFuture {
        8340  +
            inner: Box::pin(fut),
        8341  +
        }
        8342  +
    }
        8343  +
}
        8344  +
impl
        8345  +
    ::aws_smithy_http_server::response::IntoResponse<
        8346  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        8347  +
    > for crate::output::MalformedTimestampPathHttpDateOutput
        8348  +
{
        8349  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        8350  +
        match crate::protocol_serde::shape_malformed_timestamp_path_http_date::ser_malformed_timestamp_path_http_date_http_response(self) {
        8351  +
                        Ok(response) => response,
        8352  +
                        Err(e) => {
        8353  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        8354  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        8355  +
                        }
        8356  +
                    }
        8357  +
    }
        8358  +
}
        8359  +
impl
        8360  +
    ::aws_smithy_http_server::response::IntoResponse<
        8361  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        8362  +
    > for crate::error::MalformedTimestampPathHttpDateError
        8363  +
{
        8364  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        8365  +
        match crate::protocol_serde::shape_malformed_timestamp_path_http_date::ser_malformed_timestamp_path_http_date_http_error(&self) {
        8366  +
            Ok(mut response) => {
        8367  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        8368  +
                response
        8369  +
            },
        8370  +
            Err(e) => {
        8371  +
                ::tracing::error!(error = %e, "failed to serialize response");
        8372  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        8373  +
            }
        8374  +
        }
        8375  +
    }
        8376  +
}
        8377  +
        8378  +
#[allow(unreachable_code, unused_variables)]
        8379  +
#[cfg(test)]
        8380  +
mod malformed_timestamp_path_http_date_test {
        8381  +
        8382  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        8383  +
    /// 400 SerializationException
        8384  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case0
        8385  +
    #[::tokio::test]
        8386  +
    #[::tracing_test::traced_test]
        8387  +
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case0_malformed_request() {
        8388  +
        {
        8389  +
            #[allow(unused_mut)]
        8390  +
            let mut http_request = http::Request::builder()
        8391  +
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50.52Z")
        8392  +
                .method("POST")
        8393  +
                .body(::aws_smithy_http_server::body::Body::empty())
        8394  +
                .unwrap();
        8395  +
            #[allow(unused_mut)]
        8396  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10795   8397   
            let config = crate::service::RestJsonConfig::builder().build();
10796   8398   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10797         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8399  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
10798   8400   
                                let sender = sender.clone();
10799   8401   
                                async move {
10800         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8402  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
10801   8403   
                                    sender.send(()).await.expect("receiver dropped early");
10802   8404   
                                    result
10803   8405   
                                }
10804   8406   
                            })
10805   8407   
                            .build_unchecked();
10806   8408   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10807   8409   
                .await
10808   8410   
                .expect("unable to make an HTTP request");
10809   8411   
            ::pretty_assertions::assert_eq!(
10810   8412   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10811   8413   
                http_response.status()
10812   8414   
            );
10813   8415   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10814   8416   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10815   8417   
                http_response.headers(),
10816   8418   
                expected_headers,
10817   8419   
            ));
10818   8420   
        }
10819   8421   
    }
10820         -
    /// Attempted string coercion should result in SerializationException
10821         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case2
        8422  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        8423  +
    /// 400 SerializationException
        8424  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case1
10822   8425   
    #[::tokio::test]
10823         -
    async fn rest_json_path_boolean_string_coercion_case2_malformed_request() {
        8426  +
    #[::tracing_test::traced_test]
        8427  +
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case1_malformed_request() {
10824   8428   
        {
10825   8429   
            #[allow(unused_mut)]
10826   8430   
            let mut http_request = http::Request::builder()
10827         -
                .uri("/MalformedBoolean/y")
        8431  +
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50Z")
10828   8432   
                .method("POST")
10829   8433   
                .body(::aws_smithy_http_server::body::Body::empty())
10830   8434   
                .unwrap();
10831   8435   
            #[allow(unused_mut)]
10832   8436   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10833   8437   
            let config = crate::service::RestJsonConfig::builder().build();
10834   8438   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10835         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8439  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
10836   8440   
                                let sender = sender.clone();
10837   8441   
                                async move {
10838         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8442  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
10839   8443   
                                    sender.send(()).await.expect("receiver dropped early");
10840   8444   
                                    result
10841   8445   
                                }
10842   8446   
                            })
10843   8447   
                            .build_unchecked();
10844   8448   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10845   8449   
                .await
10846   8450   
                .expect("unable to make an HTTP request");
10847   8451   
            ::pretty_assertions::assert_eq!(
10848   8452   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10849   8453   
                http_response.status()
10850   8454   
            );
10851   8455   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10852   8456   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10853   8457   
                http_response.headers(),
10854   8458   
                expected_headers,
10855   8459   
            ));
10856   8460   
        }
10857   8461   
    }
10858         -
    /// Attempted string coercion should result in SerializationException
10859         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case3
        8462  +
    /// When the format is http-date, RFC3339 timestamps are rejected with a
        8463  +
    /// 400 SerializationException
        8464  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case2
10860   8465   
    #[::tokio::test]
10861         -
    async fn rest_json_path_boolean_string_coercion_case3_malformed_request() {
        8466  +
    #[::tracing_test::traced_test]
        8467  +
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case2_malformed_request() {
10862   8468   
        {
10863   8469   
            #[allow(unused_mut)]
10864   8470   
            let mut http_request = http::Request::builder()
10865         -
                .uri("/MalformedBoolean/Y")
        8471  +
                .uri("/MalformedTimestampPathHttpDate/1996-12-19T16%3A39%3A57-08%3A00")
10866   8472   
                .method("POST")
10867   8473   
                .body(::aws_smithy_http_server::body::Body::empty())
10868   8474   
                .unwrap();
10869   8475   
            #[allow(unused_mut)]
10870   8476   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10871   8477   
            let config = crate::service::RestJsonConfig::builder().build();
10872   8478   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10873         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8479  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
10874   8480   
                                let sender = sender.clone();
10875   8481   
                                async move {
10876         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8482  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
10877   8483   
                                    sender.send(()).await.expect("receiver dropped early");
10878   8484   
                                    result
10879   8485   
                                }
10880   8486   
                            })
10881   8487   
                            .build_unchecked();
10882   8488   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10883   8489   
                .await
10884   8490   
                .expect("unable to make an HTTP request");
10885   8491   
            ::pretty_assertions::assert_eq!(
10886   8492   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10887   8493   
                http_response.status()
10888   8494   
            );
10889   8495   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10890   8496   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10891   8497   
                http_response.headers(),
10892   8498   
                expected_headers,
10893   8499   
            ));
10894   8500   
        }
10895   8501   
    }
10896         -
    /// Attempted string coercion should result in SerializationException
10897         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case4
        8502  +
    /// When the format is http-date,  epoch second timestamps are rejected with a
        8503  +
    /// 400 SerializationException
        8504  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case0
10898   8505   
    #[::tokio::test]
10899         -
    async fn rest_json_path_boolean_string_coercion_case4_malformed_request() {
        8506  +
    #[::tracing_test::traced_test]
        8507  +
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
10900   8508   
        {
10901   8509   
            #[allow(unused_mut)]
10902   8510   
            let mut http_request = http::Request::builder()
10903         -
                .uri("/MalformedBoolean/yes")
        8511  +
                .uri("/MalformedTimestampPathHttpDate/1515531081.1234")
10904   8512   
                .method("POST")
10905   8513   
                .body(::aws_smithy_http_server::body::Body::empty())
10906   8514   
                .unwrap();
10907   8515   
            #[allow(unused_mut)]
10908   8516   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10909   8517   
            let config = crate::service::RestJsonConfig::builder().build();
10910   8518   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10911         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8519  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
10912   8520   
                                let sender = sender.clone();
10913   8521   
                                async move {
10914         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8522  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
10915   8523   
                                    sender.send(()).await.expect("receiver dropped early");
10916   8524   
                                    result
10917   8525   
                                }
10918   8526   
                            })
10919   8527   
                            .build_unchecked();
10920   8528   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10921   8529   
                .await
10922   8530   
                .expect("unable to make an HTTP request");
10923   8531   
            ::pretty_assertions::assert_eq!(
10924   8532   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10925   8533   
                http_response.status()
10926   8534   
            );
10927   8535   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10928   8536   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10929   8537   
                http_response.headers(),
10930   8538   
                expected_headers,
10931   8539   
            ));
10932   8540   
        }
10933   8541   
    }
10934         -
    /// Attempted string coercion should result in SerializationException
10935         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case5
        8542  +
    /// When the format is http-date,  epoch second timestamps are rejected with a
        8543  +
    /// 400 SerializationException
        8544  +
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case1
10936   8545   
    #[::tokio::test]
10937         -
    async fn rest_json_path_boolean_string_coercion_case5_malformed_request() {
        8546  +
    #[::tracing_test::traced_test]
        8547  +
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
10938   8548   
        {
10939   8549   
            #[allow(unused_mut)]
10940   8550   
            let mut http_request = http::Request::builder()
10941         -
                .uri("/MalformedBoolean/Yes")
        8551  +
                .uri("/MalformedTimestampPathHttpDate/1515531081")
10942   8552   
                .method("POST")
10943   8553   
                .body(::aws_smithy_http_server::body::Body::empty())
10944   8554   
                .unwrap();
10945   8555   
            #[allow(unused_mut)]
10946   8556   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10947   8557   
            let config = crate::service::RestJsonConfig::builder().build();
10948   8558   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10949         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8559  +
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
10950   8560   
                                let sender = sender.clone();
10951   8561   
                                async move {
10952         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8562  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
10953   8563   
                                    sender.send(()).await.expect("receiver dropped early");
10954   8564   
                                    result
10955   8565   
                                }
10956   8566   
                            })
10957   8567   
                            .build_unchecked();
10958   8568   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10959   8569   
                .await
10960   8570   
                .expect("unable to make an HTTP request");
10961   8571   
            ::pretty_assertions::assert_eq!(
10962   8572   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
10963   8573   
                http_response.status()
10964   8574   
            );
10965   8575   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
10966   8576   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
10967   8577   
                http_response.headers(),
10968   8578   
                expected_headers,
10969   8579   
            ));
10970   8580   
        }
10971   8581   
    }
10972         -
    /// Attempted string coercion should result in SerializationException
10973         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case6
        8582  +
}
        8583  +
        8584  +
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
        8585  +
::pin_project_lite::pin_project! {
        8586  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        8587  +
    /// [`MalformedTimestampPathDefaultInput`](crate::input::MalformedTimestampPathDefaultInput) using modelled bindings.
        8588  +
    pub struct MalformedTimestampPathDefaultInputFuture {
        8589  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampPathDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        8590  +
    }
        8591  +
}
        8592  +
        8593  +
impl std::future::Future for MalformedTimestampPathDefaultInputFuture {
        8594  +
    type Output = Result<
        8595  +
        crate::input::MalformedTimestampPathDefaultInput,
        8596  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        8597  +
    >;
        8598  +
        8599  +
    fn poll(
        8600  +
        self: std::pin::Pin<&mut Self>,
        8601  +
        cx: &mut std::task::Context<'_>,
        8602  +
    ) -> std::task::Poll<Self::Output> {
        8603  +
        let this = self.project();
        8604  +
        this.inner.as_mut().poll(cx)
        8605  +
    }
        8606  +
}
        8607  +
        8608  +
impl<B>
        8609  +
    ::aws_smithy_http_server::request::FromRequest<
        8610  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        8611  +
        B,
        8612  +
    > for crate::input::MalformedTimestampPathDefaultInput
        8613  +
where
        8614  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        8615  +
    B: 'static,
        8616  +
        8617  +
    B::Data: Send,
        8618  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        8619  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        8620  +
{
        8621  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        8622  +
    type Future = MalformedTimestampPathDefaultInputFuture;
        8623  +
        8624  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        8625  +
        let fut = async move {
        8626  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        8627  +
                request.headers(),
        8628  +
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHDEFAULT,
        8629  +
            ) {
        8630  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        8631  +
            }
        8632  +
            crate::protocol_serde::shape_malformed_timestamp_path_default::de_malformed_timestamp_path_default_http_request(request)
        8633  +
                            .await
        8634  +
                            .map_err(Into::into)
        8635  +
        };
        8636  +
        use ::futures_util::future::TryFutureExt;
        8637  +
        let fut = fut.map_err(
        8638  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        8639  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        8640  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        8641  +
                    e,
        8642  +
                )
        8643  +
            },
        8644  +
        );
        8645  +
        MalformedTimestampPathDefaultInputFuture {
        8646  +
            inner: Box::pin(fut),
        8647  +
        }
        8648  +
    }
        8649  +
}
        8650  +
impl
        8651  +
    ::aws_smithy_http_server::response::IntoResponse<
        8652  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        8653  +
    > for crate::output::MalformedTimestampPathDefaultOutput
        8654  +
{
        8655  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        8656  +
        match crate::protocol_serde::shape_malformed_timestamp_path_default::ser_malformed_timestamp_path_default_http_response(self) {
        8657  +
                        Ok(response) => response,
        8658  +
                        Err(e) => {
        8659  +
                            ::tracing::error!(error = %e, "failed to serialize response");
        8660  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        8661  +
                        }
        8662  +
                    }
        8663  +
    }
        8664  +
}
        8665  +
impl
        8666  +
    ::aws_smithy_http_server::response::IntoResponse<
        8667  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        8668  +
    > for crate::error::MalformedTimestampPathDefaultError
        8669  +
{
        8670  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        8671  +
        match crate::protocol_serde::shape_malformed_timestamp_path_default::ser_malformed_timestamp_path_default_http_error(&self) {
        8672  +
            Ok(mut response) => {
        8673  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
        8674  +
                response
        8675  +
            },
        8676  +
            Err(e) => {
        8677  +
                ::tracing::error!(error = %e, "failed to serialize response");
        8678  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        8679  +
            }
        8680  +
        }
        8681  +
    }
        8682  +
}
        8683  +
        8684  +
#[allow(unreachable_code, unused_variables)]
        8685  +
#[cfg(test)]
        8686  +
mod malformed_timestamp_path_default_test {
        8687  +
        8688  +
    /// By default, IMF-fixdate timestamps are rejected with a
        8689  +
    /// 400 SerializationException
        8690  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsHttpDate_case0
10974   8691   
    #[::tokio::test]
10975         -
    async fn rest_json_path_boolean_string_coercion_case6_malformed_request() {
        8692  +
    #[::tracing_test::traced_test]
        8693  +
    async fn rest_json_path_timestamp_default_rejects_http_date_case0_malformed_request() {
10976   8694   
        {
10977   8695   
            #[allow(unused_mut)]
10978   8696   
            let mut http_request = http::Request::builder()
10979         -
                .uri("/MalformedBoolean/YES")
        8697  +
                .uri("/MalformedTimestampPathDefault/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
10980   8698   
                .method("POST")
10981   8699   
                .body(::aws_smithy_http_server::body::Body::empty())
10982   8700   
                .unwrap();
10983   8701   
            #[allow(unused_mut)]
10984   8702   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
10985   8703   
            let config = crate::service::RestJsonConfig::builder().build();
10986   8704   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
10987         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8705  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
10988   8706   
                                let sender = sender.clone();
10989   8707   
                                async move {
10990         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8708  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
10991   8709   
                                    sender.send(()).await.expect("receiver dropped early");
10992   8710   
                                    result
10993   8711   
                                }
10994   8712   
                            })
10995   8713   
                            .build_unchecked();
10996   8714   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
10997   8715   
                .await
10998   8716   
                .expect("unable to make an HTTP request");
10999   8717   
            ::pretty_assertions::assert_eq!(
11000   8718   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11001   8719   
                http_response.status()
11002   8720   
            );
11003   8721   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11004   8722   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11005   8723   
                http_response.headers(),
11006   8724   
                expected_headers,
11007   8725   
            ));
11008   8726   
        }
11009   8727   
    }
11010         -
    /// Attempted string coercion should result in SerializationException
11011         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case7
        8728  +
    /// By default, IMF-fixdate timestamps are rejected with a
        8729  +
    /// 400 SerializationException
        8730  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsHttpDate_case1
11012   8731   
    #[::tokio::test]
11013         -
    async fn rest_json_path_boolean_string_coercion_case7_malformed_request() {
        8732  +
    #[::tracing_test::traced_test]
        8733  +
    async fn rest_json_path_timestamp_default_rejects_http_date_case1_malformed_request() {
11014   8734   
        {
11015   8735   
            #[allow(unused_mut)]
11016   8736   
                        let mut http_request = http::Request::builder()
11017         -
                .uri("/MalformedBoolean/1")
        8737  +
                            .uri("/MalformedTimestampPathDefault/Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT")
11018   8738   
                            .method("POST")
11019         -
                .body(::aws_smithy_http_server::body::Body::empty())
11020         -
                .unwrap();
        8739  +
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
11021   8740   
            #[allow(unused_mut)]
11022   8741   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11023   8742   
            let config = crate::service::RestJsonConfig::builder().build();
11024   8743   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11025         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8744  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11026   8745   
                                let sender = sender.clone();
11027   8746   
                                async move {
11028         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8747  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11029   8748   
                                    sender.send(()).await.expect("receiver dropped early");
11030   8749   
                                    result
11031   8750   
                                }
11032   8751   
                            })
11033   8752   
                            .build_unchecked();
11034   8753   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11035   8754   
                .await
11036   8755   
                .expect("unable to make an HTTP request");
11037   8756   
            ::pretty_assertions::assert_eq!(
11038   8757   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11039   8758   
                http_response.status()
11040   8759   
            );
11041   8760   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11042   8761   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11043   8762   
                http_response.headers(),
11044   8763   
                expected_headers,
11045   8764   
            ));
11046   8765   
        }
11047   8766   
    }
11048         -
    /// Attempted string coercion should result in SerializationException
11049         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case8
        8767  +
    /// By default, epoch second timestamps are rejected with a
        8768  +
    /// 400 SerializationException
        8769  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case0
11050   8770   
    #[::tokio::test]
11051         -
    async fn rest_json_path_boolean_string_coercion_case8_malformed_request() {
        8771  +
    #[::tracing_test::traced_test]
        8772  +
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
11052   8773   
        {
11053   8774   
            #[allow(unused_mut)]
11054   8775   
            let mut http_request = http::Request::builder()
11055         -
                .uri("/MalformedBoolean/on")
        8776  +
                .uri("/MalformedTimestampPathDefault/1515531081.1234")
11056   8777   
                .method("POST")
11057   8778   
                .body(::aws_smithy_http_server::body::Body::empty())
11058   8779   
                .unwrap();
11059   8780   
            #[allow(unused_mut)]
11060   8781   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11061   8782   
            let config = crate::service::RestJsonConfig::builder().build();
11062   8783   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11063         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8784  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11064   8785   
                                let sender = sender.clone();
11065   8786   
                                async move {
11066         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8787  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11067   8788   
                                    sender.send(()).await.expect("receiver dropped early");
11068   8789   
                                    result
11069   8790   
                                }
11070   8791   
                            })
11071   8792   
                            .build_unchecked();
11072   8793   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11073   8794   
                .await
11074   8795   
                .expect("unable to make an HTTP request");
11075   8796   
            ::pretty_assertions::assert_eq!(
11076   8797   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11077   8798   
                http_response.status()
11078   8799   
            );
11079   8800   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11080   8801   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11081   8802   
                http_response.headers(),
11082   8803   
                expected_headers,
11083   8804   
            ));
11084   8805   
        }
11085   8806   
    }
11086         -
    /// Attempted string coercion should result in SerializationException
11087         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case9
        8807  +
    /// By default, epoch second timestamps are rejected with a
        8808  +
    /// 400 SerializationException
        8809  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case1
11088   8810   
    #[::tokio::test]
11089         -
    async fn rest_json_path_boolean_string_coercion_case9_malformed_request() {
        8811  +
    #[::tracing_test::traced_test]
        8812  +
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
11090   8813   
        {
11091   8814   
            #[allow(unused_mut)]
11092   8815   
            let mut http_request = http::Request::builder()
11093         -
                .uri("/MalformedBoolean/On")
        8816  +
                .uri("/MalformedTimestampPathDefault/1515531081")
11094   8817   
                .method("POST")
11095   8818   
                .body(::aws_smithy_http_server::body::Body::empty())
11096   8819   
                .unwrap();
11097   8820   
            #[allow(unused_mut)]
11098   8821   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11099   8822   
            let config = crate::service::RestJsonConfig::builder().build();
11100   8823   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11101         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8824  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11102   8825   
                                let sender = sender.clone();
11103   8826   
                                async move {
11104         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8827  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11105   8828   
                                    sender.send(()).await.expect("receiver dropped early");
11106   8829   
                                    result
11107   8830   
                                }
11108   8831   
                            })
11109   8832   
                            .build_unchecked();
11110   8833   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11111   8834   
                .await
11112   8835   
                .expect("unable to make an HTTP request");
11113   8836   
            ::pretty_assertions::assert_eq!(
11114   8837   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11115   8838   
                http_response.status()
11116   8839   
            );
11117   8840   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11118   8841   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11119   8842   
                http_response.headers(),
11120   8843   
                expected_headers,
11121   8844   
            ));
11122   8845   
        }
11123   8846   
    }
11124         -
    /// Attempted string coercion should result in SerializationException
11125         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case10
        8847  +
    /// UTC offsets must be rejected with a
        8848  +
    /// 400 SerializationException
        8849  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsUTCOffsets
11126   8850   
    #[::tokio::test]
11127         -
    async fn rest_json_path_boolean_string_coercion_case10_malformed_request() {
        8851  +
    #[::tracing_test::traced_test]
        8852  +
    async fn rest_json_path_timestamp_default_rejects_utc_offsets_malformed_request() {
11128   8853   
        {
11129   8854   
            #[allow(unused_mut)]
11130   8855   
            let mut http_request = http::Request::builder()
11131         -
                .uri("/MalformedBoolean/ON")
        8856  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57-08%3A00")
11132   8857   
                .method("POST")
11133   8858   
                .body(::aws_smithy_http_server::body::Body::empty())
11134   8859   
                .unwrap();
11135   8860   
            #[allow(unused_mut)]
11136   8861   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11137   8862   
            let config = crate::service::RestJsonConfig::builder().build();
11138   8863   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11139         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8864  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11140   8865   
                                let sender = sender.clone();
11141   8866   
                                async move {
11142         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8867  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11143   8868   
                                    sender.send(()).await.expect("receiver dropped early");
11144   8869   
                                    result
11145   8870   
                                }
11146   8871   
                            })
11147   8872   
                            .build_unchecked();
11148   8873   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11149   8874   
                .await
11150   8875   
                .expect("unable to make an HTTP request");
11151   8876   
            ::pretty_assertions::assert_eq!(
11152   8877   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11153   8878   
                http_response.status()
11154   8879   
            );
11155   8880   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11156   8881   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11157   8882   
                http_response.headers(),
11158   8883   
                expected_headers,
11159   8884   
            ));
11160   8885   
        }
11161   8886   
    }
11162         -
    /// Attempted string coercion should result in SerializationException
11163         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case11
        8887  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        8888  +
    /// are rejected with a 400 SerializationException
        8889  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case0
11164   8890   
    #[::tokio::test]
11165         -
    async fn rest_json_path_boolean_string_coercion_case11_malformed_request() {
        8891  +
    #[::tracing_test::traced_test]
        8892  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case0_malformed_request(
        8893  +
    ) {
11166   8894   
        {
11167   8895   
            #[allow(unused_mut)]
11168   8896   
            let mut http_request = http::Request::builder()
11169         -
                .uri("/MalformedBoolean/False")
        8897  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00")
11170   8898   
                .method("POST")
11171   8899   
                .body(::aws_smithy_http_server::body::Body::empty())
11172   8900   
                .unwrap();
11173   8901   
            #[allow(unused_mut)]
11174   8902   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11175   8903   
            let config = crate::service::RestJsonConfig::builder().build();
11176   8904   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11177         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8905  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11178   8906   
                                let sender = sender.clone();
11179   8907   
                                async move {
11180         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8908  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11181   8909   
                                    sender.send(()).await.expect("receiver dropped early");
11182   8910   
                                    result
11183   8911   
                                }
11184   8912   
                            })
11185   8913   
                            .build_unchecked();
11186   8914   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11187   8915   
                .await
11188   8916   
                .expect("unable to make an HTTP request");
11189   8917   
            ::pretty_assertions::assert_eq!(
11190   8918   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11191   8919   
                http_response.status()
11192   8920   
            );
11193   8921   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11194   8922   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11195   8923   
                http_response.headers(),
11196   8924   
                expected_headers,
11197   8925   
            ));
11198   8926   
        }
11199   8927   
    }
11200         -
    /// Attempted string coercion should result in SerializationException
11201         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case12
        8928  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        8929  +
    /// are rejected with a 400 SerializationException
        8930  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case1
11202   8931   
    #[::tokio::test]
11203         -
    async fn rest_json_path_boolean_string_coercion_case12_malformed_request() {
        8932  +
    #[::tracing_test::traced_test]
        8933  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case1_malformed_request(
        8934  +
    ) {
11204   8935   
        {
11205   8936   
            #[allow(unused_mut)]
11206   8937   
            let mut http_request = http::Request::builder()
11207         -
                .uri("/MalformedBoolean/FALSE")
        8938  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00Z")
11208   8939   
                .method("POST")
11209   8940   
                .body(::aws_smithy_http_server::body::Body::empty())
11210   8941   
                .unwrap();
11211   8942   
            #[allow(unused_mut)]
11212   8943   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11213   8944   
            let config = crate::service::RestJsonConfig::builder().build();
11214   8945   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11215         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8946  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11216   8947   
                                let sender = sender.clone();
11217   8948   
                                async move {
11218         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8949  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11219   8950   
                                    sender.send(()).await.expect("receiver dropped early");
11220   8951   
                                    result
11221   8952   
                                }
11222   8953   
                            })
11223   8954   
                            .build_unchecked();
11224   8955   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11225   8956   
                .await
11226   8957   
                .expect("unable to make an HTTP request");
11227   8958   
            ::pretty_assertions::assert_eq!(
11228   8959   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11229   8960   
                http_response.status()
11230   8961   
            );
11231   8962   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11232   8963   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11233   8964   
                http_response.headers(),
11234   8965   
                expected_headers,
11235   8966   
            ));
11236   8967   
        }
11237   8968   
    }
11238         -
    /// Attempted string coercion should result in SerializationException
11239         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case13
        8969  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        8970  +
    /// are rejected with a 400 SerializationException
        8971  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case2
11240   8972   
    #[::tokio::test]
11241         -
    async fn rest_json_path_boolean_string_coercion_case13_malformed_request() {
        8973  +
    #[::tracing_test::traced_test]
        8974  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case2_malformed_request(
        8975  +
    ) {
11242   8976   
        {
11243   8977   
            #[allow(unused_mut)]
11244   8978   
            let mut http_request = http::Request::builder()
11245         -
                .uri("/MalformedBoolean/n")
        8979  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57")
11246   8980   
                .method("POST")
11247   8981   
                .body(::aws_smithy_http_server::body::Body::empty())
11248   8982   
                .unwrap();
11249   8983   
            #[allow(unused_mut)]
11250   8984   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11251   8985   
            let config = crate::service::RestJsonConfig::builder().build();
11252   8986   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11253         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        8987  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11254   8988   
                                let sender = sender.clone();
11255   8989   
                                async move {
11256         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        8990  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11257   8991   
                                    sender.send(()).await.expect("receiver dropped early");
11258   8992   
                                    result
11259   8993   
                                }
11260   8994   
                            })
11261   8995   
                            .build_unchecked();
11262   8996   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11263   8997   
                .await
11264   8998   
                .expect("unable to make an HTTP request");
11265   8999   
            ::pretty_assertions::assert_eq!(
11266   9000   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11267   9001   
                http_response.status()
11268   9002   
            );
11269   9003   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11270   9004   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11271   9005   
                http_response.headers(),
11272   9006   
                expected_headers,
11273   9007   
            ));
11274   9008   
        }
11275   9009   
    }
11276         -
    /// Attempted string coercion should result in SerializationException
11277         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case14
        9010  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9011  +
    /// are rejected with a 400 SerializationException
        9012  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case3
11278   9013   
    #[::tokio::test]
11279         -
    async fn rest_json_path_boolean_string_coercion_case14_malformed_request() {
        9014  +
    #[::tracing_test::traced_test]
        9015  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case3_malformed_request(
        9016  +
    ) {
11280   9017   
        {
11281   9018   
            #[allow(unused_mut)]
11282   9019   
            let mut http_request = http::Request::builder()
11283         -
                .uri("/MalformedBoolean/N")
        9020  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T163957")
11284   9021   
                .method("POST")
11285   9022   
                .body(::aws_smithy_http_server::body::Body::empty())
11286   9023   
                .unwrap();
11287   9024   
            #[allow(unused_mut)]
11288   9025   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11289   9026   
            let config = crate::service::RestJsonConfig::builder().build();
11290   9027   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11291         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9028  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11292   9029   
                                let sender = sender.clone();
11293   9030   
                                async move {
11294         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9031  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11295   9032   
                                    sender.send(()).await.expect("receiver dropped early");
11296   9033   
                                    result
11297   9034   
                                }
11298   9035   
                            })
11299   9036   
                            .build_unchecked();
11300   9037   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11301   9038   
                .await
11302   9039   
                .expect("unable to make an HTTP request");
11303   9040   
            ::pretty_assertions::assert_eq!(
11304   9041   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11305   9042   
                http_response.status()
11306   9043   
            );
11307   9044   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11308   9045   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11309   9046   
                http_response.headers(),
11310   9047   
                expected_headers,
11311   9048   
            ));
11312   9049   
        }
11313   9050   
    }
11314         -
    /// Attempted string coercion should result in SerializationException
11315         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case15
        9051  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9052  +
    /// are rejected with a 400 SerializationException
        9053  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case4
11316   9054   
    #[::tokio::test]
11317         -
    async fn rest_json_path_boolean_string_coercion_case15_malformed_request() {
        9055  +
    #[::tracing_test::traced_test]
        9056  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case4_malformed_request(
        9057  +
    ) {
11318   9058   
        {
11319   9059   
            #[allow(unused_mut)]
11320   9060   
            let mut http_request = http::Request::builder()
11321         -
                .uri("/MalformedBoolean/no")
        9061  +
                .uri("/MalformedTimestampPathDefault/19961219T163957Z")
11322   9062   
                .method("POST")
11323   9063   
                .body(::aws_smithy_http_server::body::Body::empty())
11324   9064   
                .unwrap();
11325   9065   
            #[allow(unused_mut)]
11326   9066   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11327   9067   
            let config = crate::service::RestJsonConfig::builder().build();
11328   9068   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11329         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9069  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11330   9070   
                                let sender = sender.clone();
11331   9071   
                                async move {
11332         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9072  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11333   9073   
                                    sender.send(()).await.expect("receiver dropped early");
11334   9074   
                                    result
11335   9075   
                                }
11336   9076   
                            })
11337   9077   
                            .build_unchecked();
11338   9078   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11339   9079   
                .await
11340   9080   
                .expect("unable to make an HTTP request");
11341   9081   
            ::pretty_assertions::assert_eq!(
11342   9082   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11343   9083   
                http_response.status()
11344   9084   
            );
11345   9085   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11346   9086   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11347   9087   
                http_response.headers(),
11348   9088   
                expected_headers,
11349   9089   
            ));
11350   9090   
        }
11351   9091   
    }
11352         -
    /// Attempted string coercion should result in SerializationException
11353         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case16
        9092  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9093  +
    /// are rejected with a 400 SerializationException
        9094  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case5
11354   9095   
    #[::tokio::test]
11355         -
    async fn rest_json_path_boolean_string_coercion_case16_malformed_request() {
        9096  +
    #[::tracing_test::traced_test]
        9097  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case5_malformed_request(
        9098  +
    ) {
11356   9099   
        {
11357   9100   
            #[allow(unused_mut)]
11358   9101   
            let mut http_request = http::Request::builder()
11359         -
                .uri("/MalformedBoolean/No")
        9102  +
                .uri("/MalformedTimestampPathDefault/19961219T163957")
11360   9103   
                .method("POST")
11361   9104   
                .body(::aws_smithy_http_server::body::Body::empty())
11362   9105   
                .unwrap();
11363   9106   
            #[allow(unused_mut)]
11364   9107   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11365   9108   
            let config = crate::service::RestJsonConfig::builder().build();
11366   9109   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11367         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9110  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11368   9111   
                                let sender = sender.clone();
11369   9112   
                                async move {
11370         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9113  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11371   9114   
                                    sender.send(()).await.expect("receiver dropped early");
11372   9115   
                                    result
11373   9116   
                                }
11374   9117   
                            })
11375   9118   
                            .build_unchecked();
11376   9119   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11377   9120   
                .await
11378   9121   
                .expect("unable to make an HTTP request");
11379   9122   
            ::pretty_assertions::assert_eq!(
11380   9123   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11381   9124   
                http_response.status()
11382   9125   
            );
11383   9126   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11384   9127   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11385   9128   
                http_response.headers(),
11386   9129   
                expected_headers,
11387   9130   
            ));
11388   9131   
        }
11389   9132   
    }
11390         -
    /// Attempted string coercion should result in SerializationException
11391         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case17
        9133  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9134  +
    /// are rejected with a 400 SerializationException
        9135  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case6
11392   9136   
    #[::tokio::test]
11393         -
    async fn rest_json_path_boolean_string_coercion_case17_malformed_request() {
        9137  +
    #[::tracing_test::traced_test]
        9138  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case6_malformed_request(
        9139  +
    ) {
11394   9140   
        {
11395   9141   
            #[allow(unused_mut)]
11396   9142   
            let mut http_request = http::Request::builder()
11397         -
                .uri("/MalformedBoolean/NO")
        9143  +
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57Z")
11398   9144   
                .method("POST")
11399   9145   
                .body(::aws_smithy_http_server::body::Body::empty())
11400   9146   
                .unwrap();
11401   9147   
            #[allow(unused_mut)]
11402   9148   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11403   9149   
            let config = crate::service::RestJsonConfig::builder().build();
11404   9150   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11405         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9151  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11406   9152   
                                let sender = sender.clone();
11407   9153   
                                async move {
11408         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9154  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11409   9155   
                                    sender.send(()).await.expect("receiver dropped early");
11410   9156   
                                    result
11411   9157   
                                }
11412   9158   
                            })
11413   9159   
                            .build_unchecked();
11414   9160   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11415   9161   
                .await
11416   9162   
                .expect("unable to make an HTTP request");
11417   9163   
            ::pretty_assertions::assert_eq!(
11418   9164   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11419   9165   
                http_response.status()
11420   9166   
            );
11421   9167   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11422   9168   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11423   9169   
                http_response.headers(),
11424   9170   
                expected_headers,
11425   9171   
            ));
11426   9172   
        }
11427   9173   
    }
11428         -
    /// Attempted string coercion should result in SerializationException
11429         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case18
        9174  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9175  +
    /// are rejected with a 400 SerializationException
        9176  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case7
11430   9177   
    #[::tokio::test]
11431         -
    async fn rest_json_path_boolean_string_coercion_case18_malformed_request() {
        9178  +
    #[::tracing_test::traced_test]
        9179  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case7_malformed_request(
        9180  +
    ) {
11432   9181   
        {
11433   9182   
            #[allow(unused_mut)]
11434   9183   
            let mut http_request = http::Request::builder()
11435         -
                .uri("/MalformedBoolean/0")
        9184  +
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57")
11436   9185   
                .method("POST")
11437   9186   
                .body(::aws_smithy_http_server::body::Body::empty())
11438   9187   
                .unwrap();
11439   9188   
            #[allow(unused_mut)]
11440   9189   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11441   9190   
            let config = crate::service::RestJsonConfig::builder().build();
11442   9191   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11443         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9192  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11444   9193   
                                let sender = sender.clone();
11445   9194   
                                async move {
11446         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9195  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11447   9196   
                                    sender.send(()).await.expect("receiver dropped early");
11448   9197   
                                    result
11449   9198   
                                }
11450   9199   
                            })
11451   9200   
                            .build_unchecked();
11452   9201   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11453   9202   
                .await
11454   9203   
                .expect("unable to make an HTTP request");
11455   9204   
            ::pretty_assertions::assert_eq!(
11456   9205   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11457   9206   
                http_response.status()
11458   9207   
            );
11459   9208   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11460   9209   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11461   9210   
                http_response.headers(),
11462   9211   
                expected_headers,
11463   9212   
            ));
11464   9213   
        }
11465   9214   
    }
11466         -
    /// Attempted string coercion should result in SerializationException
11467         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case19
        9215  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9216  +
    /// are rejected with a 400 SerializationException
        9217  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case8
11468   9218   
    #[::tokio::test]
11469         -
    async fn rest_json_path_boolean_string_coercion_case19_malformed_request() {
        9219  +
    #[::tracing_test::traced_test]
        9220  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case8_malformed_request(
        9221  +
    ) {
11470   9222   
        {
11471   9223   
            #[allow(unused_mut)]
11472   9224   
            let mut http_request = http::Request::builder()
11473         -
                .uri("/MalformedBoolean/off")
        9225  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39Z")
11474   9226   
                .method("POST")
11475   9227   
                .body(::aws_smithy_http_server::body::Body::empty())
11476   9228   
                .unwrap();
11477   9229   
            #[allow(unused_mut)]
11478   9230   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11479   9231   
            let config = crate::service::RestJsonConfig::builder().build();
11480   9232   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11481         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9233  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11482   9234   
                                let sender = sender.clone();
11483   9235   
                                async move {
11484         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9236  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11485   9237   
                                    sender.send(()).await.expect("receiver dropped early");
11486   9238   
                                    result
11487   9239   
                                }
11488   9240   
                            })
11489   9241   
                            .build_unchecked();
11490   9242   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11491   9243   
                .await
11492   9244   
                .expect("unable to make an HTTP request");
11493   9245   
            ::pretty_assertions::assert_eq!(
11494   9246   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11495   9247   
                http_response.status()
11496   9248   
            );
11497   9249   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11498   9250   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11499   9251   
                http_response.headers(),
11500   9252   
                expected_headers,
11501   9253   
            ));
11502   9254   
        }
11503   9255   
    }
11504         -
    /// Attempted string coercion should result in SerializationException
11505         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case20
        9256  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9257  +
    /// are rejected with a 400 SerializationException
        9258  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case9
11506   9259   
    #[::tokio::test]
11507         -
    async fn rest_json_path_boolean_string_coercion_case20_malformed_request() {
        9260  +
    #[::tracing_test::traced_test]
        9261  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case9_malformed_request(
        9262  +
    ) {
11508   9263   
        {
11509   9264   
            #[allow(unused_mut)]
11510   9265   
            let mut http_request = http::Request::builder()
11511         -
                .uri("/MalformedBoolean/Off")
        9266  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39")
11512   9267   
                .method("POST")
11513   9268   
                .body(::aws_smithy_http_server::body::Body::empty())
11514   9269   
                .unwrap();
11515   9270   
            #[allow(unused_mut)]
11516   9271   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11517   9272   
            let config = crate::service::RestJsonConfig::builder().build();
11518   9273   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11519         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9274  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11520   9275   
                                let sender = sender.clone();
11521   9276   
                                async move {
11522         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9277  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11523   9278   
                                    sender.send(()).await.expect("receiver dropped early");
11524   9279   
                                    result
11525   9280   
                                }
11526   9281   
                            })
11527   9282   
                            .build_unchecked();
11528   9283   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11529   9284   
                .await
11530   9285   
                .expect("unable to make an HTTP request");
11531   9286   
            ::pretty_assertions::assert_eq!(
11532   9287   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11533   9288   
                http_response.status()
11534   9289   
            );
11535   9290   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11536   9291   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11537   9292   
                http_response.headers(),
11538   9293   
                expected_headers,
11539   9294   
            ));
11540   9295   
        }
11541   9296   
    }
11542         -
    /// Attempted string coercion should result in SerializationException
11543         -
    /// Test ID: RestJsonPathBooleanStringCoercion_case21
        9297  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9298  +
    /// are rejected with a 400 SerializationException
        9299  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case10
11544   9300   
    #[::tokio::test]
11545         -
    async fn rest_json_path_boolean_string_coercion_case21_malformed_request() {
        9301  +
    #[::tracing_test::traced_test]
        9302  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case10_malformed_request(
        9303  +
    ) {
11546   9304   
        {
11547   9305   
            #[allow(unused_mut)]
11548   9306   
            let mut http_request = http::Request::builder()
11549         -
                .uri("/MalformedBoolean/OFF")
        9307  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T1639")
11550   9308   
                .method("POST")
11551   9309   
                .body(::aws_smithy_http_server::body::Body::empty())
11552   9310   
                .unwrap();
11553   9311   
            #[allow(unused_mut)]
11554   9312   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11555   9313   
            let config = crate::service::RestJsonConfig::builder().build();
11556   9314   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11557         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9315  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11558   9316   
                                let sender = sender.clone();
11559   9317   
                                async move {
11560         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9318  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11561   9319   
                                    sender.send(()).await.expect("receiver dropped early");
11562   9320   
                                    result
11563   9321   
                                }
11564   9322   
                            })
11565   9323   
                            .build_unchecked();
11566   9324   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11567   9325   
                .await
11568   9326   
                .expect("unable to make an HTTP request");
11569   9327   
            ::pretty_assertions::assert_eq!(
11570   9328   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11571   9329   
                http_response.status()
11572   9330   
            );
11573   9331   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11574   9332   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11575   9333   
                http_response.headers(),
11576   9334   
                expected_headers,
11577   9335   
            ));
11578   9336   
        }
11579   9337   
    }
11580         -
    /// Attempted string coercion should result in SerializationException
11581         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case0
        9338  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9339  +
    /// are rejected with a 400 SerializationException
        9340  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case11
11582   9341   
    #[::tokio::test]
11583         -
    async fn rest_json_query_boolean_string_coercion_case0_malformed_request() {
        9342  +
    #[::tracing_test::traced_test]
        9343  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case11_malformed_request(
        9344  +
    ) {
11584   9345   
        {
11585   9346   
            #[allow(unused_mut)]
11586   9347   
            let mut http_request = http::Request::builder()
11587         -
                .uri("/MalformedBoolean/true")
        9348  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16Z")
11588   9349   
                .method("POST")
11589   9350   
                .body(::aws_smithy_http_server::body::Body::empty())
11590   9351   
                .unwrap();
11591         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=True"
11592         -
                .parse()
11593         -
                .unwrap();
11594   9352   
            #[allow(unused_mut)]
11595   9353   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11596   9354   
            let config = crate::service::RestJsonConfig::builder().build();
11597   9355   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11598         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9356  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11599   9357   
                                let sender = sender.clone();
11600   9358   
                                async move {
11601         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9359  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11602   9360   
                                    sender.send(()).await.expect("receiver dropped early");
11603   9361   
                                    result
11604   9362   
                                }
11605   9363   
                            })
11606   9364   
                            .build_unchecked();
11607   9365   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11608   9366   
                .await
11609   9367   
                .expect("unable to make an HTTP request");
11610   9368   
            ::pretty_assertions::assert_eq!(
11611   9369   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11612   9370   
                http_response.status()
11613   9371   
            );
11614   9372   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11615   9373   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11616   9374   
                http_response.headers(),
11617   9375   
                expected_headers,
11618   9376   
            ));
11619   9377   
        }
11620   9378   
    }
11621         -
    /// Attempted string coercion should result in SerializationException
11622         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case1
        9379  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9380  +
    /// are rejected with a 400 SerializationException
        9381  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case12
11623   9382   
    #[::tokio::test]
11624         -
    async fn rest_json_query_boolean_string_coercion_case1_malformed_request() {
        9383  +
    #[::tracing_test::traced_test]
        9384  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case12_malformed_request(
        9385  +
    ) {
11625   9386   
        {
11626   9387   
            #[allow(unused_mut)]
11627   9388   
            let mut http_request = http::Request::builder()
11628         -
                .uri("/MalformedBoolean/true")
        9389  +
                .uri("/MalformedTimestampPathDefault/1996-12-19T16")
11629   9390   
                .method("POST")
11630   9391   
                .body(::aws_smithy_http_server::body::Body::empty())
11631   9392   
                .unwrap();
11632         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=TRUE"
11633         -
                .parse()
11634         -
                .unwrap();
11635   9393   
            #[allow(unused_mut)]
11636   9394   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11637   9395   
            let config = crate::service::RestJsonConfig::builder().build();
11638   9396   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11639         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9397  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11640   9398   
                                let sender = sender.clone();
11641   9399   
                                async move {
11642         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9400  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11643   9401   
                                    sender.send(()).await.expect("receiver dropped early");
11644   9402   
                                    result
11645   9403   
                                }
11646   9404   
                            })
11647   9405   
                            .build_unchecked();
11648   9406   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11649   9407   
                .await
11650   9408   
                .expect("unable to make an HTTP request");
11651   9409   
            ::pretty_assertions::assert_eq!(
11652   9410   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11653   9411   
                http_response.status()
11654   9412   
            );
11655   9413   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11656   9414   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11657   9415   
                http_response.headers(),
11658   9416   
                expected_headers,
11659   9417   
            ));
11660   9418   
        }
11661   9419   
    }
11662         -
    /// Attempted string coercion should result in SerializationException
11663         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case2
        9420  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9421  +
    /// are rejected with a 400 SerializationException
        9422  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case13
11664   9423   
    #[::tokio::test]
11665         -
    async fn rest_json_query_boolean_string_coercion_case2_malformed_request() {
        9424  +
    #[::tracing_test::traced_test]
        9425  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case13_malformed_request(
        9426  +
    ) {
11666   9427   
        {
11667   9428   
            #[allow(unused_mut)]
11668   9429   
            let mut http_request = http::Request::builder()
11669         -
                .uri("/MalformedBoolean/true")
        9430  +
                .uri("/MalformedTimestampPathDefault/1996-12-19%2016%3A39%3A57Z")
11670   9431   
                .method("POST")
11671   9432   
                .body(::aws_smithy_http_server::body::Body::empty())
11672   9433   
                .unwrap();
11673         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=y".parse().unwrap();
11674   9434   
            #[allow(unused_mut)]
11675   9435   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11676   9436   
            let config = crate::service::RestJsonConfig::builder().build();
11677   9437   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11678         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9438  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11679   9439   
                                let sender = sender.clone();
11680   9440   
                                async move {
11681         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9441  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11682   9442   
                                    sender.send(()).await.expect("receiver dropped early");
11683   9443   
                                    result
11684   9444   
                                }
11685   9445   
                            })
11686   9446   
                            .build_unchecked();
11687   9447   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11688   9448   
                .await
11689   9449   
                .expect("unable to make an HTTP request");
11690   9450   
            ::pretty_assertions::assert_eq!(
11691   9451   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11692   9452   
                http_response.status()
11693   9453   
            );
11694   9454   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11695   9455   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11696   9456   
                http_response.headers(),
11697   9457   
                expected_headers,
11698   9458   
            ));
11699   9459   
        }
11700   9460   
    }
11701         -
    /// Attempted string coercion should result in SerializationException
11702         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case3
        9461  +
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
        9462  +
    /// are rejected with a 400 SerializationException
        9463  +
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case14
11703   9464   
    #[::tokio::test]
11704         -
    async fn rest_json_query_boolean_string_coercion_case3_malformed_request() {
        9465  +
    #[::tracing_test::traced_test]
        9466  +
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case14_malformed_request(
        9467  +
    ) {
11705   9468   
        {
11706   9469   
            #[allow(unused_mut)]
11707   9470   
                        let mut http_request = http::Request::builder()
11708         -
                .uri("/MalformedBoolean/true")
        9471  +
                            .uri("/MalformedTimestampPathDefault/2011-12-03T10%3A15%3A30%2B01%3A00%5BEurope%2FParis%5D")
11709   9472   
                            .method("POST")
11710         -
                .body(::aws_smithy_http_server::body::Body::empty())
11711         -
                .unwrap();
11712         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Y".parse().unwrap();
        9473  +
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
11713   9474   
            #[allow(unused_mut)]
11714   9475   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11715   9476   
            let config = crate::service::RestJsonConfig::builder().build();
11716   9477   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11717         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9478  +
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
11718   9479   
                                let sender = sender.clone();
11719   9480   
                                async move {
11720         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9481  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
11721   9482   
                                    sender.send(()).await.expect("receiver dropped early");
11722   9483   
                                    result
11723   9484   
                                }
11724   9485   
                            })
11725   9486   
                            .build_unchecked();
11726   9487   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11727   9488   
                .await
11728   9489   
                .expect("unable to make an HTTP request");
11729   9490   
            ::pretty_assertions::assert_eq!(
11730   9491   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11731   9492   
                http_response.status()
11732   9493   
            );
11733   9494   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11734   9495   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11735   9496   
                http_response.headers(),
11736   9497   
                expected_headers,
11737   9498   
            ));
11738   9499   
        }
11739   9500   
    }
11740         -
    /// Attempted string coercion should result in SerializationException
11741         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case4
        9501  +
}
        9502  +
        9503  +
const CONTENT_TYPE_MALFORMEDSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
        9504  +
::pin_project_lite::pin_project! {
        9505  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        9506  +
    /// [`MalformedStringInput`](crate::input::MalformedStringInput) using modelled bindings.
        9507  +
    pub struct MalformedStringInputFuture {
        9508  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        9509  +
    }
        9510  +
}
        9511  +
        9512  +
impl std::future::Future for MalformedStringInputFuture {
        9513  +
    type Output = Result<
        9514  +
        crate::input::MalformedStringInput,
        9515  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        9516  +
    >;
        9517  +
        9518  +
    fn poll(
        9519  +
        self: std::pin::Pin<&mut Self>,
        9520  +
        cx: &mut std::task::Context<'_>,
        9521  +
    ) -> std::task::Poll<Self::Output> {
        9522  +
        let this = self.project();
        9523  +
        this.inner.as_mut().poll(cx)
        9524  +
    }
        9525  +
}
        9526  +
        9527  +
impl<B>
        9528  +
    ::aws_smithy_http_server::request::FromRequest<
        9529  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        9530  +
        B,
        9531  +
    > for crate::input::MalformedStringInput
        9532  +
where
        9533  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        9534  +
    B: 'static,
        9535  +
        9536  +
    B::Data: Send,
        9537  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        9538  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        9539  +
{
        9540  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        9541  +
    type Future = MalformedStringInputFuture;
        9542  +
        9543  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        9544  +
        let fut = async move {
        9545  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        9546  +
                request.headers(),
        9547  +
                &CONTENT_TYPE_MALFORMEDSTRING,
        9548  +
            ) {
        9549  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        9550  +
            }
        9551  +
            crate::protocol_serde::shape_malformed_string::de_malformed_string_http_request(request)
        9552  +
                .await
        9553  +
                .map_err(Into::into)
        9554  +
        };
        9555  +
        use ::futures_util::future::TryFutureExt;
        9556  +
        let fut = fut.map_err(
        9557  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        9558  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        9559  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        9560  +
                    e,
        9561  +
                )
        9562  +
            },
        9563  +
        );
        9564  +
        MalformedStringInputFuture {
        9565  +
            inner: Box::pin(fut),
        9566  +
        }
        9567  +
    }
        9568  +
}
        9569  +
impl
        9570  +
    ::aws_smithy_http_server::response::IntoResponse<
        9571  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        9572  +
    > for crate::output::MalformedStringOutput
        9573  +
{
        9574  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        9575  +
        match crate::protocol_serde::shape_malformed_string::ser_malformed_string_http_response(
        9576  +
            self,
        9577  +
        ) {
        9578  +
            Ok(response) => response,
        9579  +
            Err(e) => {
        9580  +
                ::tracing::error!(error = %e, "failed to serialize response");
        9581  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        9582  +
            }
        9583  +
        }
        9584  +
    }
        9585  +
}
        9586  +
        9587  +
#[allow(unreachable_code, unused_variables)]
        9588  +
#[cfg(test)]
        9589  +
mod malformed_string_test {
        9590  +
        9591  +
    /// When string with the mediaType trait is bound to a header, its value
        9592  +
    /// must be base64 encoded. The server should reject values that aren't
        9593  +
    /// valid base64 out of hand.
        9594  +
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case0
11742   9595   
    #[::tokio::test]
11743         -
    async fn rest_json_query_boolean_string_coercion_case4_malformed_request() {
        9596  +
    #[::tracing_test::traced_test]
        9597  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case0_malformed_request() {
11744   9598   
        {
11745   9599   
            #[allow(unused_mut)]
11746   9600   
            let mut http_request = http::Request::builder()
11747         -
                .uri("/MalformedBoolean/true")
        9601  +
                .uri("/MalformedString")
11748   9602   
                .method("POST")
        9603  +
                .header("content-type", "application/json")
        9604  +
                .header("amz-media-typed-header", "xyz")
11749   9605   
                .body(::aws_smithy_http_server::body::Body::empty())
11750   9606   
                .unwrap();
11751         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=yes".parse().unwrap();
11752   9607   
            #[allow(unused_mut)]
11753   9608   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11754   9609   
            let config = crate::service::RestJsonConfig::builder().build();
11755   9610   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11756         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9611  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
11757   9612   
                                let sender = sender.clone();
11758   9613   
                                async move {
11759         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9614  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
11760   9615   
                                    sender.send(()).await.expect("receiver dropped early");
11761   9616   
                                    result
11762   9617   
                                }
11763   9618   
                            })
11764   9619   
                            .build_unchecked();
11765   9620   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11766   9621   
                .await
11767   9622   
                .expect("unable to make an HTTP request");
11768   9623   
            ::pretty_assertions::assert_eq!(
11769   9624   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11770   9625   
                http_response.status()
11771   9626   
            );
11772   9627   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11773   9628   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11774   9629   
                http_response.headers(),
11775   9630   
                expected_headers,
11776   9631   
            ));
11777   9632   
        }
11778   9633   
    }
11779         -
    /// Attempted string coercion should result in SerializationException
11780         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case5
        9634  +
    /// When string with the mediaType trait is bound to a header, its value
        9635  +
    /// must be base64 encoded. The server should reject values that aren't
        9636  +
    /// valid base64 out of hand.
        9637  +
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case1
11781   9638   
    #[::tokio::test]
11782         -
    async fn rest_json_query_boolean_string_coercion_case5_malformed_request() {
        9639  +
    #[::tracing_test::traced_test]
        9640  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case1_malformed_request() {
11783   9641   
        {
11784   9642   
            #[allow(unused_mut)]
11785   9643   
            let mut http_request = http::Request::builder()
11786         -
                .uri("/MalformedBoolean/true")
        9644  +
                .uri("/MalformedString")
11787   9645   
                .method("POST")
        9646  +
                .header("content-type", "application/json")
        9647  +
                .header("amz-media-typed-header", "YmxvYg=")
11788   9648   
                .body(::aws_smithy_http_server::body::Body::empty())
11789   9649   
                .unwrap();
11790         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Yes".parse().unwrap();
11791   9650   
            #[allow(unused_mut)]
11792   9651   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11793   9652   
            let config = crate::service::RestJsonConfig::builder().build();
11794   9653   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11795         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9654  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
11796   9655   
                                let sender = sender.clone();
11797   9656   
                                async move {
11798         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9657  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
11799   9658   
                                    sender.send(()).await.expect("receiver dropped early");
11800   9659   
                                    result
11801   9660   
                                }
11802   9661   
                            })
11803   9662   
                            .build_unchecked();
11804   9663   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11805   9664   
                .await
11806   9665   
                .expect("unable to make an HTTP request");
11807   9666   
            ::pretty_assertions::assert_eq!(
11808   9667   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11809   9668   
                http_response.status()
11810   9669   
            );
11811   9670   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11812   9671   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11813   9672   
                http_response.headers(),
11814   9673   
                expected_headers,
11815   9674   
            ));
11816   9675   
        }
11817   9676   
    }
11818         -
    /// Attempted string coercion should result in SerializationException
11819         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case6
        9677  +
    /// When string with the mediaType trait is bound to a header, its value
        9678  +
    /// must be base64 encoded. The server should reject values that aren't
        9679  +
    /// valid base64 out of hand.
        9680  +
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case2
11820   9681   
    #[::tokio::test]
11821         -
    async fn rest_json_query_boolean_string_coercion_case6_malformed_request() {
        9682  +
    #[::tracing_test::traced_test]
        9683  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case2_malformed_request() {
11822   9684   
        {
11823   9685   
            #[allow(unused_mut)]
11824   9686   
            let mut http_request = http::Request::builder()
11825         -
                .uri("/MalformedBoolean/true")
        9687  +
                .uri("/MalformedString")
11826   9688   
                .method("POST")
        9689  +
                .header("content-type", "application/json")
        9690  +
                .header("amz-media-typed-header", "[][]")
11827   9691   
                .body(::aws_smithy_http_server::body::Body::empty())
11828   9692   
                .unwrap();
11829         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=YES".parse().unwrap();
11830   9693   
            #[allow(unused_mut)]
11831   9694   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11832   9695   
            let config = crate::service::RestJsonConfig::builder().build();
11833   9696   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11834         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9697  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
11835   9698   
                                let sender = sender.clone();
11836   9699   
                                async move {
11837         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9700  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
11838   9701   
                                    sender.send(()).await.expect("receiver dropped early");
11839   9702   
                                    result
11840   9703   
                                }
11841   9704   
                            })
11842   9705   
                            .build_unchecked();
11843   9706   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11844   9707   
                .await
11845   9708   
                .expect("unable to make an HTTP request");
11846   9709   
            ::pretty_assertions::assert_eq!(
11847   9710   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11848   9711   
                http_response.status()
11849   9712   
            );
11850   9713   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11851   9714   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11852   9715   
                http_response.headers(),
11853   9716   
                expected_headers,
11854   9717   
            ));
11855   9718   
        }
11856   9719   
    }
11857         -
    /// Attempted string coercion should result in SerializationException
11858         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case7
        9720  +
    /// When string with the mediaType trait is bound to a header, its value
        9721  +
    /// must be base64 encoded. The server should reject values that aren't
        9722  +
    /// valid base64 out of hand.
        9723  +
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case3
11859   9724   
    #[::tokio::test]
11860         -
    async fn rest_json_query_boolean_string_coercion_case7_malformed_request() {
        9725  +
    #[::tracing_test::traced_test]
        9726  +
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case3_malformed_request() {
11861   9727   
        {
11862   9728   
            #[allow(unused_mut)]
11863   9729   
            let mut http_request = http::Request::builder()
11864         -
                .uri("/MalformedBoolean/true")
        9730  +
                .uri("/MalformedString")
11865   9731   
                .method("POST")
        9732  +
                .header("content-type", "application/json")
        9733  +
                .header("amz-media-typed-header", "-_==")
11866   9734   
                .body(::aws_smithy_http_server::body::Body::empty())
11867   9735   
                .unwrap();
11868         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=1".parse().unwrap();
11869   9736   
            #[allow(unused_mut)]
11870   9737   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11871   9738   
            let config = crate::service::RestJsonConfig::builder().build();
11872   9739   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11873         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9740  +
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
11874   9741   
                                let sender = sender.clone();
11875   9742   
                                async move {
11876         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9743  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
11877   9744   
                                    sender.send(()).await.expect("receiver dropped early");
11878   9745   
                                    result
11879   9746   
                                }
11880   9747   
                            })
11881   9748   
                            .build_unchecked();
11882   9749   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11883   9750   
                .await
11884   9751   
                .expect("unable to make an HTTP request");
11885   9752   
            ::pretty_assertions::assert_eq!(
11886   9753   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11887   9754   
                http_response.status()
11888   9755   
            );
11889   9756   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11890   9757   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11891   9758   
                http_response.headers(),
11892   9759   
                expected_headers,
11893   9760   
            ));
11894   9761   
        }
11895   9762   
    }
11896         -
    /// Attempted string coercion should result in SerializationException
11897         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case8
        9763  +
}
        9764  +
        9765  +
const CONTENT_TYPE_MALFORMEDDOUBLE: ::mime::Mime = ::mime::APPLICATION_JSON;
        9766  +
::pin_project_lite::pin_project! {
        9767  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
        9768  +
    /// [`MalformedDoubleInput`](crate::input::MalformedDoubleInput) using modelled bindings.
        9769  +
    pub struct MalformedDoubleInputFuture {
        9770  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedDoubleInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
        9771  +
    }
        9772  +
}
        9773  +
        9774  +
impl std::future::Future for MalformedDoubleInputFuture {
        9775  +
    type Output = Result<
        9776  +
        crate::input::MalformedDoubleInput,
        9777  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
        9778  +
    >;
        9779  +
        9780  +
    fn poll(
        9781  +
        self: std::pin::Pin<&mut Self>,
        9782  +
        cx: &mut std::task::Context<'_>,
        9783  +
    ) -> std::task::Poll<Self::Output> {
        9784  +
        let this = self.project();
        9785  +
        this.inner.as_mut().poll(cx)
        9786  +
    }
        9787  +
}
        9788  +
        9789  +
impl<B>
        9790  +
    ::aws_smithy_http_server::request::FromRequest<
        9791  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        9792  +
        B,
        9793  +
    > for crate::input::MalformedDoubleInput
        9794  +
where
        9795  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
        9796  +
    B: 'static,
        9797  +
        9798  +
    B::Data: Send,
        9799  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
        9800  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
        9801  +
{
        9802  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
        9803  +
    type Future = MalformedDoubleInputFuture;
        9804  +
        9805  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
        9806  +
        let fut = async move {
        9807  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
        9808  +
                request.headers(),
        9809  +
                &CONTENT_TYPE_MALFORMEDDOUBLE,
        9810  +
            ) {
        9811  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
        9812  +
            }
        9813  +
            crate::protocol_serde::shape_malformed_double::de_malformed_double_http_request(request)
        9814  +
                .await
        9815  +
                .map_err(Into::into)
        9816  +
        };
        9817  +
        use ::futures_util::future::TryFutureExt;
        9818  +
        let fut = fut.map_err(
        9819  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
        9820  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
        9821  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
        9822  +
                    e,
        9823  +
                )
        9824  +
            },
        9825  +
        );
        9826  +
        MalformedDoubleInputFuture {
        9827  +
            inner: Box::pin(fut),
        9828  +
        }
        9829  +
    }
        9830  +
}
        9831  +
impl
        9832  +
    ::aws_smithy_http_server::response::IntoResponse<
        9833  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        9834  +
    > for crate::output::MalformedDoubleOutput
        9835  +
{
        9836  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        9837  +
        match crate::protocol_serde::shape_malformed_double::ser_malformed_double_http_response(
        9838  +
            self,
        9839  +
        ) {
        9840  +
            Ok(response) => response,
        9841  +
            Err(e) => {
        9842  +
                ::tracing::error!(error = %e, "failed to serialize response");
        9843  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        9844  +
            }
        9845  +
        }
        9846  +
    }
        9847  +
}
        9848  +
impl
        9849  +
    ::aws_smithy_http_server::response::IntoResponse<
        9850  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
        9851  +
    > for crate::error::MalformedDoubleError
        9852  +
{
        9853  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
        9854  +
        match crate::protocol_serde::shape_malformed_double::ser_malformed_double_http_error(&self)
        9855  +
        {
        9856  +
            Ok(mut response) => {
        9857  +
                response.extensions_mut().insert(
        9858  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
        9859  +
                );
        9860  +
                response
        9861  +
            }
        9862  +
            Err(e) => {
        9863  +
                ::tracing::error!(error = %e, "failed to serialize response");
        9864  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
        9865  +
            }
        9866  +
        }
        9867  +
    }
        9868  +
}
        9869  +
        9870  +
#[allow(unreachable_code, unused_variables)]
        9871  +
#[cfg(test)]
        9872  +
mod malformed_double_test {
        9873  +
        9874  +
    /// Malformed values in the body should be rejected
        9875  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case0
11898   9876   
    #[::tokio::test]
11899         -
    async fn rest_json_query_boolean_string_coercion_case8_malformed_request() {
        9877  +
    #[::tracing_test::traced_test]
        9878  +
    async fn rest_json_body_double_malformed_value_rejected_case0_malformed_request() {
11900   9879   
        {
11901   9880   
            #[allow(unused_mut)]
11902   9881   
            let mut http_request = http::Request::builder()
11903         -
                .uri("/MalformedBoolean/true")
        9882  +
                .uri("/MalformedDouble/1")
11904   9883   
                .method("POST")
11905         -
                .body(::aws_smithy_http_server::body::Body::empty())
        9884  +
                .header("content-type", "application/json")
        9885  +
                .body(::aws_smithy_http_server::body::Body::from(
        9886  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : \"123\" }".as_bytes()),
        9887  +
                ))
11906   9888   
                .unwrap();
11907         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=on".parse().unwrap();
11908   9889   
            #[allow(unused_mut)]
11909   9890   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11910   9891   
            let config = crate::service::RestJsonConfig::builder().build();
11911   9892   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11912         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9893  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
11913   9894   
                                let sender = sender.clone();
11914   9895   
                                async move {
11915         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9896  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
11916   9897   
                                    sender.send(()).await.expect("receiver dropped early");
11917   9898   
                                    result
11918   9899   
                                }
11919   9900   
                            })
11920   9901   
                            .build_unchecked();
11921   9902   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11922   9903   
                .await
11923   9904   
                .expect("unable to make an HTTP request");
11924   9905   
            ::pretty_assertions::assert_eq!(
11925   9906   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11926   9907   
                http_response.status()
11927   9908   
            );
11928   9909   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11929   9910   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11930   9911   
                http_response.headers(),
11931   9912   
                expected_headers,
11932   9913   
            ));
11933   9914   
        }
11934   9915   
    }
11935         -
    /// Attempted string coercion should result in SerializationException
11936         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case9
        9916  +
    /// Malformed values in the body should be rejected
        9917  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case1
11937   9918   
    #[::tokio::test]
11938         -
    async fn rest_json_query_boolean_string_coercion_case9_malformed_request() {
        9919  +
    #[::tracing_test::traced_test]
        9920  +
    async fn rest_json_body_double_malformed_value_rejected_case1_malformed_request() {
11939   9921   
        {
11940   9922   
            #[allow(unused_mut)]
11941   9923   
            let mut http_request = http::Request::builder()
11942         -
                .uri("/MalformedBoolean/true")
        9924  +
                .uri("/MalformedDouble/1")
11943   9925   
                .method("POST")
11944         -
                .body(::aws_smithy_http_server::body::Body::empty())
        9926  +
                .header("content-type", "application/json")
        9927  +
                .body(::aws_smithy_http_server::body::Body::from(
        9928  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : true }".as_bytes()),
        9929  +
                ))
11945   9930   
                .unwrap();
11946         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=On".parse().unwrap();
11947   9931   
            #[allow(unused_mut)]
11948   9932   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11949   9933   
            let config = crate::service::RestJsonConfig::builder().build();
11950   9934   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11951         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9935  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
11952   9936   
                                let sender = sender.clone();
11953   9937   
                                async move {
11954         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9938  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
11955   9939   
                                    sender.send(()).await.expect("receiver dropped early");
11956   9940   
                                    result
11957   9941   
                                }
11958   9942   
                            })
11959   9943   
                            .build_unchecked();
11960   9944   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
11961   9945   
                .await
11962   9946   
                .expect("unable to make an HTTP request");
11963   9947   
            ::pretty_assertions::assert_eq!(
11964   9948   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
11965   9949   
                http_response.status()
11966   9950   
            );
11967   9951   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
11968   9952   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
11969   9953   
                http_response.headers(),
11970   9954   
                expected_headers,
11971   9955   
            ));
11972   9956   
        }
11973   9957   
    }
11974         -
    /// Attempted string coercion should result in SerializationException
11975         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case10
        9958  +
    /// Malformed values in the body should be rejected
        9959  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case2
11976   9960   
    #[::tokio::test]
11977         -
    async fn rest_json_query_boolean_string_coercion_case10_malformed_request() {
        9961  +
    #[::tracing_test::traced_test]
        9962  +
    async fn rest_json_body_double_malformed_value_rejected_case2_malformed_request() {
11978   9963   
        {
11979   9964   
            #[allow(unused_mut)]
11980   9965   
            let mut http_request = http::Request::builder()
11981         -
                .uri("/MalformedBoolean/true")
        9966  +
                .uri("/MalformedDouble/1")
11982   9967   
                .method("POST")
11983         -
                .body(::aws_smithy_http_server::body::Body::empty())
        9968  +
                .header("content-type", "application/json")
        9969  +
                .body(::aws_smithy_http_server::body::Body::from(
        9970  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 2ABC }".as_bytes()),
        9971  +
                ))
11984   9972   
                .unwrap();
11985         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=ON".parse().unwrap();
11986   9973   
            #[allow(unused_mut)]
11987   9974   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
11988   9975   
            let config = crate::service::RestJsonConfig::builder().build();
11989   9976   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
11990         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
        9977  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
11991   9978   
                                let sender = sender.clone();
11992   9979   
                                async move {
11993         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
        9980  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
11994   9981   
                                    sender.send(()).await.expect("receiver dropped early");
11995   9982   
                                    result
11996   9983   
                                }
11997   9984   
                            })
11998   9985   
                            .build_unchecked();
11999   9986   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12000   9987   
                .await
12001   9988   
                .expect("unable to make an HTTP request");
12002   9989   
            ::pretty_assertions::assert_eq!(
12003   9990   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12004   9991   
                http_response.status()
12005   9992   
            );
12006   9993   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12007   9994   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12008   9995   
                http_response.headers(),
12009   9996   
                expected_headers,
12010   9997   
            ));
12011   9998   
        }
12012   9999   
    }
12013         -
    /// Attempted string coercion should result in SerializationException
12014         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case11
       10000  +
    /// Malformed values in the body should be rejected
       10001  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case3
12015  10002   
    #[::tokio::test]
12016         -
    async fn rest_json_query_boolean_string_coercion_case11_malformed_request() {
       10003  +
    #[::tracing_test::traced_test]
       10004  +
    async fn rest_json_body_double_malformed_value_rejected_case3_malformed_request() {
12017  10005   
        {
12018  10006   
            #[allow(unused_mut)]
12019  10007   
            let mut http_request = http::Request::builder()
12020         -
                .uri("/MalformedBoolean/true")
       10008  +
                .uri("/MalformedDouble/1")
12021  10009   
                .method("POST")
12022         -
                .body(::aws_smithy_http_server::body::Body::empty())
12023         -
                .unwrap();
12024         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=False"
12025         -
                .parse()
       10010  +
                .header("content-type", "application/json")
       10011  +
                .body(::aws_smithy_http_server::body::Body::from(
       10012  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 0x42 }".as_bytes()),
       10013  +
                ))
12026  10014   
                .unwrap();
12027  10015   
            #[allow(unused_mut)]
12028  10016   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12029  10017   
            let config = crate::service::RestJsonConfig::builder().build();
12030  10018   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12031         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10019  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12032  10020   
                                let sender = sender.clone();
12033  10021   
                                async move {
12034         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10022  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12035  10023   
                                    sender.send(()).await.expect("receiver dropped early");
12036  10024   
                                    result
12037  10025   
                                }
12038  10026   
                            })
12039  10027   
                            .build_unchecked();
12040  10028   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12041  10029   
                .await
12042  10030   
                .expect("unable to make an HTTP request");
12043  10031   
            ::pretty_assertions::assert_eq!(
12044  10032   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12045  10033   
                http_response.status()
12046  10034   
            );
12047  10035   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12048  10036   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12049  10037   
                http_response.headers(),
12050  10038   
                expected_headers,
12051  10039   
            ));
12052  10040   
        }
12053  10041   
    }
12054         -
    /// Attempted string coercion should result in SerializationException
12055         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case12
       10042  +
    /// Malformed values in the body should be rejected
       10043  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case4
12056  10044   
    #[::tokio::test]
12057         -
    async fn rest_json_query_boolean_string_coercion_case12_malformed_request() {
       10045  +
    #[::tracing_test::traced_test]
       10046  +
    async fn rest_json_body_double_malformed_value_rejected_case4_malformed_request() {
12058  10047   
        {
12059  10048   
            #[allow(unused_mut)]
12060  10049   
            let mut http_request = http::Request::builder()
12061         -
                .uri("/MalformedBoolean/true")
       10050  +
                .uri("/MalformedDouble/1")
12062  10051   
                .method("POST")
12063         -
                .body(::aws_smithy_http_server::body::Body::empty())
12064         -
                .unwrap();
12065         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=FALSE"
12066         -
                .parse()
       10052  +
                .header("content-type", "application/json")
       10053  +
                .body(::aws_smithy_http_server::body::Body::from(
       10054  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : Infinity }".as_bytes()),
       10055  +
                ))
12067  10056   
                .unwrap();
12068  10057   
            #[allow(unused_mut)]
12069  10058   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12070  10059   
            let config = crate::service::RestJsonConfig::builder().build();
12071  10060   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12072         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10061  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12073  10062   
                                let sender = sender.clone();
12074  10063   
                                async move {
12075         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10064  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12076  10065   
                                    sender.send(()).await.expect("receiver dropped early");
12077  10066   
                                    result
12078  10067   
                                }
12079  10068   
                            })
12080  10069   
                            .build_unchecked();
12081  10070   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12082  10071   
                .await
12083  10072   
                .expect("unable to make an HTTP request");
12084  10073   
            ::pretty_assertions::assert_eq!(
12085  10074   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12086  10075   
                http_response.status()
12087  10076   
            );
12088  10077   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12089  10078   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12090  10079   
                http_response.headers(),
12091  10080   
                expected_headers,
12092  10081   
            ));
12093  10082   
        }
12094  10083   
    }
12095         -
    /// Attempted string coercion should result in SerializationException
12096         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case13
       10084  +
    /// Malformed values in the body should be rejected
       10085  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case5
12097  10086   
    #[::tokio::test]
12098         -
    async fn rest_json_query_boolean_string_coercion_case13_malformed_request() {
       10087  +
    #[::tracing_test::traced_test]
       10088  +
    async fn rest_json_body_double_malformed_value_rejected_case5_malformed_request() {
12099  10089   
        {
12100  10090   
            #[allow(unused_mut)]
12101  10091   
            let mut http_request = http::Request::builder()
12102         -
                .uri("/MalformedBoolean/true")
       10092  +
                .uri("/MalformedDouble/1")
12103  10093   
                .method("POST")
12104         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10094  +
                .header("content-type", "application/json")
       10095  +
                .body(::aws_smithy_http_server::body::Body::from(
       10096  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : -Infinity }".as_bytes()),
       10097  +
                ))
12105  10098   
                .unwrap();
12106         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=n".parse().unwrap();
12107  10099   
            #[allow(unused_mut)]
12108  10100   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12109  10101   
            let config = crate::service::RestJsonConfig::builder().build();
12110  10102   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12111         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10103  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12112  10104   
                                let sender = sender.clone();
12113  10105   
                                async move {
12114         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10106  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12115  10107   
                                    sender.send(()).await.expect("receiver dropped early");
12116  10108   
                                    result
12117  10109   
                                }
12118  10110   
                            })
12119  10111   
                            .build_unchecked();
12120  10112   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12121  10113   
                .await
12122  10114   
                .expect("unable to make an HTTP request");
12123  10115   
            ::pretty_assertions::assert_eq!(
12124  10116   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12125  10117   
                http_response.status()
12126  10118   
            );
12127  10119   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12128  10120   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12129  10121   
                http_response.headers(),
12130  10122   
                expected_headers,
12131  10123   
            ));
12132  10124   
        }
12133  10125   
    }
12134         -
    /// Attempted string coercion should result in SerializationException
12135         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case14
       10126  +
    /// Malformed values in the body should be rejected
       10127  +
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case6
12136  10128   
    #[::tokio::test]
12137         -
    async fn rest_json_query_boolean_string_coercion_case14_malformed_request() {
       10129  +
    #[::tracing_test::traced_test]
       10130  +
    async fn rest_json_body_double_malformed_value_rejected_case6_malformed_request() {
12138  10131   
        {
12139  10132   
            #[allow(unused_mut)]
12140  10133   
            let mut http_request = http::Request::builder()
12141         -
                .uri("/MalformedBoolean/true")
       10134  +
                .uri("/MalformedDouble/1")
12142  10135   
                .method("POST")
12143         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10136  +
                .header("content-type", "application/json")
       10137  +
                .body(::aws_smithy_http_server::body::Body::from(
       10138  +
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : NaN }".as_bytes()),
       10139  +
                ))
12144  10140   
                .unwrap();
12145         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=N".parse().unwrap();
12146  10141   
            #[allow(unused_mut)]
12147  10142   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12148  10143   
            let config = crate::service::RestJsonConfig::builder().build();
12149  10144   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12150         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10145  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12151  10146   
                                let sender = sender.clone();
12152  10147   
                                async move {
12153         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10148  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12154  10149   
                                    sender.send(()).await.expect("receiver dropped early");
12155  10150   
                                    result
12156  10151   
                                }
12157  10152   
                            })
12158  10153   
                            .build_unchecked();
12159  10154   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12160  10155   
                .await
12161  10156   
                .expect("unable to make an HTTP request");
12162  10157   
            ::pretty_assertions::assert_eq!(
12163  10158   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12164  10159   
                http_response.status()
12165  10160   
            );
12166  10161   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12167  10162   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12168  10163   
                http_response.headers(),
12169  10164   
                expected_headers,
12170  10165   
            ));
12171  10166   
        }
12172  10167   
    }
12173         -
    /// Attempted string coercion should result in SerializationException
12174         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case15
       10168  +
    /// Malformed values in the path should be rejected
       10169  +
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case0
12175  10170   
    #[::tokio::test]
12176         -
    async fn rest_json_query_boolean_string_coercion_case15_malformed_request() {
       10171  +
    #[::tracing_test::traced_test]
       10172  +
    async fn rest_json_path_double_malformed_value_rejected_case0_malformed_request() {
12177  10173   
        {
12178  10174   
            #[allow(unused_mut)]
12179  10175   
            let mut http_request = http::Request::builder()
12180         -
                .uri("/MalformedBoolean/true")
       10176  +
                .uri("/MalformedDouble/true")
12181  10177   
                .method("POST")
12182  10178   
                .body(::aws_smithy_http_server::body::Body::empty())
12183  10179   
                .unwrap();
12184         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=no".parse().unwrap();
12185  10180   
            #[allow(unused_mut)]
12186  10181   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12187  10182   
            let config = crate::service::RestJsonConfig::builder().build();
12188  10183   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12189         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10184  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12190  10185   
                                let sender = sender.clone();
12191  10186   
                                async move {
12192         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10187  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12193  10188   
                                    sender.send(()).await.expect("receiver dropped early");
12194  10189   
                                    result
12195  10190   
                                }
12196  10191   
                            })
12197  10192   
                            .build_unchecked();
12198  10193   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12199  10194   
                .await
12200  10195   
                .expect("unable to make an HTTP request");
12201  10196   
            ::pretty_assertions::assert_eq!(
12202  10197   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12203  10198   
                http_response.status()
12204  10199   
            );
12205  10200   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12206  10201   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12207  10202   
                http_response.headers(),
12208  10203   
                expected_headers,
12209  10204   
            ));
12210  10205   
        }
12211  10206   
    }
12212         -
    /// Attempted string coercion should result in SerializationException
12213         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case16
       10207  +
    /// Malformed values in the path should be rejected
       10208  +
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case1
12214  10209   
    #[::tokio::test]
12215         -
    async fn rest_json_query_boolean_string_coercion_case16_malformed_request() {
       10210  +
    #[::tracing_test::traced_test]
       10211  +
    async fn rest_json_path_double_malformed_value_rejected_case1_malformed_request() {
12216  10212   
        {
12217  10213   
            #[allow(unused_mut)]
12218  10214   
            let mut http_request = http::Request::builder()
12219         -
                .uri("/MalformedBoolean/true")
       10215  +
                .uri("/MalformedDouble/2ABC")
12220  10216   
                .method("POST")
12221  10217   
                .body(::aws_smithy_http_server::body::Body::empty())
12222  10218   
                .unwrap();
12223         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=No".parse().unwrap();
12224  10219   
            #[allow(unused_mut)]
12225  10220   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12226  10221   
            let config = crate::service::RestJsonConfig::builder().build();
12227  10222   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12228         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10223  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12229  10224   
                                let sender = sender.clone();
12230  10225   
                                async move {
12231         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10226  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12232  10227   
                                    sender.send(()).await.expect("receiver dropped early");
12233  10228   
                                    result
12234  10229   
                                }
12235  10230   
                            })
12236  10231   
                            .build_unchecked();
12237  10232   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12238  10233   
                .await
12239  10234   
                .expect("unable to make an HTTP request");
12240  10235   
            ::pretty_assertions::assert_eq!(
12241  10236   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12242  10237   
                http_response.status()
12243  10238   
            );
12244  10239   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12245  10240   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12246  10241   
                http_response.headers(),
12247  10242   
                expected_headers,
12248  10243   
            ));
12249  10244   
        }
12250  10245   
    }
12251         -
    /// Attempted string coercion should result in SerializationException
12252         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case17
       10246  +
    /// Malformed values in the path should be rejected
       10247  +
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case2
12253  10248   
    #[::tokio::test]
12254         -
    async fn rest_json_query_boolean_string_coercion_case17_malformed_request() {
       10249  +
    #[::tracing_test::traced_test]
       10250  +
    async fn rest_json_path_double_malformed_value_rejected_case2_malformed_request() {
12255  10251   
        {
12256  10252   
            #[allow(unused_mut)]
12257  10253   
            let mut http_request = http::Request::builder()
12258         -
                .uri("/MalformedBoolean/true")
       10254  +
                .uri("/MalformedDouble/0x42")
12259  10255   
                .method("POST")
12260  10256   
                .body(::aws_smithy_http_server::body::Body::empty())
12261  10257   
                .unwrap();
12262         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=NO".parse().unwrap();
12263  10258   
            #[allow(unused_mut)]
12264  10259   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12265  10260   
            let config = crate::service::RestJsonConfig::builder().build();
12266  10261   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12267         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10262  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12268  10263   
                                let sender = sender.clone();
12269  10264   
                                async move {
12270         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10265  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12271  10266   
                                    sender.send(()).await.expect("receiver dropped early");
12272  10267   
                                    result
12273  10268   
                                }
12274  10269   
                            })
12275  10270   
                            .build_unchecked();
12276  10271   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12277  10272   
                .await
12278  10273   
                .expect("unable to make an HTTP request");
12279  10274   
            ::pretty_assertions::assert_eq!(
12280  10275   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12281  10276   
                http_response.status()
12282  10277   
            );
12283  10278   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12284  10279   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12285  10280   
                http_response.headers(),
12286  10281   
                expected_headers,
12287  10282   
            ));
12288  10283   
        }
12289  10284   
    }
12290         -
    /// Attempted string coercion should result in SerializationException
12291         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case18
       10285  +
    /// Malformed values in query parameters should be rejected
       10286  +
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case0
12292  10287   
    #[::tokio::test]
12293         -
    async fn rest_json_query_boolean_string_coercion_case18_malformed_request() {
       10288  +
    #[::tracing_test::traced_test]
       10289  +
    async fn rest_json_query_double_malformed_value_rejected_case0_malformed_request() {
12294  10290   
        {
12295  10291   
            #[allow(unused_mut)]
12296  10292   
            let mut http_request = http::Request::builder()
12297         -
                .uri("/MalformedBoolean/true")
       10293  +
                .uri("/MalformedDouble/1")
12298  10294   
                .method("POST")
12299  10295   
                .body(::aws_smithy_http_server::body::Body::empty())
12300  10296   
                .unwrap();
12301         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=0".parse().unwrap();
       10297  +
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=true".parse().unwrap();
12302  10298   
            #[allow(unused_mut)]
12303  10299   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12304  10300   
            let config = crate::service::RestJsonConfig::builder().build();
12305  10301   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12306         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10302  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12307  10303   
                                let sender = sender.clone();
12308  10304   
                                async move {
12309         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10305  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12310  10306   
                                    sender.send(()).await.expect("receiver dropped early");
12311  10307   
                                    result
12312  10308   
                                }
12313  10309   
                            })
12314  10310   
                            .build_unchecked();
12315  10311   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12316  10312   
                .await
12317  10313   
                .expect("unable to make an HTTP request");
12318  10314   
            ::pretty_assertions::assert_eq!(
12319  10315   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12320  10316   
                http_response.status()
12321  10317   
            );
12322  10318   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12323  10319   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12324  10320   
                http_response.headers(),
12325  10321   
                expected_headers,
12326  10322   
            ));
12327  10323   
        }
12328  10324   
    }
12329         -
    /// Attempted string coercion should result in SerializationException
12330         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case19
       10325  +
    /// Malformed values in query parameters should be rejected
       10326  +
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case1
12331  10327   
    #[::tokio::test]
12332         -
    async fn rest_json_query_boolean_string_coercion_case19_malformed_request() {
       10328  +
    #[::tracing_test::traced_test]
       10329  +
    async fn rest_json_query_double_malformed_value_rejected_case1_malformed_request() {
12333  10330   
        {
12334  10331   
            #[allow(unused_mut)]
12335  10332   
            let mut http_request = http::Request::builder()
12336         -
                .uri("/MalformedBoolean/true")
       10333  +
                .uri("/MalformedDouble/1")
12337  10334   
                .method("POST")
12338  10335   
                .body(::aws_smithy_http_server::body::Body::empty())
12339  10336   
                .unwrap();
12340         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=off".parse().unwrap();
       10337  +
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=2ABC".parse().unwrap();
12341  10338   
            #[allow(unused_mut)]
12342  10339   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12343  10340   
            let config = crate::service::RestJsonConfig::builder().build();
12344  10341   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12345         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10342  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12346  10343   
                                let sender = sender.clone();
12347  10344   
                                async move {
12348         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10345  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12349  10346   
                                    sender.send(()).await.expect("receiver dropped early");
12350  10347   
                                    result
12351  10348   
                                }
12352  10349   
                            })
12353  10350   
                            .build_unchecked();
12354  10351   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12355  10352   
                .await
12356  10353   
                .expect("unable to make an HTTP request");
12357  10354   
            ::pretty_assertions::assert_eq!(
12358  10355   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12359  10356   
                http_response.status()
12360  10357   
            );
12361  10358   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12362  10359   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12363  10360   
                http_response.headers(),
12364  10361   
                expected_headers,
12365  10362   
            ));
12366  10363   
        }
12367  10364   
    }
12368         -
    /// Attempted string coercion should result in SerializationException
12369         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case20
       10365  +
    /// Malformed values in query parameters should be rejected
       10366  +
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case2
12370  10367   
    #[::tokio::test]
12371         -
    async fn rest_json_query_boolean_string_coercion_case20_malformed_request() {
       10368  +
    #[::tracing_test::traced_test]
       10369  +
    async fn rest_json_query_double_malformed_value_rejected_case2_malformed_request() {
12372  10370   
        {
12373  10371   
            #[allow(unused_mut)]
12374  10372   
            let mut http_request = http::Request::builder()
12375         -
                .uri("/MalformedBoolean/true")
       10373  +
                .uri("/MalformedDouble/1")
12376  10374   
                .method("POST")
12377  10375   
                .body(::aws_smithy_http_server::body::Body::empty())
12378  10376   
                .unwrap();
12379         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Off".parse().unwrap();
       10377  +
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=0x42".parse().unwrap();
12380  10378   
            #[allow(unused_mut)]
12381  10379   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12382  10380   
            let config = crate::service::RestJsonConfig::builder().build();
12383  10381   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12384         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10382  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12385  10383   
                                let sender = sender.clone();
12386  10384   
                                async move {
12387         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10385  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12388  10386   
                                    sender.send(()).await.expect("receiver dropped early");
12389  10387   
                                    result
12390  10388   
                                }
12391  10389   
                            })
12392  10390   
                            .build_unchecked();
12393  10391   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12394  10392   
                .await
12395  10393   
                .expect("unable to make an HTTP request");
12396  10394   
            ::pretty_assertions::assert_eq!(
12397  10395   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12398  10396   
                http_response.status()
12399  10397   
            );
12400  10398   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12401  10399   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12402  10400   
                http_response.headers(),
12403  10401   
                expected_headers,
12404  10402   
            ));
12405  10403   
        }
12406  10404   
    }
12407         -
    /// Attempted string coercion should result in SerializationException
12408         -
    /// Test ID: RestJsonQueryBooleanStringCoercion_case21
       10405  +
    /// Malformed values in headers should be rejected
       10406  +
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case0
12409  10407   
    #[::tokio::test]
12410         -
    async fn rest_json_query_boolean_string_coercion_case21_malformed_request() {
       10408  +
    #[::tracing_test::traced_test]
       10409  +
    async fn rest_json_header_double_malformed_value_rejected_case0_malformed_request() {
12411  10410   
        {
12412  10411   
            #[allow(unused_mut)]
12413  10412   
            let mut http_request = http::Request::builder()
12414         -
                .uri("/MalformedBoolean/true")
       10413  +
                .uri("/MalformedDouble/1")
12415  10414   
                .method("POST")
       10415  +
                .header("doubleInHeader", "true")
12416  10416   
                .body(::aws_smithy_http_server::body::Body::empty())
12417  10417   
                .unwrap();
12418         -
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=OFF".parse().unwrap();
12419  10418   
            #[allow(unused_mut)]
12420  10419   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12421  10420   
            let config = crate::service::RestJsonConfig::builder().build();
12422  10421   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12423         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10422  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12424  10423   
                                let sender = sender.clone();
12425  10424   
                                async move {
12426         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10425  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12427  10426   
                                    sender.send(()).await.expect("receiver dropped early");
12428  10427   
                                    result
12429  10428   
                                }
12430  10429   
                            })
12431  10430   
                            .build_unchecked();
12432  10431   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12433  10432   
                .await
12434  10433   
                .expect("unable to make an HTTP request");
12435  10434   
            ::pretty_assertions::assert_eq!(
12436  10435   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12437  10436   
                http_response.status()
12438  10437   
            );
12439  10438   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12440  10439   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12441  10440   
                http_response.headers(),
12442  10441   
                expected_headers,
12443  10442   
            ));
12444  10443   
        }
12445  10444   
    }
12446         -
    /// Attempted string coercion should result in SerializationException
12447         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case0
       10445  +
    /// Malformed values in headers should be rejected
       10446  +
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case1
12448  10447   
    #[::tokio::test]
12449         -
    async fn rest_json_header_boolean_string_coercion_case0_malformed_request() {
       10448  +
    #[::tracing_test::traced_test]
       10449  +
    async fn rest_json_header_double_malformed_value_rejected_case1_malformed_request() {
12450  10450   
        {
12451  10451   
            #[allow(unused_mut)]
12452  10452   
            let mut http_request = http::Request::builder()
12453         -
                .uri("/MalformedBoolean/true")
       10453  +
                .uri("/MalformedDouble/1")
12454  10454   
                .method("POST")
12455         -
                .header("booleanInHeader", "True")
       10455  +
                .header("doubleInHeader", "2ABC")
12456  10456   
                .body(::aws_smithy_http_server::body::Body::empty())
12457  10457   
                .unwrap();
12458  10458   
            #[allow(unused_mut)]
12459  10459   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12460  10460   
            let config = crate::service::RestJsonConfig::builder().build();
12461  10461   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12462         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10462  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12463  10463   
                                let sender = sender.clone();
12464  10464   
                                async move {
12465         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10465  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12466  10466   
                                    sender.send(()).await.expect("receiver dropped early");
12467  10467   
                                    result
12468  10468   
                                }
12469  10469   
                            })
12470  10470   
                            .build_unchecked();
12471  10471   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12472  10472   
                .await
12473  10473   
                .expect("unable to make an HTTP request");
12474  10474   
            ::pretty_assertions::assert_eq!(
12475  10475   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12476  10476   
                http_response.status()
12477  10477   
            );
12478  10478   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12479  10479   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12480  10480   
                http_response.headers(),
12481  10481   
                expected_headers,
12482  10482   
            ));
12483  10483   
        }
12484  10484   
    }
12485         -
    /// Attempted string coercion should result in SerializationException
12486         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case1
       10485  +
    /// Malformed values in headers should be rejected
       10486  +
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case2
12487  10487   
    #[::tokio::test]
12488         -
    async fn rest_json_header_boolean_string_coercion_case1_malformed_request() {
       10488  +
    #[::tracing_test::traced_test]
       10489  +
    async fn rest_json_header_double_malformed_value_rejected_case2_malformed_request() {
12489  10490   
        {
12490  10491   
            #[allow(unused_mut)]
12491  10492   
            let mut http_request = http::Request::builder()
12492         -
                .uri("/MalformedBoolean/true")
       10493  +
                .uri("/MalformedDouble/1")
12493  10494   
                .method("POST")
12494         -
                .header("booleanInHeader", "TRUE")
       10495  +
                .header("doubleInHeader", "0x42")
12495  10496   
                .body(::aws_smithy_http_server::body::Body::empty())
12496  10497   
                .unwrap();
12497  10498   
            #[allow(unused_mut)]
12498  10499   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12499  10500   
            let config = crate::service::RestJsonConfig::builder().build();
12500  10501   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12501         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10502  +
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
12502  10503   
                                let sender = sender.clone();
12503  10504   
                                async move {
12504         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10505  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
12505  10506   
                                    sender.send(()).await.expect("receiver dropped early");
12506  10507   
                                    result
12507  10508   
                                }
12508  10509   
                            })
12509  10510   
                            .build_unchecked();
12510  10511   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12511  10512   
                .await
12512  10513   
                .expect("unable to make an HTTP request");
12513  10514   
            ::pretty_assertions::assert_eq!(
12514  10515   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12515  10516   
                http_response.status()
12516  10517   
            );
12517  10518   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12518  10519   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12519  10520   
                http_response.headers(),
12520  10521   
                expected_headers,
12521  10522   
            ));
12522  10523   
        }
12523  10524   
    }
12524         -
    /// Attempted string coercion should result in SerializationException
12525         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case2
12526         -
    #[::tokio::test]
12527         -
    async fn rest_json_header_boolean_string_coercion_case2_malformed_request() {
12528         -
        {
12529         -
            #[allow(unused_mut)]
12530         -
            let mut http_request = http::Request::builder()
12531         -
                .uri("/MalformedBoolean/true")
12532         -
                .method("POST")
12533         -
                .header("booleanInHeader", "y")
12534         -
                .body(::aws_smithy_http_server::body::Body::empty())
12535         -
                .unwrap();
12536         -
            #[allow(unused_mut)]
12537         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12538         -
            let config = crate::service::RestJsonConfig::builder().build();
12539         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12540         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
12541         -
                                let sender = sender.clone();
12542         -
                                async move {
12543         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
12544         -
                                    sender.send(()).await.expect("receiver dropped early");
12545         -
                                    result
       10525  +
}
       10526  +
       10527  +
const CONTENT_TYPE_MALFORMEDFLOAT: ::mime::Mime = ::mime::APPLICATION_JSON;
       10528  +
::pin_project_lite::pin_project! {
       10529  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       10530  +
    /// [`MalformedFloatInput`](crate::input::MalformedFloatInput) using modelled bindings.
       10531  +
    pub struct MalformedFloatInputFuture {
       10532  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedFloatInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
12546  10533   
    }
12547         -
                            })
12548         -
                            .build_unchecked();
12549         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       10534  +
}
       10535  +
       10536  +
impl std::future::Future for MalformedFloatInputFuture {
       10537  +
    type Output = Result<
       10538  +
        crate::input::MalformedFloatInput,
       10539  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       10540  +
    >;
       10541  +
       10542  +
    fn poll(
       10543  +
        self: std::pin::Pin<&mut Self>,
       10544  +
        cx: &mut std::task::Context<'_>,
       10545  +
    ) -> std::task::Poll<Self::Output> {
       10546  +
        let this = self.project();
       10547  +
        this.inner.as_mut().poll(cx)
       10548  +
    }
       10549  +
}
       10550  +
       10551  +
impl<B>
       10552  +
    ::aws_smithy_http_server::request::FromRequest<
       10553  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       10554  +
        B,
       10555  +
    > for crate::input::MalformedFloatInput
       10556  +
where
       10557  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       10558  +
    B: 'static,
       10559  +
       10560  +
    B::Data: Send,
       10561  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       10562  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       10563  +
{
       10564  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       10565  +
    type Future = MalformedFloatInputFuture;
       10566  +
       10567  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       10568  +
        let fut = async move {
       10569  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       10570  +
                request.headers(),
       10571  +
                &CONTENT_TYPE_MALFORMEDFLOAT,
       10572  +
            ) {
       10573  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       10574  +
            }
       10575  +
            crate::protocol_serde::shape_malformed_float::de_malformed_float_http_request(request)
12550  10576   
                .await
12551         -
                .expect("unable to make an HTTP request");
12552         -
            ::pretty_assertions::assert_eq!(
12553         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12554         -
                http_response.status()
       10577  +
                .map_err(Into::into)
       10578  +
        };
       10579  +
        use ::futures_util::future::TryFutureExt;
       10580  +
        let fut = fut.map_err(
       10581  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       10582  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       10583  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       10584  +
                    e,
       10585  +
                )
       10586  +
            },
12555  10587   
        );
12556         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12557         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12558         -
                http_response.headers(),
12559         -
                expected_headers,
12560         -
            ));
       10588  +
        MalformedFloatInputFuture {
       10589  +
            inner: Box::pin(fut),
12561  10590   
        }
12562  10591   
    }
12563         -
    /// Attempted string coercion should result in SerializationException
12564         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case3
12565         -
    #[::tokio::test]
12566         -
    async fn rest_json_header_boolean_string_coercion_case3_malformed_request() {
       10592  +
}
       10593  +
impl
       10594  +
    ::aws_smithy_http_server::response::IntoResponse<
       10595  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       10596  +
    > for crate::output::MalformedFloatOutput
       10597  +
{
       10598  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       10599  +
        match crate::protocol_serde::shape_malformed_float::ser_malformed_float_http_response(self)
12567  10600   
        {
12568         -
            #[allow(unused_mut)]
12569         -
            let mut http_request = http::Request::builder()
12570         -
                .uri("/MalformedBoolean/true")
12571         -
                .method("POST")
12572         -
                .header("booleanInHeader", "Y")
12573         -
                .body(::aws_smithy_http_server::body::Body::empty())
12574         -
                .unwrap();
12575         -
            #[allow(unused_mut)]
12576         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12577         -
            let config = crate::service::RestJsonConfig::builder().build();
12578         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12579         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
12580         -
                                let sender = sender.clone();
12581         -
                                async move {
12582         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
12583         -
                                    sender.send(()).await.expect("receiver dropped early");
12584         -
                                    result
       10601  +
            Ok(response) => response,
       10602  +
            Err(e) => {
       10603  +
                ::tracing::error!(error = %e, "failed to serialize response");
       10604  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
12585  10605   
            }
12586         -
                            })
12587         -
                            .build_unchecked();
12588         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12589         -
                .await
12590         -
                .expect("unable to make an HTTP request");
12591         -
            ::pretty_assertions::assert_eq!(
12592         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12593         -
                http_response.status()
       10606  +
        }
       10607  +
    }
       10608  +
}
       10609  +
impl
       10610  +
    ::aws_smithy_http_server::response::IntoResponse<
       10611  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       10612  +
    > for crate::error::MalformedFloatError
       10613  +
{
       10614  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       10615  +
        match crate::protocol_serde::shape_malformed_float::ser_malformed_float_http_error(&self) {
       10616  +
            Ok(mut response) => {
       10617  +
                response.extensions_mut().insert(
       10618  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
12594  10619   
                );
12595         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12596         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12597         -
                http_response.headers(),
12598         -
                expected_headers,
12599         -
            ));
       10620  +
                response
       10621  +
            }
       10622  +
            Err(e) => {
       10623  +
                ::tracing::error!(error = %e, "failed to serialize response");
       10624  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
12600  10625   
            }
12601  10626   
        }
12602         -
    /// Attempted string coercion should result in SerializationException
12603         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case4
       10627  +
    }
       10628  +
}
       10629  +
       10630  +
#[allow(unreachable_code, unused_variables)]
       10631  +
#[cfg(test)]
       10632  +
mod malformed_float_test {
       10633  +
       10634  +
    /// Malformed values in the body should be rejected
       10635  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case0
12604  10636   
    #[::tokio::test]
12605         -
    async fn rest_json_header_boolean_string_coercion_case4_malformed_request() {
       10637  +
    #[::tracing_test::traced_test]
       10638  +
    async fn rest_json_body_float_malformed_value_rejected_case0_malformed_request() {
12606  10639   
        {
12607  10640   
            #[allow(unused_mut)]
12608  10641   
            let mut http_request = http::Request::builder()
12609         -
                .uri("/MalformedBoolean/true")
       10642  +
                .uri("/MalformedFloat/1")
12610  10643   
                .method("POST")
12611         -
                .header("booleanInHeader", "yes")
12612         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10644  +
                .header("content-type", "application/json")
       10645  +
                .body(::aws_smithy_http_server::body::Body::from(
       10646  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : \"123\" }".as_bytes()),
       10647  +
                ))
12613  10648   
                .unwrap();
12614  10649   
            #[allow(unused_mut)]
12615  10650   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12616  10651   
            let config = crate::service::RestJsonConfig::builder().build();
12617  10652   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12618         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10653  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12619  10654   
                                let sender = sender.clone();
12620  10655   
                                async move {
12621         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10656  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12622  10657   
                                    sender.send(()).await.expect("receiver dropped early");
12623  10658   
                                    result
12624  10659   
                                }
12625  10660   
                            })
12626  10661   
                            .build_unchecked();
12627  10662   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12628  10663   
                .await
12629  10664   
                .expect("unable to make an HTTP request");
12630  10665   
            ::pretty_assertions::assert_eq!(
12631  10666   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12632  10667   
                http_response.status()
12633  10668   
            );
12634  10669   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12635  10670   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12636  10671   
                http_response.headers(),
12637  10672   
                expected_headers,
12638  10673   
            ));
12639  10674   
        }
12640  10675   
    }
12641         -
    /// Attempted string coercion should result in SerializationException
12642         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case5
       10676  +
    /// Malformed values in the body should be rejected
       10677  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case1
12643  10678   
    #[::tokio::test]
12644         -
    async fn rest_json_header_boolean_string_coercion_case5_malformed_request() {
       10679  +
    #[::tracing_test::traced_test]
       10680  +
    async fn rest_json_body_float_malformed_value_rejected_case1_malformed_request() {
12645  10681   
        {
12646  10682   
            #[allow(unused_mut)]
12647  10683   
            let mut http_request = http::Request::builder()
12648         -
                .uri("/MalformedBoolean/true")
       10684  +
                .uri("/MalformedFloat/1")
12649  10685   
                .method("POST")
12650         -
                .header("booleanInHeader", "Yes")
12651         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10686  +
                .header("content-type", "application/json")
       10687  +
                .body(::aws_smithy_http_server::body::Body::from(
       10688  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : true }".as_bytes()),
       10689  +
                ))
12652  10690   
                .unwrap();
12653  10691   
            #[allow(unused_mut)]
12654  10692   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12655  10693   
            let config = crate::service::RestJsonConfig::builder().build();
12656  10694   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12657         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10695  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12658  10696   
                                let sender = sender.clone();
12659  10697   
                                async move {
12660         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10698  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12661  10699   
                                    sender.send(()).await.expect("receiver dropped early");
12662  10700   
                                    result
12663  10701   
                                }
12664  10702   
                            })
12665  10703   
                            .build_unchecked();
12666  10704   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12667  10705   
                .await
12668  10706   
                .expect("unable to make an HTTP request");
12669  10707   
            ::pretty_assertions::assert_eq!(
12670  10708   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12671  10709   
                http_response.status()
12672  10710   
            );
12673  10711   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12674  10712   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12675  10713   
                http_response.headers(),
12676  10714   
                expected_headers,
12677  10715   
            ));
12678  10716   
        }
12679  10717   
    }
12680         -
    /// Attempted string coercion should result in SerializationException
12681         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case6
       10718  +
    /// Malformed values in the body should be rejected
       10719  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case2
12682  10720   
    #[::tokio::test]
12683         -
    async fn rest_json_header_boolean_string_coercion_case6_malformed_request() {
       10721  +
    #[::tracing_test::traced_test]
       10722  +
    async fn rest_json_body_float_malformed_value_rejected_case2_malformed_request() {
12684  10723   
        {
12685  10724   
            #[allow(unused_mut)]
12686  10725   
            let mut http_request = http::Request::builder()
12687         -
                .uri("/MalformedBoolean/true")
       10726  +
                .uri("/MalformedFloat/1")
12688  10727   
                .method("POST")
12689         -
                .header("booleanInHeader", "YES")
12690         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10728  +
                .header("content-type", "application/json")
       10729  +
                .body(::aws_smithy_http_server::body::Body::from(
       10730  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : 2ABC }".as_bytes()),
       10731  +
                ))
12691  10732   
                .unwrap();
12692  10733   
            #[allow(unused_mut)]
12693  10734   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12694  10735   
            let config = crate::service::RestJsonConfig::builder().build();
12695  10736   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12696         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10737  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12697  10738   
                                let sender = sender.clone();
12698  10739   
                                async move {
12699         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10740  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12700  10741   
                                    sender.send(()).await.expect("receiver dropped early");
12701  10742   
                                    result
12702  10743   
                                }
12703  10744   
                            })
12704  10745   
                            .build_unchecked();
12705  10746   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12706  10747   
                .await
12707  10748   
                .expect("unable to make an HTTP request");
12708  10749   
            ::pretty_assertions::assert_eq!(
12709  10750   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12710  10751   
                http_response.status()
12711  10752   
            );
12712  10753   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12713  10754   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12714  10755   
                http_response.headers(),
12715  10756   
                expected_headers,
12716  10757   
            ));
12717  10758   
        }
12718  10759   
    }
12719         -
    /// Attempted string coercion should result in SerializationException
12720         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case7
       10760  +
    /// Malformed values in the body should be rejected
       10761  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case3
12721  10762   
    #[::tokio::test]
12722         -
    async fn rest_json_header_boolean_string_coercion_case7_malformed_request() {
       10763  +
    #[::tracing_test::traced_test]
       10764  +
    async fn rest_json_body_float_malformed_value_rejected_case3_malformed_request() {
12723  10765   
        {
12724  10766   
            #[allow(unused_mut)]
12725  10767   
            let mut http_request = http::Request::builder()
12726         -
                .uri("/MalformedBoolean/true")
       10768  +
                .uri("/MalformedFloat/1")
12727  10769   
                .method("POST")
12728         -
                .header("booleanInHeader", "1")
12729         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10770  +
                .header("content-type", "application/json")
       10771  +
                .body(::aws_smithy_http_server::body::Body::from(
       10772  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : 0x42 }".as_bytes()),
       10773  +
                ))
12730  10774   
                .unwrap();
12731  10775   
            #[allow(unused_mut)]
12732  10776   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12733  10777   
            let config = crate::service::RestJsonConfig::builder().build();
12734  10778   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12735         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10779  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12736  10780   
                                let sender = sender.clone();
12737  10781   
                                async move {
12738         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10782  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12739  10783   
                                    sender.send(()).await.expect("receiver dropped early");
12740  10784   
                                    result
12741  10785   
                                }
12742  10786   
                            })
12743  10787   
                            .build_unchecked();
12744  10788   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12745  10789   
                .await
12746  10790   
                .expect("unable to make an HTTP request");
12747  10791   
            ::pretty_assertions::assert_eq!(
12748  10792   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12749  10793   
                http_response.status()
12750  10794   
            );
12751  10795   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12752  10796   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12753  10797   
                http_response.headers(),
12754  10798   
                expected_headers,
12755  10799   
            ));
12756  10800   
        }
12757  10801   
    }
12758         -
    /// Attempted string coercion should result in SerializationException
12759         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case8
       10802  +
    /// Malformed values in the body should be rejected
       10803  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case4
12760  10804   
    #[::tokio::test]
12761         -
    async fn rest_json_header_boolean_string_coercion_case8_malformed_request() {
       10805  +
    #[::tracing_test::traced_test]
       10806  +
    async fn rest_json_body_float_malformed_value_rejected_case4_malformed_request() {
12762  10807   
        {
12763  10808   
            #[allow(unused_mut)]
12764  10809   
            let mut http_request = http::Request::builder()
12765         -
                .uri("/MalformedBoolean/true")
       10810  +
                .uri("/MalformedFloat/1")
12766  10811   
                .method("POST")
12767         -
                .header("booleanInHeader", "on")
12768         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10812  +
                .header("content-type", "application/json")
       10813  +
                .body(::aws_smithy_http_server::body::Body::from(
       10814  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : Infinity }".as_bytes()),
       10815  +
                ))
12769  10816   
                .unwrap();
12770  10817   
            #[allow(unused_mut)]
12771  10818   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12772  10819   
            let config = crate::service::RestJsonConfig::builder().build();
12773  10820   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12774         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10821  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12775  10822   
                                let sender = sender.clone();
12776  10823   
                                async move {
12777         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10824  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12778  10825   
                                    sender.send(()).await.expect("receiver dropped early");
12779  10826   
                                    result
12780  10827   
                                }
12781  10828   
                            })
12782  10829   
                            .build_unchecked();
12783  10830   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12784  10831   
                .await
12785  10832   
                .expect("unable to make an HTTP request");
12786  10833   
            ::pretty_assertions::assert_eq!(
12787  10834   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12788  10835   
                http_response.status()
12789  10836   
            );
12790  10837   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12791  10838   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12792  10839   
                http_response.headers(),
12793  10840   
                expected_headers,
12794  10841   
            ));
12795  10842   
        }
12796  10843   
    }
12797         -
    /// Attempted string coercion should result in SerializationException
12798         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case9
       10844  +
    /// Malformed values in the body should be rejected
       10845  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case5
12799  10846   
    #[::tokio::test]
12800         -
    async fn rest_json_header_boolean_string_coercion_case9_malformed_request() {
       10847  +
    #[::tracing_test::traced_test]
       10848  +
    async fn rest_json_body_float_malformed_value_rejected_case5_malformed_request() {
12801  10849   
        {
12802  10850   
            #[allow(unused_mut)]
12803  10851   
            let mut http_request = http::Request::builder()
12804         -
                .uri("/MalformedBoolean/true")
       10852  +
                .uri("/MalformedFloat/1")
12805  10853   
                .method("POST")
12806         -
                .header("booleanInHeader", "On")
12807         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10854  +
                .header("content-type", "application/json")
       10855  +
                .body(::aws_smithy_http_server::body::Body::from(
       10856  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : -Infinity }".as_bytes()),
       10857  +
                ))
12808  10858   
                .unwrap();
12809  10859   
            #[allow(unused_mut)]
12810  10860   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12811  10861   
            let config = crate::service::RestJsonConfig::builder().build();
12812  10862   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12813         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10863  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12814  10864   
                                let sender = sender.clone();
12815  10865   
                                async move {
12816         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10866  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12817  10867   
                                    sender.send(()).await.expect("receiver dropped early");
12818  10868   
                                    result
12819  10869   
                                }
12820  10870   
                            })
12821  10871   
                            .build_unchecked();
12822  10872   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12823  10873   
                .await
12824  10874   
                .expect("unable to make an HTTP request");
12825  10875   
            ::pretty_assertions::assert_eq!(
12826  10876   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12827  10877   
                http_response.status()
12828  10878   
            );
12829  10879   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12830  10880   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12831  10881   
                http_response.headers(),
12832  10882   
                expected_headers,
12833  10883   
            ));
12834  10884   
        }
12835  10885   
    }
12836         -
    /// Attempted string coercion should result in SerializationException
12837         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case10
       10886  +
    /// Malformed values in the body should be rejected
       10887  +
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case6
12838  10888   
    #[::tokio::test]
12839         -
    async fn rest_json_header_boolean_string_coercion_case10_malformed_request() {
       10889  +
    #[::tracing_test::traced_test]
       10890  +
    async fn rest_json_body_float_malformed_value_rejected_case6_malformed_request() {
12840  10891   
        {
12841  10892   
            #[allow(unused_mut)]
12842  10893   
            let mut http_request = http::Request::builder()
12843         -
                .uri("/MalformedBoolean/true")
       10894  +
                .uri("/MalformedFloat/1")
12844  10895   
                .method("POST")
12845         -
                .header("booleanInHeader", "ON")
12846         -
                .body(::aws_smithy_http_server::body::Body::empty())
       10896  +
                .header("content-type", "application/json")
       10897  +
                .body(::aws_smithy_http_server::body::Body::from(
       10898  +
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : NaN }".as_bytes()),
       10899  +
                ))
12847  10900   
                .unwrap();
12848  10901   
            #[allow(unused_mut)]
12849  10902   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12850  10903   
            let config = crate::service::RestJsonConfig::builder().build();
12851  10904   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12852         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10905  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12853  10906   
                                let sender = sender.clone();
12854  10907   
                                async move {
12855         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10908  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12856  10909   
                                    sender.send(()).await.expect("receiver dropped early");
12857  10910   
                                    result
12858  10911   
                                }
12859  10912   
                            })
12860  10913   
                            .build_unchecked();
12861  10914   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12862  10915   
                .await
12863  10916   
                .expect("unable to make an HTTP request");
12864  10917   
            ::pretty_assertions::assert_eq!(
12865  10918   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12866  10919   
                http_response.status()
12867  10920   
            );
12868  10921   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12869  10922   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12870  10923   
                http_response.headers(),
12871  10924   
                expected_headers,
12872  10925   
            ));
12873  10926   
        }
12874  10927   
    }
12875         -
    /// Attempted string coercion should result in SerializationException
12876         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case11
       10928  +
    /// Malformed values in the path should be rejected
       10929  +
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case0
12877  10930   
    #[::tokio::test]
12878         -
    async fn rest_json_header_boolean_string_coercion_case11_malformed_request() {
       10931  +
    #[::tracing_test::traced_test]
       10932  +
    async fn rest_json_path_float_malformed_value_rejected_case0_malformed_request() {
12879  10933   
        {
12880  10934   
            #[allow(unused_mut)]
12881  10935   
            let mut http_request = http::Request::builder()
12882         -
                .uri("/MalformedBoolean/true")
       10936  +
                .uri("/MalformedFloat/true")
12883  10937   
                .method("POST")
12884         -
                .header("booleanInHeader", "False")
12885  10938   
                .body(::aws_smithy_http_server::body::Body::empty())
12886  10939   
                .unwrap();
12887  10940   
            #[allow(unused_mut)]
12888  10941   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12889  10942   
            let config = crate::service::RestJsonConfig::builder().build();
12890  10943   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12891         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10944  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12892  10945   
                                let sender = sender.clone();
12893  10946   
                                async move {
12894         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10947  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12895  10948   
                                    sender.send(()).await.expect("receiver dropped early");
12896  10949   
                                    result
12897  10950   
                                }
12898  10951   
                            })
12899  10952   
                            .build_unchecked();
12900  10953   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12901  10954   
                .await
12902  10955   
                .expect("unable to make an HTTP request");
12903  10956   
            ::pretty_assertions::assert_eq!(
12904  10957   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12905  10958   
                http_response.status()
12906  10959   
            );
12907  10960   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12908  10961   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12909  10962   
                http_response.headers(),
12910  10963   
                expected_headers,
12911  10964   
            ));
12912  10965   
        }
12913  10966   
    }
12914         -
    /// Attempted string coercion should result in SerializationException
12915         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case12
       10967  +
    /// Malformed values in the path should be rejected
       10968  +
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case1
12916  10969   
    #[::tokio::test]
12917         -
    async fn rest_json_header_boolean_string_coercion_case12_malformed_request() {
       10970  +
    #[::tracing_test::traced_test]
       10971  +
    async fn rest_json_path_float_malformed_value_rejected_case1_malformed_request() {
12918  10972   
        {
12919  10973   
            #[allow(unused_mut)]
12920  10974   
            let mut http_request = http::Request::builder()
12921         -
                .uri("/MalformedBoolean/true")
       10975  +
                .uri("/MalformedFloat/2ABC")
12922  10976   
                .method("POST")
12923         -
                .header("booleanInHeader", "FALSE")
12924  10977   
                .body(::aws_smithy_http_server::body::Body::empty())
12925  10978   
                .unwrap();
12926  10979   
            #[allow(unused_mut)]
12927  10980   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12928  10981   
            let config = crate::service::RestJsonConfig::builder().build();
12929  10982   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12930         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       10983  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12931  10984   
                                let sender = sender.clone();
12932  10985   
                                async move {
12933         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       10986  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12934  10987   
                                    sender.send(()).await.expect("receiver dropped early");
12935  10988   
                                    result
12936  10989   
                                }
12937  10990   
                            })
12938  10991   
                            .build_unchecked();
12939  10992   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12940  10993   
                .await
12941  10994   
                .expect("unable to make an HTTP request");
12942  10995   
            ::pretty_assertions::assert_eq!(
12943  10996   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12944  10997   
                http_response.status()
12945  10998   
            );
12946  10999   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12947  11000   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12948  11001   
                http_response.headers(),
12949  11002   
                expected_headers,
12950  11003   
            ));
12951  11004   
        }
12952  11005   
    }
12953         -
    /// Attempted string coercion should result in SerializationException
12954         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case13
       11006  +
    /// Malformed values in the path should be rejected
       11007  +
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case2
12955  11008   
    #[::tokio::test]
12956         -
    async fn rest_json_header_boolean_string_coercion_case13_malformed_request() {
       11009  +
    #[::tracing_test::traced_test]
       11010  +
    async fn rest_json_path_float_malformed_value_rejected_case2_malformed_request() {
12957  11011   
        {
12958  11012   
            #[allow(unused_mut)]
12959  11013   
            let mut http_request = http::Request::builder()
12960         -
                .uri("/MalformedBoolean/true")
       11014  +
                .uri("/MalformedFloat/0x42")
12961  11015   
                .method("POST")
12962         -
                .header("booleanInHeader", "n")
12963  11016   
                .body(::aws_smithy_http_server::body::Body::empty())
12964  11017   
                .unwrap();
12965  11018   
            #[allow(unused_mut)]
12966  11019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
12967  11020   
            let config = crate::service::RestJsonConfig::builder().build();
12968  11021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
12969         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       11022  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
12970  11023   
                                let sender = sender.clone();
12971  11024   
                                async move {
12972         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       11025  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
12973  11026   
                                    sender.send(()).await.expect("receiver dropped early");
12974  11027   
                                    result
12975  11028   
                                }
12976  11029   
                            })
12977  11030   
                            .build_unchecked();
12978  11031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
12979  11032   
                .await
12980  11033   
                .expect("unable to make an HTTP request");
12981  11034   
            ::pretty_assertions::assert_eq!(
12982  11035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
12983  11036   
                http_response.status()
12984  11037   
            );
12985  11038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
12986  11039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
12987  11040   
                http_response.headers(),
12988  11041   
                expected_headers,
12989  11042   
            ));
12990  11043   
        }
12991  11044   
    }
12992         -
    /// Attempted string coercion should result in SerializationException
12993         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case14
       11045  +
    /// Malformed values in query parameters should be rejected
       11046  +
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case0
12994  11047   
    #[::tokio::test]
12995         -
    async fn rest_json_header_boolean_string_coercion_case14_malformed_request() {
       11048  +
    #[::tracing_test::traced_test]
       11049  +
    async fn rest_json_query_float_malformed_value_rejected_case0_malformed_request() {
12996  11050   
        {
12997  11051   
            #[allow(unused_mut)]
12998  11052   
            let mut http_request = http::Request::builder()
12999         -
                .uri("/MalformedBoolean/true")
       11053  +
                .uri("/MalformedFloat/1")
13000  11054   
                .method("POST")
13001         -
                .header("booleanInHeader", "N")
13002  11055   
                .body(::aws_smithy_http_server::body::Body::empty())
13003  11056   
                .unwrap();
       11057  +
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=true".parse().unwrap();
13004  11058   
            #[allow(unused_mut)]
13005  11059   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13006  11060   
            let config = crate::service::RestJsonConfig::builder().build();
13007  11061   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13008         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       11062  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
13009  11063   
                                let sender = sender.clone();
13010  11064   
                                async move {
13011         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       11065  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
13012  11066   
                                    sender.send(()).await.expect("receiver dropped early");
13013  11067   
                                    result
13014  11068   
                                }
13015  11069   
                            })
13016  11070   
                            .build_unchecked();
13017  11071   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13018  11072   
                .await
13019  11073   
                .expect("unable to make an HTTP request");
13020  11074   
            ::pretty_assertions::assert_eq!(
13021  11075   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13022  11076   
                http_response.status()
13023  11077   
            );
13024  11078   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13025  11079   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13026  11080   
                http_response.headers(),
13027  11081   
                expected_headers,
13028  11082   
            ));
13029  11083   
        }
13030  11084   
    }
13031         -
    /// Attempted string coercion should result in SerializationException
13032         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case15
       11085  +
    /// Malformed values in query parameters should be rejected
       11086  +
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case1
13033  11087   
    #[::tokio::test]
13034         -
    async fn rest_json_header_boolean_string_coercion_case15_malformed_request() {
       11088  +
    #[::tracing_test::traced_test]
       11089  +
    async fn rest_json_query_float_malformed_value_rejected_case1_malformed_request() {
13035  11090   
        {
13036  11091   
            #[allow(unused_mut)]
13037  11092   
            let mut http_request = http::Request::builder()
13038         -
                .uri("/MalformedBoolean/true")
       11093  +
                .uri("/MalformedFloat/1")
13039  11094   
                .method("POST")
13040         -
                .header("booleanInHeader", "no")
13041  11095   
                .body(::aws_smithy_http_server::body::Body::empty())
13042  11096   
                .unwrap();
       11097  +
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=2ABC".parse().unwrap();
13043  11098   
            #[allow(unused_mut)]
13044  11099   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13045  11100   
            let config = crate::service::RestJsonConfig::builder().build();
13046  11101   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13047         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       11102  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
13048  11103   
                                let sender = sender.clone();
13049  11104   
                                async move {
13050         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       11105  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
13051  11106   
                                    sender.send(()).await.expect("receiver dropped early");
13052  11107   
                                    result
13053  11108   
                                }
13054  11109   
                            })
13055  11110   
                            .build_unchecked();
13056  11111   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13057  11112   
                .await
13058  11113   
                .expect("unable to make an HTTP request");
13059  11114   
            ::pretty_assertions::assert_eq!(
13060  11115   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13061  11116   
                http_response.status()
13062  11117   
            );
13063  11118   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13064  11119   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13065  11120   
                http_response.headers(),
13066  11121   
                expected_headers,
13067  11122   
            ));
13068  11123   
        }
13069  11124   
    }
13070         -
    /// Attempted string coercion should result in SerializationException
13071         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case16
       11125  +
    /// Malformed values in query parameters should be rejected
       11126  +
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case2
13072  11127   
    #[::tokio::test]
13073         -
    async fn rest_json_header_boolean_string_coercion_case16_malformed_request() {
       11128  +
    #[::tracing_test::traced_test]
       11129  +
    async fn rest_json_query_float_malformed_value_rejected_case2_malformed_request() {
13074  11130   
        {
13075  11131   
            #[allow(unused_mut)]
13076  11132   
            let mut http_request = http::Request::builder()
13077         -
                .uri("/MalformedBoolean/true")
       11133  +
                .uri("/MalformedFloat/1")
13078  11134   
                .method("POST")
13079         -
                .header("booleanInHeader", "No")
13080  11135   
                .body(::aws_smithy_http_server::body::Body::empty())
13081  11136   
                .unwrap();
       11137  +
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=0x42".parse().unwrap();
13082  11138   
            #[allow(unused_mut)]
13083  11139   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13084  11140   
            let config = crate::service::RestJsonConfig::builder().build();
13085  11141   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13086         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       11142  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
13087  11143   
                                let sender = sender.clone();
13088  11144   
                                async move {
13089         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       11145  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
13090  11146   
                                    sender.send(()).await.expect("receiver dropped early");
13091  11147   
                                    result
13092  11148   
                                }
13093  11149   
                            })
13094  11150   
                            .build_unchecked();
13095  11151   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13096  11152   
                .await
13097  11153   
                .expect("unable to make an HTTP request");
13098  11154   
            ::pretty_assertions::assert_eq!(
13099  11155   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13100  11156   
                http_response.status()
13101  11157   
            );
13102  11158   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13103  11159   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13104  11160   
                http_response.headers(),
13105  11161   
                expected_headers,
13106  11162   
            ));
13107  11163   
        }
13108  11164   
    }
13109         -
    /// Attempted string coercion should result in SerializationException
13110         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case17
       11165  +
    /// Malformed values in headers should be rejected
       11166  +
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case0
13111  11167   
    #[::tokio::test]
13112         -
    async fn rest_json_header_boolean_string_coercion_case17_malformed_request() {
       11168  +
    #[::tracing_test::traced_test]
       11169  +
    async fn rest_json_header_float_malformed_value_rejected_case0_malformed_request() {
13113  11170   
        {
13114  11171   
            #[allow(unused_mut)]
13115  11172   
            let mut http_request = http::Request::builder()
13116         -
                .uri("/MalformedBoolean/true")
       11173  +
                .uri("/MalformedFloat/1")
13117  11174   
                .method("POST")
13118         -
                .header("booleanInHeader", "NO")
       11175  +
                .header("floatInHeader", "true")
13119  11176   
                .body(::aws_smithy_http_server::body::Body::empty())
13120  11177   
                .unwrap();
13121  11178   
            #[allow(unused_mut)]
13122  11179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13123  11180   
            let config = crate::service::RestJsonConfig::builder().build();
13124  11181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13125         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       11182  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
13126  11183   
                                let sender = sender.clone();
13127  11184   
                                async move {
13128         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       11185  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
13129  11186   
                                    sender.send(()).await.expect("receiver dropped early");
13130  11187   
                                    result
13131  11188   
                                }
13132  11189   
                            })
13133  11190   
                            .build_unchecked();
13134  11191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13135  11192   
                .await
13136  11193   
                .expect("unable to make an HTTP request");
13137  11194   
            ::pretty_assertions::assert_eq!(
13138  11195   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13139  11196   
                http_response.status()
13140  11197   
            );
13141  11198   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13142  11199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13143  11200   
                http_response.headers(),
13144  11201   
                expected_headers,
13145  11202   
            ));
13146  11203   
        }
13147  11204   
    }
13148         -
    /// Attempted string coercion should result in SerializationException
13149         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case18
       11205  +
    /// Malformed values in headers should be rejected
       11206  +
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case1
13150  11207   
    #[::tokio::test]
13151         -
    async fn rest_json_header_boolean_string_coercion_case18_malformed_request() {
       11208  +
    #[::tracing_test::traced_test]
       11209  +
    async fn rest_json_header_float_malformed_value_rejected_case1_malformed_request() {
13152  11210   
        {
13153  11211   
            #[allow(unused_mut)]
13154  11212   
            let mut http_request = http::Request::builder()
13155         -
                .uri("/MalformedBoolean/true")
       11213  +
                .uri("/MalformedFloat/1")
13156  11214   
                .method("POST")
13157         -
                .header("booleanInHeader", "0")
       11215  +
                .header("floatInHeader", "2ABC")
13158  11216   
                .body(::aws_smithy_http_server::body::Body::empty())
13159  11217   
                .unwrap();
13160  11218   
            #[allow(unused_mut)]
13161  11219   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13162  11220   
            let config = crate::service::RestJsonConfig::builder().build();
13163  11221   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13164         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       11222  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
13165  11223   
                                let sender = sender.clone();
13166  11224   
                                async move {
13167         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       11225  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
13168  11226   
                                    sender.send(()).await.expect("receiver dropped early");
13169  11227   
                                    result
13170  11228   
                                }
13171  11229   
                            })
13172  11230   
                            .build_unchecked();
13173  11231   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13174  11232   
                .await
13175  11233   
                .expect("unable to make an HTTP request");
13176  11234   
            ::pretty_assertions::assert_eq!(
13177  11235   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13178  11236   
                http_response.status()
13179  11237   
            );
13180  11238   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13181  11239   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13182  11240   
                http_response.headers(),
13183  11241   
                expected_headers,
13184  11242   
            ));
13185  11243   
        }
13186  11244   
    }
13187         -
    /// Attempted string coercion should result in SerializationException
13188         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case19
       11245  +
    /// Malformed values in headers should be rejected
       11246  +
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case2
13189  11247   
    #[::tokio::test]
13190         -
    async fn rest_json_header_boolean_string_coercion_case19_malformed_request() {
       11248  +
    #[::tracing_test::traced_test]
       11249  +
    async fn rest_json_header_float_malformed_value_rejected_case2_malformed_request() {
13191  11250   
        {
13192  11251   
            #[allow(unused_mut)]
13193  11252   
            let mut http_request = http::Request::builder()
13194         -
                .uri("/MalformedBoolean/true")
       11253  +
                .uri("/MalformedFloat/1")
13195  11254   
                .method("POST")
13196         -
                .header("booleanInHeader", "off")
       11255  +
                .header("floatInHeader", "0x42")
13197  11256   
                .body(::aws_smithy_http_server::body::Body::empty())
13198  11257   
                .unwrap();
13199  11258   
            #[allow(unused_mut)]
13200  11259   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13201  11260   
            let config = crate::service::RestJsonConfig::builder().build();
13202  11261   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13203         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
       11262  +
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
13204  11263   
                                let sender = sender.clone();
13205  11264   
                                async move {
13206         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
       11265  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
13207  11266   
                                    sender.send(()).await.expect("receiver dropped early");
13208  11267   
                                    result
13209  11268   
                                }
13210  11269   
                            })
13211  11270   
                            .build_unchecked();
13212  11271   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13213  11272   
                .await
13214  11273   
                .expect("unable to make an HTTP request");
13215  11274   
            ::pretty_assertions::assert_eq!(
13216  11275   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13217  11276   
                http_response.status()
13218  11277   
            );
13219  11278   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13220  11279   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13221  11280   
                http_response.headers(),
13222  11281   
                expected_headers,
13223  11282   
            ));
13224  11283   
        }
13225  11284   
    }
13226         -
    /// Attempted string coercion should result in SerializationException
13227         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case20
13228         -
    #[::tokio::test]
13229         -
    async fn rest_json_header_boolean_string_coercion_case20_malformed_request() {
13230         -
        {
13231         -
            #[allow(unused_mut)]
13232         -
            let mut http_request = http::Request::builder()
13233         -
                .uri("/MalformedBoolean/true")
13234         -
                .method("POST")
13235         -
                .header("booleanInHeader", "Off")
13236         -
                .body(::aws_smithy_http_server::body::Body::empty())
13237         -
                .unwrap();
13238         -
            #[allow(unused_mut)]
13239         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13240         -
            let config = crate::service::RestJsonConfig::builder().build();
13241         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13242         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
13243         -
                                let sender = sender.clone();
13244         -
                                async move {
13245         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
13246         -
                                    sender.send(()).await.expect("receiver dropped early");
13247         -
                                    result
       11285  +
}
       11286  +
       11287  +
const CONTENT_TYPE_MALFORMEDLONG: ::mime::Mime = ::mime::APPLICATION_JSON;
       11288  +
::pin_project_lite::pin_project! {
       11289  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       11290  +
    /// [`MalformedLongInput`](crate::input::MalformedLongInput) using modelled bindings.
       11291  +
    pub struct MalformedLongInputFuture {
       11292  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedLongInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
13248  11293   
    }
13249         -
                            })
13250         -
                            .build_unchecked();
13251         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       11294  +
}
       11295  +
       11296  +
impl std::future::Future for MalformedLongInputFuture {
       11297  +
    type Output = Result<
       11298  +
        crate::input::MalformedLongInput,
       11299  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       11300  +
    >;
       11301  +
       11302  +
    fn poll(
       11303  +
        self: std::pin::Pin<&mut Self>,
       11304  +
        cx: &mut std::task::Context<'_>,
       11305  +
    ) -> std::task::Poll<Self::Output> {
       11306  +
        let this = self.project();
       11307  +
        this.inner.as_mut().poll(cx)
       11308  +
    }
       11309  +
}
       11310  +
       11311  +
impl<B>
       11312  +
    ::aws_smithy_http_server::request::FromRequest<
       11313  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       11314  +
        B,
       11315  +
    > for crate::input::MalformedLongInput
       11316  +
where
       11317  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       11318  +
    B: 'static,
       11319  +
       11320  +
    B::Data: Send,
       11321  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       11322  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       11323  +
{
       11324  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       11325  +
    type Future = MalformedLongInputFuture;
       11326  +
       11327  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       11328  +
        let fut = async move {
       11329  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       11330  +
                request.headers(),
       11331  +
                &CONTENT_TYPE_MALFORMEDLONG,
       11332  +
            ) {
       11333  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       11334  +
            }
       11335  +
            crate::protocol_serde::shape_malformed_long::de_malformed_long_http_request(request)
13252  11336   
                .await
13253         -
                .expect("unable to make an HTTP request");
13254         -
            ::pretty_assertions::assert_eq!(
13255         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13256         -
                http_response.status()
       11337  +
                .map_err(Into::into)
       11338  +
        };
       11339  +
        use ::futures_util::future::TryFutureExt;
       11340  +
        let fut = fut.map_err(
       11341  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       11342  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       11343  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       11344  +
                    e,
       11345  +
                )
       11346  +
            },
13257  11347   
        );
13258         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13259         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13260         -
                http_response.headers(),
13261         -
                expected_headers,
13262         -
            ));
       11348  +
        MalformedLongInputFuture {
       11349  +
            inner: Box::pin(fut),
13263  11350   
        }
13264  11351   
    }
13265         -
    /// Attempted string coercion should result in SerializationException
13266         -
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case21
13267         -
    #[::tokio::test]
13268         -
    async fn rest_json_header_boolean_string_coercion_case21_malformed_request() {
13269         -
        {
13270         -
            #[allow(unused_mut)]
13271         -
            let mut http_request = http::Request::builder()
13272         -
                .uri("/MalformedBoolean/true")
13273         -
                .method("POST")
13274         -
                .header("booleanInHeader", "OFF")
13275         -
                .body(::aws_smithy_http_server::body::Body::empty())
13276         -
                .unwrap();
13277         -
            #[allow(unused_mut)]
13278         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13279         -
            let config = crate::service::RestJsonConfig::builder().build();
13280         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13281         -
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
13282         -
                                let sender = sender.clone();
13283         -
                                async move {
13284         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
13285         -
                                    sender.send(()).await.expect("receiver dropped early");
13286         -
                                    result
       11352  +
}
       11353  +
impl
       11354  +
    ::aws_smithy_http_server::response::IntoResponse<
       11355  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       11356  +
    > for crate::output::MalformedLongOutput
       11357  +
{
       11358  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       11359  +
        match crate::protocol_serde::shape_malformed_long::ser_malformed_long_http_response(self) {
       11360  +
            Ok(response) => response,
       11361  +
            Err(e) => {
       11362  +
                ::tracing::error!(error = %e, "failed to serialize response");
       11363  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
13287  11364   
            }
13288         -
                            })
13289         -
                            .build_unchecked();
13290         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13291         -
                .await
13292         -
                .expect("unable to make an HTTP request");
13293         -
            ::pretty_assertions::assert_eq!(
13294         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13295         -
                http_response.status()
       11365  +
        }
       11366  +
    }
       11367  +
}
       11368  +
impl
       11369  +
    ::aws_smithy_http_server::response::IntoResponse<
       11370  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       11371  +
    > for crate::error::MalformedLongError
       11372  +
{
       11373  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       11374  +
        match crate::protocol_serde::shape_malformed_long::ser_malformed_long_http_error(&self) {
       11375  +
            Ok(mut response) => {
       11376  +
                response.extensions_mut().insert(
       11377  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
13296  11378   
                );
13297         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13298         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13299         -
                http_response.headers(),
13300         -
                expected_headers,
13301         -
            ));
       11379  +
                response
       11380  +
            }
       11381  +
            Err(e) => {
       11382  +
                ::tracing::error!(error = %e, "failed to serialize response");
       11383  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       11384  +
            }
13302  11385   
        }
13303  11386   
    }
13304  11387   
}
13305         -
#[cfg(test)]
       11388  +
13306  11389   
#[allow(unreachable_code, unused_variables)]
13307         -
mod server_malformed_byte_test {
       11390  +
#[cfg(test)]
       11391  +
mod malformed_long_test {
       11392  +
13308  11393   
    /// Underflow or overflow should result in SerializationException
13309         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case0
       11394  +
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case0
13310  11395   
    #[::tokio::test]
13311         -
    async fn rest_json_body_byte_underflow_overflow_case0_malformed_request() {
       11396  +
    #[::tracing_test::traced_test]
       11397  +
    async fn rest_json_body_long_underflow_overflow_case0_malformed_request() {
13312  11398   
        {
13313  11399   
            #[allow(unused_mut)]
13314  11400   
            let mut http_request = http::Request::builder()
13315         -
                .uri("/MalformedByte/1")
       11401  +
                .uri("/MalformedLong/1")
13316  11402   
                .method("POST")
13317  11403   
                .header("content-type", "application/json")
13318  11404   
                .body(::aws_smithy_http_server::body::Body::from(
13319         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 256 }".as_bytes()),
       11405  +
                    ::bytes::Bytes::from_static(
       11406  +
                        "{ \"longInBody\" : -184467440737095500000 }".as_bytes(),
       11407  +
                    ),
13320  11408   
                ))
13321  11409   
                .unwrap();
13322  11410   
            #[allow(unused_mut)]
13323  11411   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13324  11412   
            let config = crate::service::RestJsonConfig::builder().build();
13325  11413   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13326         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11414  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13327  11415   
                                let sender = sender.clone();
13328  11416   
                                async move {
13329         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11417  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13330  11418   
                                    sender.send(()).await.expect("receiver dropped early");
13331  11419   
                                    result
13332  11420   
                                }
13333  11421   
                            })
13334  11422   
                            .build_unchecked();
13335  11423   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13336  11424   
                .await
13337  11425   
                .expect("unable to make an HTTP request");
13338  11426   
            ::pretty_assertions::assert_eq!(
13339  11427   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13340  11428   
                http_response.status()
13341  11429   
            );
13342  11430   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13343  11431   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13344  11432   
                http_response.headers(),
13345  11433   
                expected_headers,
13346  11434   
            ));
13347  11435   
        }
13348  11436   
    }
13349  11437   
    /// Underflow or overflow should result in SerializationException
13350         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case1
       11438  +
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case1
13351  11439   
    #[::tokio::test]
13352         -
    async fn rest_json_body_byte_underflow_overflow_case1_malformed_request() {
       11440  +
    #[::tracing_test::traced_test]
       11441  +
    async fn rest_json_body_long_underflow_overflow_case1_malformed_request() {
13353  11442   
        {
13354  11443   
            #[allow(unused_mut)]
13355  11444   
            let mut http_request = http::Request::builder()
13356         -
                .uri("/MalformedByte/1")
       11445  +
                .uri("/MalformedLong/1")
13357  11446   
                .method("POST")
13358  11447   
                .header("content-type", "application/json")
13359  11448   
                .body(::aws_smithy_http_server::body::Body::from(
13360         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : -256 }".as_bytes()),
       11449  +
                    ::bytes::Bytes::from_static(
       11450  +
                        "{ \"longInBody\" : 184467440737095500000 }".as_bytes(),
       11451  +
                    ),
13361  11452   
                ))
13362  11453   
                .unwrap();
13363  11454   
            #[allow(unused_mut)]
13364  11455   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13365  11456   
            let config = crate::service::RestJsonConfig::builder().build();
13366  11457   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13367         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11458  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13368  11459   
                                let sender = sender.clone();
13369  11460   
                                async move {
13370         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11461  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13371  11462   
                                    sender.send(()).await.expect("receiver dropped early");
13372  11463   
                                    result
13373  11464   
                                }
13374  11465   
                            })
13375  11466   
                            .build_unchecked();
13376  11467   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13377  11468   
                .await
13378  11469   
                .expect("unable to make an HTTP request");
13379  11470   
            ::pretty_assertions::assert_eq!(
13380  11471   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13381  11472   
                http_response.status()
13382  11473   
            );
13383  11474   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13384  11475   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13385  11476   
                http_response.headers(),
13386  11477   
                expected_headers,
13387  11478   
            ));
13388  11479   
        }
13389  11480   
    }
13390  11481   
    /// Underflow or overflow should result in SerializationException
13391         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case2
       11482  +
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case2
13392  11483   
    #[::tokio::test]
13393         -
    async fn rest_json_body_byte_underflow_overflow_case2_malformed_request() {
       11484  +
    #[::tracing_test::traced_test]
       11485  +
    async fn rest_json_body_long_underflow_overflow_case2_malformed_request() {
13394  11486   
        {
13395  11487   
            #[allow(unused_mut)]
13396  11488   
            let mut http_request = http::Request::builder()
13397         -
                .uri("/MalformedByte/1")
       11489  +
                .uri("/MalformedLong/1")
13398  11490   
                .method("POST")
13399  11491   
                .header("content-type", "application/json")
13400  11492   
                .body(::aws_smithy_http_server::body::Body::from(
13401  11493   
                    ::bytes::Bytes::from_static(
13402         -
                        "{ \"byteInBody\" : -9223372000000000000 }".as_bytes(),
       11494  +
                        "{ \"longInBody\" : 123000000000000000000000 }".as_bytes(),
13403  11495   
                    ),
13404  11496   
                ))
13405  11497   
                .unwrap();
13406  11498   
            #[allow(unused_mut)]
13407  11499   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13408  11500   
            let config = crate::service::RestJsonConfig::builder().build();
13409  11501   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13410         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11502  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13411  11503   
                                let sender = sender.clone();
13412  11504   
                                async move {
13413         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11505  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13414  11506   
                                    sender.send(()).await.expect("receiver dropped early");
13415  11507   
                                    result
13416  11508   
                                }
13417  11509   
                            })
13418  11510   
                            .build_unchecked();
13419  11511   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13420  11512   
                .await
13421  11513   
                .expect("unable to make an HTTP request");
13422  11514   
            ::pretty_assertions::assert_eq!(
13423  11515   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13424  11516   
                http_response.status()
13425  11517   
            );
13426  11518   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13427  11519   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13428  11520   
                http_response.headers(),
13429  11521   
                expected_headers,
13430  11522   
            ));
13431  11523   
        }
13432  11524   
    }
13433  11525   
    /// Underflow or overflow should result in SerializationException
13434         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case3
       11526  +
    /// Test ID: RestJsonPathLongUnderflowOverflow_case0
13435  11527   
    #[::tokio::test]
13436         -
    async fn rest_json_body_byte_underflow_overflow_case3_malformed_request() {
       11528  +
    #[::tracing_test::traced_test]
       11529  +
    async fn rest_json_path_long_underflow_overflow_case0_malformed_request() {
13437  11530   
        {
13438  11531   
            #[allow(unused_mut)]
13439  11532   
            let mut http_request = http::Request::builder()
13440         -
                .uri("/MalformedByte/1")
       11533  +
                .uri("/MalformedLong/-184467440737095500000")
13441  11534   
                .method("POST")
13442         -
                .header("content-type", "application/json")
13443         -
                .body(::aws_smithy_http_server::body::Body::from(
13444         -
                    ::bytes::Bytes::from_static(
13445         -
                        "{ \"byteInBody\" : 9223372000000000000 }".as_bytes(),
13446         -
                    ),
13447         -
                ))
       11535  +
                .body(::aws_smithy_http_server::body::Body::empty())
13448  11536   
                .unwrap();
13449  11537   
            #[allow(unused_mut)]
13450  11538   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13451  11539   
            let config = crate::service::RestJsonConfig::builder().build();
13452  11540   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13453         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11541  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13454  11542   
                                let sender = sender.clone();
13455  11543   
                                async move {
13456         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11544  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13457  11545   
                                    sender.send(()).await.expect("receiver dropped early");
13458  11546   
                                    result
13459  11547   
                                }
13460  11548   
                            })
13461  11549   
                            .build_unchecked();
13462  11550   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13463  11551   
                .await
13464  11552   
                .expect("unable to make an HTTP request");
13465  11553   
            ::pretty_assertions::assert_eq!(
13466  11554   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13467  11555   
                http_response.status()
13468  11556   
            );
13469  11557   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13470  11558   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13471  11559   
                http_response.headers(),
13472  11560   
                expected_headers,
13473  11561   
            ));
13474  11562   
        }
13475  11563   
    }
13476  11564   
    /// Underflow or overflow should result in SerializationException
13477         -
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case4
       11565  +
    /// Test ID: RestJsonPathLongUnderflowOverflow_case1
13478  11566   
    #[::tokio::test]
13479         -
    async fn rest_json_body_byte_underflow_overflow_case4_malformed_request() {
       11567  +
    #[::tracing_test::traced_test]
       11568  +
    async fn rest_json_path_long_underflow_overflow_case1_malformed_request() {
13480  11569   
        {
13481  11570   
            #[allow(unused_mut)]
13482  11571   
            let mut http_request = http::Request::builder()
13483         -
                .uri("/MalformedByte/1")
       11572  +
                .uri("/MalformedLong/184467440737095500000")
13484  11573   
                .method("POST")
13485         -
                .header("content-type", "application/json")
13486         -
                .body(::aws_smithy_http_server::body::Body::from(
13487         -
                    ::bytes::Bytes::from_static(
13488         -
                        "{ \"byteInBody\" : 123000000000000000000000 }".as_bytes(),
13489         -
                    ),
13490         -
                ))
       11574  +
                .body(::aws_smithy_http_server::body::Body::empty())
13491  11575   
                .unwrap();
13492  11576   
            #[allow(unused_mut)]
13493  11577   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13494  11578   
            let config = crate::service::RestJsonConfig::builder().build();
13495  11579   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13496         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11580  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13497  11581   
                                let sender = sender.clone();
13498  11582   
                                async move {
13499         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11583  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13500  11584   
                                    sender.send(()).await.expect("receiver dropped early");
13501  11585   
                                    result
13502  11586   
                                }
13503  11587   
                            })
13504  11588   
                            .build_unchecked();
13505  11589   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13506  11590   
                .await
13507  11591   
                .expect("unable to make an HTTP request");
13508  11592   
            ::pretty_assertions::assert_eq!(
13509  11593   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13510  11594   
                http_response.status()
13511  11595   
            );
13512  11596   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13513  11597   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13514  11598   
                http_response.headers(),
13515  11599   
                expected_headers,
13516  11600   
            ));
13517  11601   
        }
13518  11602   
    }
13519  11603   
    /// Underflow or overflow should result in SerializationException
13520         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case0
       11604  +
    /// Test ID: RestJsonPathLongUnderflowOverflow_case2
13521  11605   
    #[::tokio::test]
13522         -
    async fn rest_json_path_byte_underflow_overflow_case0_malformed_request() {
       11606  +
    #[::tracing_test::traced_test]
       11607  +
    async fn rest_json_path_long_underflow_overflow_case2_malformed_request() {
13523  11608   
        {
13524  11609   
            #[allow(unused_mut)]
13525  11610   
            let mut http_request = http::Request::builder()
13526         -
                .uri("/MalformedByte/256")
       11611  +
                .uri("/MalformedLong/123000000000000000000000")
13527  11612   
                .method("POST")
13528  11613   
                .body(::aws_smithy_http_server::body::Body::empty())
13529  11614   
                .unwrap();
13530  11615   
            #[allow(unused_mut)]
13531  11616   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13532  11617   
            let config = crate::service::RestJsonConfig::builder().build();
13533  11618   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13534         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11619  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13535  11620   
                                let sender = sender.clone();
13536  11621   
                                async move {
13537         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11622  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13538  11623   
                                    sender.send(()).await.expect("receiver dropped early");
13539  11624   
                                    result
13540  11625   
                                }
13541  11626   
                            })
13542  11627   
                            .build_unchecked();
13543  11628   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13544  11629   
                .await
13545  11630   
                .expect("unable to make an HTTP request");
13546  11631   
            ::pretty_assertions::assert_eq!(
13547  11632   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13548  11633   
                http_response.status()
13549  11634   
            );
13550  11635   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13551  11636   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13552  11637   
                http_response.headers(),
13553  11638   
                expected_headers,
13554  11639   
            ));
13555  11640   
        }
13556  11641   
    }
13557  11642   
    /// Underflow or overflow should result in SerializationException
13558         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case1
       11643  +
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case0
13559  11644   
    #[::tokio::test]
13560         -
    async fn rest_json_path_byte_underflow_overflow_case1_malformed_request() {
       11645  +
    #[::tracing_test::traced_test]
       11646  +
    async fn rest_json_query_long_underflow_overflow_case0_malformed_request() {
13561  11647   
        {
13562  11648   
            #[allow(unused_mut)]
13563  11649   
            let mut http_request = http::Request::builder()
13564         -
                .uri("/MalformedByte/-256")
       11650  +
                .uri("/MalformedLong/1")
13565  11651   
                .method("POST")
13566  11652   
                .body(::aws_smithy_http_server::body::Body::empty())
13567  11653   
                .unwrap();
       11654  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-184467440737095500000"
       11655  +
                .parse()
       11656  +
                .unwrap();
13568  11657   
            #[allow(unused_mut)]
13569  11658   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13570  11659   
            let config = crate::service::RestJsonConfig::builder().build();
13571  11660   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13572         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11661  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13573  11662   
                                let sender = sender.clone();
13574  11663   
                                async move {
13575         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11664  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13576  11665   
                                    sender.send(()).await.expect("receiver dropped early");
13577  11666   
                                    result
13578  11667   
                                }
13579  11668   
                            })
13580  11669   
                            .build_unchecked();
13581  11670   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13582  11671   
                .await
13583  11672   
                .expect("unable to make an HTTP request");
13584  11673   
            ::pretty_assertions::assert_eq!(
13585  11674   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13586  11675   
                http_response.status()
13587  11676   
            );
13588  11677   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13589  11678   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13590  11679   
                http_response.headers(),
13591  11680   
                expected_headers,
13592  11681   
            ));
13593  11682   
        }
13594  11683   
    }
13595  11684   
    /// Underflow or overflow should result in SerializationException
13596         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case2
       11685  +
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case1
13597  11686   
    #[::tokio::test]
13598         -
    async fn rest_json_path_byte_underflow_overflow_case2_malformed_request() {
       11687  +
    #[::tracing_test::traced_test]
       11688  +
    async fn rest_json_query_long_underflow_overflow_case1_malformed_request() {
13599  11689   
        {
13600  11690   
            #[allow(unused_mut)]
13601  11691   
            let mut http_request = http::Request::builder()
13602         -
                .uri("/MalformedByte/-9223372000000000000")
       11692  +
                .uri("/MalformedLong/1")
13603  11693   
                .method("POST")
13604  11694   
                .body(::aws_smithy_http_server::body::Body::empty())
13605  11695   
                .unwrap();
       11696  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=184467440737095500000"
       11697  +
                .parse()
       11698  +
                .unwrap();
13606  11699   
            #[allow(unused_mut)]
13607  11700   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13608  11701   
            let config = crate::service::RestJsonConfig::builder().build();
13609  11702   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13610         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11703  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13611  11704   
                                let sender = sender.clone();
13612  11705   
                                async move {
13613         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11706  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13614  11707   
                                    sender.send(()).await.expect("receiver dropped early");
13615  11708   
                                    result
13616  11709   
                                }
13617  11710   
                            })
13618  11711   
                            .build_unchecked();
13619  11712   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13620  11713   
                .await
13621  11714   
                .expect("unable to make an HTTP request");
13622  11715   
            ::pretty_assertions::assert_eq!(
13623  11716   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13624  11717   
                http_response.status()
13625  11718   
            );
13626  11719   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13627  11720   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13628  11721   
                http_response.headers(),
13629  11722   
                expected_headers,
13630  11723   
            ));
13631  11724   
        }
13632  11725   
    }
13633  11726   
    /// Underflow or overflow should result in SerializationException
13634         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case3
       11727  +
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case2
13635  11728   
    #[::tokio::test]
13636         -
    async fn rest_json_path_byte_underflow_overflow_case3_malformed_request() {
       11729  +
    #[::tracing_test::traced_test]
       11730  +
    async fn rest_json_query_long_underflow_overflow_case2_malformed_request() {
13637  11731   
        {
13638  11732   
            #[allow(unused_mut)]
13639  11733   
            let mut http_request = http::Request::builder()
13640         -
                .uri("/MalformedByte/9223372000000000000")
       11734  +
                .uri("/MalformedLong/1")
13641  11735   
                .method("POST")
13642  11736   
                .body(::aws_smithy_http_server::body::Body::empty())
13643  11737   
                .unwrap();
       11738  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=123000000000000000000000"
       11739  +
                .parse()
       11740  +
                .unwrap();
13644  11741   
            #[allow(unused_mut)]
13645  11742   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13646  11743   
            let config = crate::service::RestJsonConfig::builder().build();
13647  11744   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13648         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11745  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13649  11746   
                                let sender = sender.clone();
13650  11747   
                                async move {
13651         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11748  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13652  11749   
                                    sender.send(()).await.expect("receiver dropped early");
13653  11750   
                                    result
13654  11751   
                                }
13655  11752   
                            })
13656  11753   
                            .build_unchecked();
13657  11754   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13658  11755   
                .await
13659  11756   
                .expect("unable to make an HTTP request");
13660  11757   
            ::pretty_assertions::assert_eq!(
13661  11758   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13662  11759   
                http_response.status()
13663  11760   
            );
13664  11761   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13665  11762   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13666  11763   
                http_response.headers(),
13667  11764   
                expected_headers,
13668  11765   
            ));
13669  11766   
        }
13670  11767   
    }
13671  11768   
    /// Underflow or overflow should result in SerializationException
13672         -
    /// Test ID: RestJsonPathByteUnderflowOverflow_case4
       11769  +
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case0
13673  11770   
    #[::tokio::test]
13674         -
    async fn rest_json_path_byte_underflow_overflow_case4_malformed_request() {
       11771  +
    #[::tracing_test::traced_test]
       11772  +
    async fn rest_json_header_long_underflow_overflow_case0_malformed_request() {
13675  11773   
        {
13676  11774   
            #[allow(unused_mut)]
13677  11775   
            let mut http_request = http::Request::builder()
13678         -
                .uri("/MalformedByte/123000000000000000000000")
       11776  +
                .uri("/MalformedLong/1")
13679  11777   
                .method("POST")
       11778  +
                .header("longInHeader", "-184467440737095500000")
13680  11779   
                .body(::aws_smithy_http_server::body::Body::empty())
13681  11780   
                .unwrap();
13682  11781   
            #[allow(unused_mut)]
13683  11782   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13684  11783   
            let config = crate::service::RestJsonConfig::builder().build();
13685  11784   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13686         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11785  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13687  11786   
                                let sender = sender.clone();
13688  11787   
                                async move {
13689         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11788  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13690  11789   
                                    sender.send(()).await.expect("receiver dropped early");
13691  11790   
                                    result
13692  11791   
                                }
13693  11792   
                            })
13694  11793   
                            .build_unchecked();
13695  11794   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13696  11795   
                .await
13697  11796   
                .expect("unable to make an HTTP request");
13698  11797   
            ::pretty_assertions::assert_eq!(
13699  11798   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13700  11799   
                http_response.status()
13701  11800   
            );
13702  11801   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13703  11802   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13704  11803   
                http_response.headers(),
13705  11804   
                expected_headers,
13706  11805   
            ));
13707  11806   
        }
13708  11807   
    }
13709  11808   
    /// Underflow or overflow should result in SerializationException
13710         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case0
       11809  +
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case1
13711  11810   
    #[::tokio::test]
13712         -
    async fn rest_json_query_byte_underflow_overflow_case0_malformed_request() {
       11811  +
    #[::tracing_test::traced_test]
       11812  +
    async fn rest_json_header_long_underflow_overflow_case1_malformed_request() {
13713  11813   
        {
13714  11814   
            #[allow(unused_mut)]
13715  11815   
            let mut http_request = http::Request::builder()
13716         -
                .uri("/MalformedByte/1")
       11816  +
                .uri("/MalformedLong/1")
13717  11817   
                .method("POST")
       11818  +
                .header("longInHeader", "184467440737095500000")
13718  11819   
                .body(::aws_smithy_http_server::body::Body::empty())
13719  11820   
                .unwrap();
13720         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=256".parse().unwrap();
13721  11821   
            #[allow(unused_mut)]
13722  11822   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13723  11823   
            let config = crate::service::RestJsonConfig::builder().build();
13724  11824   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13725         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11825  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13726  11826   
                                let sender = sender.clone();
13727  11827   
                                async move {
13728         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11828  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13729  11829   
                                    sender.send(()).await.expect("receiver dropped early");
13730  11830   
                                    result
13731  11831   
                                }
13732  11832   
                            })
13733  11833   
                            .build_unchecked();
13734  11834   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13735  11835   
                .await
13736  11836   
                .expect("unable to make an HTTP request");
13737  11837   
            ::pretty_assertions::assert_eq!(
13738  11838   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13739  11839   
                http_response.status()
13740  11840   
            );
13741  11841   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13742  11842   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13743  11843   
                http_response.headers(),
13744  11844   
                expected_headers,
13745  11845   
            ));
13746  11846   
        }
13747  11847   
    }
13748  11848   
    /// Underflow or overflow should result in SerializationException
13749         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case1
       11849  +
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case2
13750  11850   
    #[::tokio::test]
13751         -
    async fn rest_json_query_byte_underflow_overflow_case1_malformed_request() {
       11851  +
    #[::tracing_test::traced_test]
       11852  +
    async fn rest_json_header_long_underflow_overflow_case2_malformed_request() {
13752  11853   
        {
13753  11854   
            #[allow(unused_mut)]
13754  11855   
            let mut http_request = http::Request::builder()
13755         -
                .uri("/MalformedByte/1")
       11856  +
                .uri("/MalformedLong/1")
13756  11857   
                .method("POST")
       11858  +
                .header("longInHeader", "123000000000000000000000")
13757  11859   
                .body(::aws_smithy_http_server::body::Body::empty())
13758  11860   
                .unwrap();
13759         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-256".parse().unwrap();
13760  11861   
            #[allow(unused_mut)]
13761  11862   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13762  11863   
            let config = crate::service::RestJsonConfig::builder().build();
13763  11864   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13764         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11865  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13765  11866   
                                let sender = sender.clone();
13766  11867   
                                async move {
13767         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11868  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13768  11869   
                                    sender.send(()).await.expect("receiver dropped early");
13769  11870   
                                    result
13770  11871   
                                }
13771  11872   
                            })
13772  11873   
                            .build_unchecked();
13773  11874   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13774  11875   
                .await
13775  11876   
                .expect("unable to make an HTTP request");
13776  11877   
            ::pretty_assertions::assert_eq!(
13777  11878   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13778  11879   
                http_response.status()
13779  11880   
            );
13780  11881   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13781  11882   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13782  11883   
                http_response.headers(),
13783  11884   
                expected_headers,
13784  11885   
            ));
13785  11886   
        }
13786  11887   
    }
13787         -
    /// Underflow or overflow should result in SerializationException
13788         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case2
       11888  +
    /// Malformed values in the body should be rejected
       11889  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case0
13789  11890   
    #[::tokio::test]
13790         -
    async fn rest_json_query_byte_underflow_overflow_case2_malformed_request() {
       11891  +
    #[::tracing_test::traced_test]
       11892  +
    async fn rest_json_body_long_malformed_value_rejected_case0_malformed_request() {
13791  11893   
        {
13792  11894   
            #[allow(unused_mut)]
13793  11895   
            let mut http_request = http::Request::builder()
13794         -
                .uri("/MalformedByte/1")
       11896  +
                .uri("/MalformedLong/1")
13795  11897   
                .method("POST")
13796         -
                .body(::aws_smithy_http_server::body::Body::empty())
13797         -
                .unwrap();
13798         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-9223372000000000000"
13799         -
                .parse()
       11898  +
                .header("content-type", "application/json")
       11899  +
                .body(::aws_smithy_http_server::body::Body::from(
       11900  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"123\" }".as_bytes()),
       11901  +
                ))
13800  11902   
                .unwrap();
13801  11903   
            #[allow(unused_mut)]
13802  11904   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13803  11905   
            let config = crate::service::RestJsonConfig::builder().build();
13804  11906   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13805         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11907  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13806  11908   
                                let sender = sender.clone();
13807  11909   
                                async move {
13808         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11910  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13809  11911   
                                    sender.send(()).await.expect("receiver dropped early");
13810  11912   
                                    result
13811  11913   
                                }
13812  11914   
                            })
13813  11915   
                            .build_unchecked();
13814  11916   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13815  11917   
                .await
13816  11918   
                .expect("unable to make an HTTP request");
13817  11919   
            ::pretty_assertions::assert_eq!(
13818  11920   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13819  11921   
                http_response.status()
13820  11922   
            );
13821  11923   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13822  11924   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13823  11925   
                http_response.headers(),
13824  11926   
                expected_headers,
13825  11927   
            ));
13826  11928   
        }
13827  11929   
    }
13828         -
    /// Underflow or overflow should result in SerializationException
13829         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case3
       11930  +
    /// Malformed values in the body should be rejected
       11931  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case1
13830  11932   
    #[::tokio::test]
13831         -
    async fn rest_json_query_byte_underflow_overflow_case3_malformed_request() {
       11933  +
    #[::tracing_test::traced_test]
       11934  +
    async fn rest_json_body_long_malformed_value_rejected_case1_malformed_request() {
13832  11935   
        {
13833  11936   
            #[allow(unused_mut)]
13834  11937   
            let mut http_request = http::Request::builder()
13835         -
                .uri("/MalformedByte/1")
       11938  +
                .uri("/MalformedLong/1")
13836  11939   
                .method("POST")
13837         -
                .body(::aws_smithy_http_server::body::Body::empty())
13838         -
                .unwrap();
13839         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=9223372000000000000"
13840         -
                .parse()
       11940  +
                .header("content-type", "application/json")
       11941  +
                .body(::aws_smithy_http_server::body::Body::from(
       11942  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : true }".as_bytes()),
       11943  +
                ))
13841  11944   
                .unwrap();
13842  11945   
            #[allow(unused_mut)]
13843  11946   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13844  11947   
            let config = crate::service::RestJsonConfig::builder().build();
13845  11948   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13846         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11949  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13847  11950   
                                let sender = sender.clone();
13848  11951   
                                async move {
13849         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11952  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13850  11953   
                                    sender.send(()).await.expect("receiver dropped early");
13851  11954   
                                    result
13852  11955   
                                }
13853  11956   
                            })
13854  11957   
                            .build_unchecked();
13855  11958   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13856  11959   
                .await
13857  11960   
                .expect("unable to make an HTTP request");
13858  11961   
            ::pretty_assertions::assert_eq!(
13859  11962   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13860  11963   
                http_response.status()
13861  11964   
            );
13862  11965   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13863  11966   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13864  11967   
                http_response.headers(),
13865  11968   
                expected_headers,
13866  11969   
            ));
13867  11970   
        }
13868  11971   
    }
13869         -
    /// Underflow or overflow should result in SerializationException
13870         -
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case4
       11972  +
    /// Malformed values in the body should be rejected
       11973  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case2
13871  11974   
    #[::tokio::test]
13872         -
    async fn rest_json_query_byte_underflow_overflow_case4_malformed_request() {
       11975  +
    #[::tracing_test::traced_test]
       11976  +
    async fn rest_json_body_long_malformed_value_rejected_case2_malformed_request() {
13873  11977   
        {
13874  11978   
            #[allow(unused_mut)]
13875  11979   
            let mut http_request = http::Request::builder()
13876         -
                .uri("/MalformedByte/1")
       11980  +
                .uri("/MalformedLong/1")
13877  11981   
                .method("POST")
13878         -
                .body(::aws_smithy_http_server::body::Body::empty())
13879         -
                .unwrap();
13880         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=123000000000000000000000"
13881         -
                .parse()
       11982  +
                .header("content-type", "application/json")
       11983  +
                .body(::aws_smithy_http_server::body::Body::from(
       11984  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 1.001 }".as_bytes()),
       11985  +
                ))
13882  11986   
                .unwrap();
13883  11987   
            #[allow(unused_mut)]
13884  11988   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13885  11989   
            let config = crate::service::RestJsonConfig::builder().build();
13886  11990   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13887         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       11991  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13888  11992   
                                let sender = sender.clone();
13889  11993   
                                async move {
13890         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       11994  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13891  11995   
                                    sender.send(()).await.expect("receiver dropped early");
13892  11996   
                                    result
13893  11997   
                                }
13894  11998   
                            })
13895  11999   
                            .build_unchecked();
13896  12000   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13897  12001   
                .await
13898  12002   
                .expect("unable to make an HTTP request");
13899  12003   
            ::pretty_assertions::assert_eq!(
13900  12004   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13901  12005   
                http_response.status()
13902  12006   
            );
13903  12007   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13904  12008   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13905  12009   
                http_response.headers(),
13906  12010   
                expected_headers,
13907  12011   
            ));
13908  12012   
        }
13909  12013   
    }
13910         -
    /// Underflow or overflow should result in SerializationException
13911         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case0
       12014  +
    /// Malformed values in the body should be rejected
       12015  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case3
13912  12016   
    #[::tokio::test]
13913         -
    async fn rest_json_header_byte_underflow_overflow_case0_malformed_request() {
       12017  +
    #[::tracing_test::traced_test]
       12018  +
    async fn rest_json_body_long_malformed_value_rejected_case3_malformed_request() {
13914  12019   
        {
13915  12020   
            #[allow(unused_mut)]
13916  12021   
            let mut http_request = http::Request::builder()
13917         -
                .uri("/MalformedByte/1")
       12022  +
                .uri("/MalformedLong/1")
13918  12023   
                .method("POST")
13919         -
                .header("byteInHeader", "256")
13920         -
                .body(::aws_smithy_http_server::body::Body::empty())
       12024  +
                .header("content-type", "application/json")
       12025  +
                .body(::aws_smithy_http_server::body::Body::from(
       12026  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 2ABC }".as_bytes()),
       12027  +
                ))
13921  12028   
                .unwrap();
13922  12029   
            #[allow(unused_mut)]
13923  12030   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13924  12031   
            let config = crate::service::RestJsonConfig::builder().build();
13925  12032   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13926         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12033  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13927  12034   
                                let sender = sender.clone();
13928  12035   
                                async move {
13929         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12036  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13930  12037   
                                    sender.send(()).await.expect("receiver dropped early");
13931  12038   
                                    result
13932  12039   
                                }
13933  12040   
                            })
13934  12041   
                            .build_unchecked();
13935  12042   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13936  12043   
                .await
13937  12044   
                .expect("unable to make an HTTP request");
13938  12045   
            ::pretty_assertions::assert_eq!(
13939  12046   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13940  12047   
                http_response.status()
13941  12048   
            );
13942  12049   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13943  12050   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13944  12051   
                http_response.headers(),
13945  12052   
                expected_headers,
13946  12053   
            ));
13947  12054   
        }
13948  12055   
    }
13949         -
    /// Underflow or overflow should result in SerializationException
13950         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case1
       12056  +
    /// Malformed values in the body should be rejected
       12057  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case4
13951  12058   
    #[::tokio::test]
13952         -
    async fn rest_json_header_byte_underflow_overflow_case1_malformed_request() {
       12059  +
    #[::tracing_test::traced_test]
       12060  +
    async fn rest_json_body_long_malformed_value_rejected_case4_malformed_request() {
13953  12061   
        {
13954  12062   
            #[allow(unused_mut)]
13955  12063   
            let mut http_request = http::Request::builder()
13956         -
                .uri("/MalformedByte/1")
       12064  +
                .uri("/MalformedLong/1")
13957  12065   
                .method("POST")
13958         -
                .header("byteInHeader", "-256")
13959         -
                .body(::aws_smithy_http_server::body::Body::empty())
       12066  +
                .header("content-type", "application/json")
       12067  +
                .body(::aws_smithy_http_server::body::Body::from(
       12068  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 0x42 }".as_bytes()),
       12069  +
                ))
13960  12070   
                .unwrap();
13961  12071   
            #[allow(unused_mut)]
13962  12072   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
13963  12073   
            let config = crate::service::RestJsonConfig::builder().build();
13964  12074   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
13965         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12075  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
13966  12076   
                                let sender = sender.clone();
13967  12077   
                                async move {
13968         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12078  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
13969  12079   
                                    sender.send(()).await.expect("receiver dropped early");
13970  12080   
                                    result
13971  12081   
                                }
13972  12082   
                            })
13973  12083   
                            .build_unchecked();
13974  12084   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
13975  12085   
                .await
13976  12086   
                .expect("unable to make an HTTP request");
13977  12087   
            ::pretty_assertions::assert_eq!(
13978  12088   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
13979  12089   
                http_response.status()
13980  12090   
            );
13981  12091   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
13982  12092   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
13983  12093   
                http_response.headers(),
13984  12094   
                expected_headers,
13985  12095   
            ));
13986  12096   
        }
13987  12097   
    }
13988         -
    /// Underflow or overflow should result in SerializationException
13989         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case2
       12098  +
    /// Malformed values in the body should be rejected
       12099  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case5
13990  12100   
    #[::tokio::test]
13991         -
    async fn rest_json_header_byte_underflow_overflow_case2_malformed_request() {
       12101  +
    #[::tracing_test::traced_test]
       12102  +
    async fn rest_json_body_long_malformed_value_rejected_case5_malformed_request() {
13992  12103   
        {
13993  12104   
            #[allow(unused_mut)]
13994  12105   
            let mut http_request = http::Request::builder()
13995         -
                .uri("/MalformedByte/1")
       12106  +
                .uri("/MalformedLong/1")
13996  12107   
                .method("POST")
13997         -
                .header("byteInHeader", "-9223372000000000000")
13998         -
                .body(::aws_smithy_http_server::body::Body::empty())
       12108  +
                .header("content-type", "application/json")
       12109  +
                .body(::aws_smithy_http_server::body::Body::from(
       12110  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : Infinity }".as_bytes()),
       12111  +
                ))
13999  12112   
                .unwrap();
14000  12113   
            #[allow(unused_mut)]
14001  12114   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14002  12115   
            let config = crate::service::RestJsonConfig::builder().build();
14003  12116   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14004         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12117  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14005  12118   
                                let sender = sender.clone();
14006  12119   
                                async move {
14007         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12120  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14008  12121   
                                    sender.send(()).await.expect("receiver dropped early");
14009  12122   
                                    result
14010  12123   
                                }
14011  12124   
                            })
14012  12125   
                            .build_unchecked();
14013  12126   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14014  12127   
                .await
14015  12128   
                .expect("unable to make an HTTP request");
14016  12129   
            ::pretty_assertions::assert_eq!(
14017  12130   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14018  12131   
                http_response.status()
14019  12132   
            );
14020  12133   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14021  12134   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14022  12135   
                http_response.headers(),
14023  12136   
                expected_headers,
14024  12137   
            ));
14025  12138   
        }
14026  12139   
    }
14027         -
    /// Underflow or overflow should result in SerializationException
14028         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case3
       12140  +
    /// Malformed values in the body should be rejected
       12141  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case6
14029  12142   
    #[::tokio::test]
14030         -
    async fn rest_json_header_byte_underflow_overflow_case3_malformed_request() {
       12143  +
    #[::tracing_test::traced_test]
       12144  +
    async fn rest_json_body_long_malformed_value_rejected_case6_malformed_request() {
14031  12145   
        {
14032  12146   
            #[allow(unused_mut)]
14033  12147   
            let mut http_request = http::Request::builder()
14034         -
                .uri("/MalformedByte/1")
       12148  +
                .uri("/MalformedLong/1")
14035  12149   
                .method("POST")
14036         -
                .header("byteInHeader", "9223372000000000000")
14037         -
                .body(::aws_smithy_http_server::body::Body::empty())
       12150  +
                .header("content-type", "application/json")
       12151  +
                .body(::aws_smithy_http_server::body::Body::from(
       12152  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"Infinity\" }".as_bytes()),
       12153  +
                ))
14038  12154   
                .unwrap();
14039  12155   
            #[allow(unused_mut)]
14040  12156   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14041  12157   
            let config = crate::service::RestJsonConfig::builder().build();
14042  12158   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14043         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12159  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14044  12160   
                                let sender = sender.clone();
14045  12161   
                                async move {
14046         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12162  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14047  12163   
                                    sender.send(()).await.expect("receiver dropped early");
14048  12164   
                                    result
14049  12165   
                                }
14050  12166   
                            })
14051  12167   
                            .build_unchecked();
14052  12168   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14053  12169   
                .await
14054  12170   
                .expect("unable to make an HTTP request");
14055  12171   
            ::pretty_assertions::assert_eq!(
14056  12172   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14057  12173   
                http_response.status()
14058  12174   
            );
14059  12175   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14060  12176   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14061  12177   
                http_response.headers(),
14062  12178   
                expected_headers,
14063  12179   
            ));
14064  12180   
        }
14065  12181   
    }
14066         -
    /// Underflow or overflow should result in SerializationException
14067         -
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case4
       12182  +
    /// Malformed values in the body should be rejected
       12183  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case7
14068  12184   
    #[::tokio::test]
14069         -
    async fn rest_json_header_byte_underflow_overflow_case4_malformed_request() {
       12185  +
    #[::tracing_test::traced_test]
       12186  +
    async fn rest_json_body_long_malformed_value_rejected_case7_malformed_request() {
14070  12187   
        {
14071  12188   
            #[allow(unused_mut)]
14072  12189   
            let mut http_request = http::Request::builder()
14073         -
                .uri("/MalformedByte/1")
       12190  +
                .uri("/MalformedLong/1")
14074  12191   
                .method("POST")
14075         -
                .header("byteInHeader", "123000000000000000000000")
14076         -
                .body(::aws_smithy_http_server::body::Body::empty())
       12192  +
                .header("content-type", "application/json")
       12193  +
                .body(::aws_smithy_http_server::body::Body::from(
       12194  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : -Infinity }".as_bytes()),
       12195  +
                ))
14077  12196   
                .unwrap();
14078  12197   
            #[allow(unused_mut)]
14079  12198   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14080  12199   
            let config = crate::service::RestJsonConfig::builder().build();
14081  12200   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14082         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12201  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14083  12202   
                                let sender = sender.clone();
14084  12203   
                                async move {
14085         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12204  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14086  12205   
                                    sender.send(()).await.expect("receiver dropped early");
14087  12206   
                                    result
14088  12207   
                                }
14089  12208   
                            })
14090  12209   
                            .build_unchecked();
14091  12210   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14092  12211   
                .await
14093  12212   
                .expect("unable to make an HTTP request");
14094  12213   
            ::pretty_assertions::assert_eq!(
14095  12214   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14096  12215   
                http_response.status()
14097  12216   
            );
14098  12217   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14099  12218   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14100  12219   
                http_response.headers(),
14101  12220   
                expected_headers,
14102  12221   
            ));
14103  12222   
        }
14104  12223   
    }
14105  12224   
    /// Malformed values in the body should be rejected
14106         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case0
       12225  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case8
14107  12226   
    #[::tokio::test]
14108         -
    async fn rest_json_body_byte_malformed_value_rejected_case0_malformed_request() {
       12227  +
    #[::tracing_test::traced_test]
       12228  +
    async fn rest_json_body_long_malformed_value_rejected_case8_malformed_request() {
14109  12229   
        {
14110  12230   
            #[allow(unused_mut)]
14111  12231   
            let mut http_request = http::Request::builder()
14112         -
                .uri("/MalformedByte/1")
       12232  +
                .uri("/MalformedLong/1")
14113  12233   
                .method("POST")
14114  12234   
                .header("content-type", "application/json")
14115  12235   
                .body(::aws_smithy_http_server::body::Body::from(
14116         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"123\" }".as_bytes()),
       12236  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"-Infinity\" }".as_bytes()),
14117  12237   
                ))
14118  12238   
                .unwrap();
14119  12239   
            #[allow(unused_mut)]
14120  12240   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14121  12241   
            let config = crate::service::RestJsonConfig::builder().build();
14122  12242   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14123         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12243  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14124  12244   
                                let sender = sender.clone();
14125  12245   
                                async move {
14126         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12246  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14127  12247   
                                    sender.send(()).await.expect("receiver dropped early");
14128  12248   
                                    result
14129  12249   
                                }
14130  12250   
                            })
14131  12251   
                            .build_unchecked();
14132  12252   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14133  12253   
                .await
14134  12254   
                .expect("unable to make an HTTP request");
14135  12255   
            ::pretty_assertions::assert_eq!(
14136  12256   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14137  12257   
                http_response.status()
14138  12258   
            );
14139  12259   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14140  12260   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14141  12261   
                http_response.headers(),
14142  12262   
                expected_headers,
14143  12263   
            ));
14144  12264   
        }
14145  12265   
    }
14146  12266   
    /// Malformed values in the body should be rejected
14147         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case1
       12267  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case9
14148  12268   
    #[::tokio::test]
14149         -
    async fn rest_json_body_byte_malformed_value_rejected_case1_malformed_request() {
       12269  +
    #[::tracing_test::traced_test]
       12270  +
    async fn rest_json_body_long_malformed_value_rejected_case9_malformed_request() {
14150  12271   
        {
14151  12272   
            #[allow(unused_mut)]
14152  12273   
            let mut http_request = http::Request::builder()
14153         -
                .uri("/MalformedByte/1")
       12274  +
                .uri("/MalformedLong/1")
14154  12275   
                .method("POST")
14155  12276   
                .header("content-type", "application/json")
14156  12277   
                .body(::aws_smithy_http_server::body::Body::from(
14157         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : true }".as_bytes()),
       12278  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : NaN }".as_bytes()),
14158  12279   
                ))
14159  12280   
                .unwrap();
14160  12281   
            #[allow(unused_mut)]
14161  12282   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14162  12283   
            let config = crate::service::RestJsonConfig::builder().build();
14163  12284   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14164         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12285  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14165  12286   
                                let sender = sender.clone();
14166  12287   
                                async move {
14167         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12288  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14168  12289   
                                    sender.send(()).await.expect("receiver dropped early");
14169  12290   
                                    result
14170  12291   
                                }
14171  12292   
                            })
14172  12293   
                            .build_unchecked();
14173  12294   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14174  12295   
                .await
14175  12296   
                .expect("unable to make an HTTP request");
14176  12297   
            ::pretty_assertions::assert_eq!(
14177  12298   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14178  12299   
                http_response.status()
14179  12300   
            );
14180  12301   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14181  12302   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14182  12303   
                http_response.headers(),
14183  12304   
                expected_headers,
14184  12305   
            ));
14185  12306   
        }
14186  12307   
    }
14187  12308   
    /// Malformed values in the body should be rejected
14188         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case2
       12309  +
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case10
14189  12310   
    #[::tokio::test]
14190         -
    async fn rest_json_body_byte_malformed_value_rejected_case2_malformed_request() {
       12311  +
    #[::tracing_test::traced_test]
       12312  +
    async fn rest_json_body_long_malformed_value_rejected_case10_malformed_request() {
14191  12313   
        {
14192  12314   
            #[allow(unused_mut)]
14193  12315   
            let mut http_request = http::Request::builder()
14194         -
                .uri("/MalformedByte/1")
       12316  +
                .uri("/MalformedLong/1")
14195  12317   
                .method("POST")
14196  12318   
                .header("content-type", "application/json")
14197  12319   
                .body(::aws_smithy_http_server::body::Body::from(
14198         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 1.001 }".as_bytes()),
       12320  +
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"NaN\" }".as_bytes()),
14199  12321   
                ))
14200  12322   
                .unwrap();
14201  12323   
            #[allow(unused_mut)]
14202  12324   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14203  12325   
            let config = crate::service::RestJsonConfig::builder().build();
14204  12326   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14205         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12327  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14206  12328   
                                let sender = sender.clone();
14207  12329   
                                async move {
14208         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12330  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14209  12331   
                                    sender.send(()).await.expect("receiver dropped early");
14210  12332   
                                    result
14211  12333   
                                }
14212  12334   
                            })
14213  12335   
                            .build_unchecked();
14214  12336   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14215  12337   
                .await
14216  12338   
                .expect("unable to make an HTTP request");
14217  12339   
            ::pretty_assertions::assert_eq!(
14218  12340   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14219  12341   
                http_response.status()
14220  12342   
            );
14221  12343   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14222  12344   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14223  12345   
                http_response.headers(),
14224  12346   
                expected_headers,
14225  12347   
            ));
14226  12348   
        }
14227  12349   
    }
14228         -
    /// Malformed values in the body should be rejected
14229         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case3
       12350  +
    /// Malformed values in the path should be rejected
       12351  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case0
14230  12352   
    #[::tokio::test]
14231         -
    async fn rest_json_body_byte_malformed_value_rejected_case3_malformed_request() {
       12353  +
    #[::tracing_test::traced_test]
       12354  +
    async fn rest_json_path_long_malformed_value_rejected_case0_malformed_request() {
14232  12355   
        {
14233  12356   
            #[allow(unused_mut)]
14234  12357   
            let mut http_request = http::Request::builder()
14235         -
                .uri("/MalformedByte/1")
       12358  +
                .uri("/MalformedLong/true")
14236  12359   
                .method("POST")
14237         -
                .header("content-type", "application/json")
14238         -
                .body(::aws_smithy_http_server::body::Body::from(
14239         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 2ABC }".as_bytes()),
14240         -
                ))
       12360  +
                .body(::aws_smithy_http_server::body::Body::empty())
14241  12361   
                .unwrap();
14242  12362   
            #[allow(unused_mut)]
14243  12363   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14244  12364   
            let config = crate::service::RestJsonConfig::builder().build();
14245  12365   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14246         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12366  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14247  12367   
                                let sender = sender.clone();
14248  12368   
                                async move {
14249         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12369  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14250  12370   
                                    sender.send(()).await.expect("receiver dropped early");
14251  12371   
                                    result
14252  12372   
                                }
14253  12373   
                            })
14254  12374   
                            .build_unchecked();
14255  12375   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14256  12376   
                .await
14257  12377   
                .expect("unable to make an HTTP request");
14258  12378   
            ::pretty_assertions::assert_eq!(
14259  12379   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14260  12380   
                http_response.status()
14261  12381   
            );
14262  12382   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14263  12383   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14264  12384   
                http_response.headers(),
14265  12385   
                expected_headers,
14266  12386   
            ));
14267  12387   
        }
14268  12388   
    }
14269         -
    /// Malformed values in the body should be rejected
14270         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case4
       12389  +
    /// Malformed values in the path should be rejected
       12390  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case1
14271  12391   
    #[::tokio::test]
14272         -
    async fn rest_json_body_byte_malformed_value_rejected_case4_malformed_request() {
       12392  +
    #[::tracing_test::traced_test]
       12393  +
    async fn rest_json_path_long_malformed_value_rejected_case1_malformed_request() {
14273  12394   
        {
14274  12395   
            #[allow(unused_mut)]
14275  12396   
            let mut http_request = http::Request::builder()
14276         -
                .uri("/MalformedByte/1")
       12397  +
                .uri("/MalformedLong/1.001")
14277  12398   
                .method("POST")
14278         -
                .header("content-type", "application/json")
14279         -
                .body(::aws_smithy_http_server::body::Body::from(
14280         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 0x42 }".as_bytes()),
14281         -
                ))
       12399  +
                .body(::aws_smithy_http_server::body::Body::empty())
14282  12400   
                .unwrap();
14283  12401   
            #[allow(unused_mut)]
14284  12402   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14285  12403   
            let config = crate::service::RestJsonConfig::builder().build();
14286  12404   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14287         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12405  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14288  12406   
                                let sender = sender.clone();
14289  12407   
                                async move {
14290         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12408  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14291  12409   
                                    sender.send(()).await.expect("receiver dropped early");
14292  12410   
                                    result
14293  12411   
                                }
14294  12412   
                            })
14295  12413   
                            .build_unchecked();
14296  12414   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14297  12415   
                .await
14298  12416   
                .expect("unable to make an HTTP request");
14299  12417   
            ::pretty_assertions::assert_eq!(
14300  12418   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14301  12419   
                http_response.status()
14302  12420   
            );
14303  12421   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14304  12422   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14305  12423   
                http_response.headers(),
14306  12424   
                expected_headers,
14307  12425   
            ));
14308  12426   
        }
14309  12427   
    }
14310         -
    /// Malformed values in the body should be rejected
14311         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case5
       12428  +
    /// Malformed values in the path should be rejected
       12429  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case2
14312  12430   
    #[::tokio::test]
14313         -
    async fn rest_json_body_byte_malformed_value_rejected_case5_malformed_request() {
       12431  +
    #[::tracing_test::traced_test]
       12432  +
    async fn rest_json_path_long_malformed_value_rejected_case2_malformed_request() {
14314  12433   
        {
14315  12434   
            #[allow(unused_mut)]
14316  12435   
            let mut http_request = http::Request::builder()
14317         -
                .uri("/MalformedByte/1")
       12436  +
                .uri("/MalformedLong/2ABC")
14318  12437   
                .method("POST")
14319         -
                .header("content-type", "application/json")
14320         -
                .body(::aws_smithy_http_server::body::Body::from(
14321         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : Infinity }".as_bytes()),
14322         -
                ))
       12438  +
                .body(::aws_smithy_http_server::body::Body::empty())
14323  12439   
                .unwrap();
14324  12440   
            #[allow(unused_mut)]
14325  12441   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14326  12442   
            let config = crate::service::RestJsonConfig::builder().build();
14327  12443   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14328         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12444  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14329  12445   
                                let sender = sender.clone();
14330  12446   
                                async move {
14331         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12447  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14332  12448   
                                    sender.send(()).await.expect("receiver dropped early");
14333  12449   
                                    result
14334  12450   
                                }
14335  12451   
                            })
14336  12452   
                            .build_unchecked();
14337  12453   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14338  12454   
                .await
14339  12455   
                .expect("unable to make an HTTP request");
14340  12456   
            ::pretty_assertions::assert_eq!(
14341  12457   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14342  12458   
                http_response.status()
14343  12459   
            );
14344  12460   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14345  12461   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14346  12462   
                http_response.headers(),
14347  12463   
                expected_headers,
14348  12464   
            ));
14349  12465   
        }
14350  12466   
    }
14351         -
    /// Malformed values in the body should be rejected
14352         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case6
       12467  +
    /// Malformed values in the path should be rejected
       12468  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case3
14353  12469   
    #[::tokio::test]
14354         -
    async fn rest_json_body_byte_malformed_value_rejected_case6_malformed_request() {
       12470  +
    #[::tracing_test::traced_test]
       12471  +
    async fn rest_json_path_long_malformed_value_rejected_case3_malformed_request() {
14355  12472   
        {
14356  12473   
            #[allow(unused_mut)]
14357  12474   
            let mut http_request = http::Request::builder()
14358         -
                .uri("/MalformedByte/1")
       12475  +
                .uri("/MalformedLong/0x42")
14359  12476   
                .method("POST")
14360         -
                .header("content-type", "application/json")
14361         -
                .body(::aws_smithy_http_server::body::Body::from(
14362         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"Infinity\" }".as_bytes()),
14363         -
                ))
       12477  +
                .body(::aws_smithy_http_server::body::Body::empty())
14364  12478   
                .unwrap();
14365  12479   
            #[allow(unused_mut)]
14366  12480   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14367  12481   
            let config = crate::service::RestJsonConfig::builder().build();
14368  12482   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14369         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12483  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14370  12484   
                                let sender = sender.clone();
14371  12485   
                                async move {
14372         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12486  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14373  12487   
                                    sender.send(()).await.expect("receiver dropped early");
14374  12488   
                                    result
14375  12489   
                                }
14376  12490   
                            })
14377  12491   
                            .build_unchecked();
14378  12492   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14379  12493   
                .await
14380  12494   
                .expect("unable to make an HTTP request");
14381  12495   
            ::pretty_assertions::assert_eq!(
14382  12496   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14383  12497   
                http_response.status()
14384  12498   
            );
14385  12499   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14386  12500   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14387  12501   
                http_response.headers(),
14388  12502   
                expected_headers,
14389  12503   
            ));
14390  12504   
        }
14391  12505   
    }
14392         -
    /// Malformed values in the body should be rejected
14393         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case7
       12506  +
    /// Malformed values in the path should be rejected
       12507  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case4
14394  12508   
    #[::tokio::test]
14395         -
    async fn rest_json_body_byte_malformed_value_rejected_case7_malformed_request() {
       12509  +
    #[::tracing_test::traced_test]
       12510  +
    async fn rest_json_path_long_malformed_value_rejected_case4_malformed_request() {
14396  12511   
        {
14397  12512   
            #[allow(unused_mut)]
14398  12513   
            let mut http_request = http::Request::builder()
14399         -
                .uri("/MalformedByte/1")
       12514  +
                .uri("/MalformedLong/Infinity")
14400  12515   
                .method("POST")
14401         -
                .header("content-type", "application/json")
14402         -
                .body(::aws_smithy_http_server::body::Body::from(
14403         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : -Infinity }".as_bytes()),
14404         -
                ))
       12516  +
                .body(::aws_smithy_http_server::body::Body::empty())
14405  12517   
                .unwrap();
14406  12518   
            #[allow(unused_mut)]
14407  12519   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14408  12520   
            let config = crate::service::RestJsonConfig::builder().build();
14409  12521   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14410         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12522  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14411  12523   
                                let sender = sender.clone();
14412  12524   
                                async move {
14413         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12525  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14414  12526   
                                    sender.send(()).await.expect("receiver dropped early");
14415  12527   
                                    result
14416  12528   
                                }
14417  12529   
                            })
14418  12530   
                            .build_unchecked();
14419  12531   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14420  12532   
                .await
14421  12533   
                .expect("unable to make an HTTP request");
14422  12534   
            ::pretty_assertions::assert_eq!(
14423  12535   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14424  12536   
                http_response.status()
14425  12537   
            );
14426  12538   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14427  12539   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14428  12540   
                http_response.headers(),
14429  12541   
                expected_headers,
14430  12542   
            ));
14431  12543   
        }
14432  12544   
    }
14433         -
    /// Malformed values in the body should be rejected
14434         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case8
       12545  +
    /// Malformed values in the path should be rejected
       12546  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case5
14435  12547   
    #[::tokio::test]
14436         -
    async fn rest_json_body_byte_malformed_value_rejected_case8_malformed_request() {
       12548  +
    #[::tracing_test::traced_test]
       12549  +
    async fn rest_json_path_long_malformed_value_rejected_case5_malformed_request() {
14437  12550   
        {
14438  12551   
            #[allow(unused_mut)]
14439  12552   
            let mut http_request = http::Request::builder()
14440         -
                .uri("/MalformedByte/1")
       12553  +
                .uri("/MalformedLong/-Infinity")
14441  12554   
                .method("POST")
14442         -
                .header("content-type", "application/json")
14443         -
                .body(::aws_smithy_http_server::body::Body::from(
14444         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"-Infinity\" }".as_bytes()),
14445         -
                ))
       12555  +
                .body(::aws_smithy_http_server::body::Body::empty())
14446  12556   
                .unwrap();
14447  12557   
            #[allow(unused_mut)]
14448  12558   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14449  12559   
            let config = crate::service::RestJsonConfig::builder().build();
14450  12560   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14451         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12561  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14452  12562   
                                let sender = sender.clone();
14453  12563   
                                async move {
14454         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12564  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14455  12565   
                                    sender.send(()).await.expect("receiver dropped early");
14456  12566   
                                    result
14457  12567   
                                }
14458  12568   
                            })
14459  12569   
                            .build_unchecked();
14460  12570   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14461  12571   
                .await
14462  12572   
                .expect("unable to make an HTTP request");
14463  12573   
            ::pretty_assertions::assert_eq!(
14464  12574   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14465  12575   
                http_response.status()
14466  12576   
            );
14467  12577   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14468  12578   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14469  12579   
                http_response.headers(),
14470  12580   
                expected_headers,
14471  12581   
            ));
14472  12582   
        }
14473  12583   
    }
14474         -
    /// Malformed values in the body should be rejected
14475         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case9
       12584  +
    /// Malformed values in the path should be rejected
       12585  +
    /// Test ID: RestJsonPathLongMalformedValueRejected_case6
14476  12586   
    #[::tokio::test]
14477         -
    async fn rest_json_body_byte_malformed_value_rejected_case9_malformed_request() {
       12587  +
    #[::tracing_test::traced_test]
       12588  +
    async fn rest_json_path_long_malformed_value_rejected_case6_malformed_request() {
14478  12589   
        {
14479  12590   
            #[allow(unused_mut)]
14480  12591   
            let mut http_request = http::Request::builder()
14481         -
                .uri("/MalformedByte/1")
       12592  +
                .uri("/MalformedLong/NaN")
14482  12593   
                .method("POST")
14483         -
                .header("content-type", "application/json")
14484         -
                .body(::aws_smithy_http_server::body::Body::from(
14485         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : NaN }".as_bytes()),
14486         -
                ))
       12594  +
                .body(::aws_smithy_http_server::body::Body::empty())
14487  12595   
                .unwrap();
14488  12596   
            #[allow(unused_mut)]
14489  12597   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14490  12598   
            let config = crate::service::RestJsonConfig::builder().build();
14491  12599   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14492         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12600  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14493  12601   
                                let sender = sender.clone();
14494  12602   
                                async move {
14495         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12603  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14496  12604   
                                    sender.send(()).await.expect("receiver dropped early");
14497  12605   
                                    result
14498  12606   
                                }
14499  12607   
                            })
14500  12608   
                            .build_unchecked();
14501  12609   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14502  12610   
                .await
14503  12611   
                .expect("unable to make an HTTP request");
14504  12612   
            ::pretty_assertions::assert_eq!(
14505  12613   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14506  12614   
                http_response.status()
14507  12615   
            );
14508  12616   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14509  12617   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14510  12618   
                http_response.headers(),
14511  12619   
                expected_headers,
14512  12620   
            ));
14513  12621   
        }
14514  12622   
    }
14515         -
    /// Malformed values in the body should be rejected
14516         -
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case10
       12623  +
    /// Malformed values in query parameters should be rejected
       12624  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case0
14517  12625   
    #[::tokio::test]
14518         -
    async fn rest_json_body_byte_malformed_value_rejected_case10_malformed_request() {
       12626  +
    #[::tracing_test::traced_test]
       12627  +
    async fn rest_json_query_long_malformed_value_rejected_case0_malformed_request() {
14519  12628   
        {
14520  12629   
            #[allow(unused_mut)]
14521  12630   
            let mut http_request = http::Request::builder()
14522         -
                .uri("/MalformedByte/1")
       12631  +
                .uri("/MalformedLong/1")
14523  12632   
                .method("POST")
14524         -
                .header("content-type", "application/json")
14525         -
                .body(::aws_smithy_http_server::body::Body::from(
14526         -
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"NaN\" }".as_bytes()),
14527         -
                ))
       12633  +
                .body(::aws_smithy_http_server::body::Body::empty())
14528  12634   
                .unwrap();
       12635  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=true".parse().unwrap();
14529  12636   
            #[allow(unused_mut)]
14530  12637   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14531  12638   
            let config = crate::service::RestJsonConfig::builder().build();
14532  12639   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14533         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12640  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14534  12641   
                                let sender = sender.clone();
14535  12642   
                                async move {
14536         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12643  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14537  12644   
                                    sender.send(()).await.expect("receiver dropped early");
14538  12645   
                                    result
14539  12646   
                                }
14540  12647   
                            })
14541  12648   
                            .build_unchecked();
14542  12649   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14543  12650   
                .await
14544  12651   
                .expect("unable to make an HTTP request");
14545  12652   
            ::pretty_assertions::assert_eq!(
14546  12653   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14547  12654   
                http_response.status()
14548  12655   
            );
14549  12656   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14550  12657   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14551  12658   
                http_response.headers(),
14552  12659   
                expected_headers,
14553  12660   
            ));
14554  12661   
        }
14555  12662   
    }
14556         -
    /// Malformed values in the path should be rejected
14557         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case0
       12663  +
    /// Malformed values in query parameters should be rejected
       12664  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case1
14558  12665   
    #[::tokio::test]
14559         -
    async fn rest_json_path_byte_malformed_value_rejected_case0_malformed_request() {
       12666  +
    #[::tracing_test::traced_test]
       12667  +
    async fn rest_json_query_long_malformed_value_rejected_case1_malformed_request() {
14560  12668   
        {
14561  12669   
            #[allow(unused_mut)]
14562  12670   
            let mut http_request = http::Request::builder()
14563         -
                .uri("/MalformedByte/true")
       12671  +
                .uri("/MalformedLong/1")
14564  12672   
                .method("POST")
14565  12673   
                .body(::aws_smithy_http_server::body::Body::empty())
14566  12674   
                .unwrap();
       12675  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=1.001".parse().unwrap();
14567  12676   
            #[allow(unused_mut)]
14568  12677   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14569  12678   
            let config = crate::service::RestJsonConfig::builder().build();
14570  12679   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14571         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12680  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14572  12681   
                                let sender = sender.clone();
14573  12682   
                                async move {
14574         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12683  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14575  12684   
                                    sender.send(()).await.expect("receiver dropped early");
14576  12685   
                                    result
14577  12686   
                                }
14578  12687   
                            })
14579  12688   
                            .build_unchecked();
14580  12689   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14581  12690   
                .await
14582  12691   
                .expect("unable to make an HTTP request");
14583  12692   
            ::pretty_assertions::assert_eq!(
14584  12693   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14585  12694   
                http_response.status()
14586  12695   
            );
14587  12696   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14588  12697   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14589  12698   
                http_response.headers(),
14590  12699   
                expected_headers,
14591  12700   
            ));
14592  12701   
        }
14593  12702   
    }
14594         -
    /// Malformed values in the path should be rejected
14595         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case1
       12703  +
    /// Malformed values in query parameters should be rejected
       12704  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case2
14596  12705   
    #[::tokio::test]
14597         -
    async fn rest_json_path_byte_malformed_value_rejected_case1_malformed_request() {
       12706  +
    #[::tracing_test::traced_test]
       12707  +
    async fn rest_json_query_long_malformed_value_rejected_case2_malformed_request() {
14598  12708   
        {
14599  12709   
            #[allow(unused_mut)]
14600  12710   
            let mut http_request = http::Request::builder()
14601         -
                .uri("/MalformedByte/1.001")
       12711  +
                .uri("/MalformedLong/1")
14602  12712   
                .method("POST")
14603  12713   
                .body(::aws_smithy_http_server::body::Body::empty())
14604  12714   
                .unwrap();
       12715  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=2ABC".parse().unwrap();
14605  12716   
            #[allow(unused_mut)]
14606  12717   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14607  12718   
            let config = crate::service::RestJsonConfig::builder().build();
14608  12719   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14609         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12720  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14610  12721   
                                let sender = sender.clone();
14611  12722   
                                async move {
14612         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12723  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14613  12724   
                                    sender.send(()).await.expect("receiver dropped early");
14614  12725   
                                    result
14615  12726   
                                }
14616  12727   
                            })
14617  12728   
                            .build_unchecked();
14618  12729   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14619  12730   
                .await
14620  12731   
                .expect("unable to make an HTTP request");
14621  12732   
            ::pretty_assertions::assert_eq!(
14622  12733   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14623  12734   
                http_response.status()
14624  12735   
            );
14625  12736   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14626  12737   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14627  12738   
                http_response.headers(),
14628  12739   
                expected_headers,
14629  12740   
            ));
14630  12741   
        }
14631  12742   
    }
14632         -
    /// Malformed values in the path should be rejected
14633         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case2
       12743  +
    /// Malformed values in query parameters should be rejected
       12744  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case3
14634  12745   
    #[::tokio::test]
14635         -
    async fn rest_json_path_byte_malformed_value_rejected_case2_malformed_request() {
       12746  +
    #[::tracing_test::traced_test]
       12747  +
    async fn rest_json_query_long_malformed_value_rejected_case3_malformed_request() {
14636  12748   
        {
14637  12749   
            #[allow(unused_mut)]
14638  12750   
            let mut http_request = http::Request::builder()
14639         -
                .uri("/MalformedByte/2ABC")
       12751  +
                .uri("/MalformedLong/1")
14640  12752   
                .method("POST")
14641  12753   
                .body(::aws_smithy_http_server::body::Body::empty())
14642  12754   
                .unwrap();
       12755  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=0x42".parse().unwrap();
14643  12756   
            #[allow(unused_mut)]
14644  12757   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14645  12758   
            let config = crate::service::RestJsonConfig::builder().build();
14646  12759   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14647         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12760  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14648  12761   
                                let sender = sender.clone();
14649  12762   
                                async move {
14650         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12763  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14651  12764   
                                    sender.send(()).await.expect("receiver dropped early");
14652  12765   
                                    result
14653  12766   
                                }
14654  12767   
                            })
14655  12768   
                            .build_unchecked();
14656  12769   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14657  12770   
                .await
14658  12771   
                .expect("unable to make an HTTP request");
14659  12772   
            ::pretty_assertions::assert_eq!(
14660  12773   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14661  12774   
                http_response.status()
14662  12775   
            );
14663  12776   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14664  12777   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14665  12778   
                http_response.headers(),
14666  12779   
                expected_headers,
14667  12780   
            ));
14668  12781   
        }
14669  12782   
    }
14670         -
    /// Malformed values in the path should be rejected
14671         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case3
       12783  +
    /// Malformed values in query parameters should be rejected
       12784  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case4
14672  12785   
    #[::tokio::test]
14673         -
    async fn rest_json_path_byte_malformed_value_rejected_case3_malformed_request() {
       12786  +
    #[::tracing_test::traced_test]
       12787  +
    async fn rest_json_query_long_malformed_value_rejected_case4_malformed_request() {
14674  12788   
        {
14675  12789   
            #[allow(unused_mut)]
14676  12790   
            let mut http_request = http::Request::builder()
14677         -
                .uri("/MalformedByte/0x42")
       12791  +
                .uri("/MalformedLong/1")
14678  12792   
                .method("POST")
14679  12793   
                .body(::aws_smithy_http_server::body::Body::empty())
14680  12794   
                .unwrap();
       12795  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=Infinity".parse().unwrap();
14681  12796   
            #[allow(unused_mut)]
14682  12797   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14683  12798   
            let config = crate::service::RestJsonConfig::builder().build();
14684  12799   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14685         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12800  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14686  12801   
                                let sender = sender.clone();
14687  12802   
                                async move {
14688         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12803  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14689  12804   
                                    sender.send(()).await.expect("receiver dropped early");
14690  12805   
                                    result
14691  12806   
                                }
14692  12807   
                            })
14693  12808   
                            .build_unchecked();
14694  12809   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14695  12810   
                .await
14696  12811   
                .expect("unable to make an HTTP request");
14697  12812   
            ::pretty_assertions::assert_eq!(
14698  12813   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14699  12814   
                http_response.status()
14700  12815   
            );
14701  12816   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14702  12817   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14703  12818   
                http_response.headers(),
14704  12819   
                expected_headers,
14705  12820   
            ));
14706  12821   
        }
14707  12822   
    }
14708         -
    /// Malformed values in the path should be rejected
14709         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case4
       12823  +
    /// Malformed values in query parameters should be rejected
       12824  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case5
14710  12825   
    #[::tokio::test]
14711         -
    async fn rest_json_path_byte_malformed_value_rejected_case4_malformed_request() {
       12826  +
    #[::tracing_test::traced_test]
       12827  +
    async fn rest_json_query_long_malformed_value_rejected_case5_malformed_request() {
14712  12828   
        {
14713  12829   
            #[allow(unused_mut)]
14714  12830   
            let mut http_request = http::Request::builder()
14715         -
                .uri("/MalformedByte/Infinity")
       12831  +
                .uri("/MalformedLong/1")
14716  12832   
                .method("POST")
14717  12833   
                .body(::aws_smithy_http_server::body::Body::empty())
14718  12834   
                .unwrap();
       12835  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-Infinity".parse().unwrap();
14719  12836   
            #[allow(unused_mut)]
14720  12837   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14721  12838   
            let config = crate::service::RestJsonConfig::builder().build();
14722  12839   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14723         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12840  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14724  12841   
                                let sender = sender.clone();
14725  12842   
                                async move {
14726         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12843  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14727  12844   
                                    sender.send(()).await.expect("receiver dropped early");
14728  12845   
                                    result
14729  12846   
                                }
14730  12847   
                            })
14731  12848   
                            .build_unchecked();
14732  12849   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14733  12850   
                .await
14734  12851   
                .expect("unable to make an HTTP request");
14735  12852   
            ::pretty_assertions::assert_eq!(
14736  12853   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14737  12854   
                http_response.status()
14738  12855   
            );
14739  12856   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14740  12857   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14741  12858   
                http_response.headers(),
14742  12859   
                expected_headers,
14743  12860   
            ));
14744  12861   
        }
14745  12862   
    }
14746         -
    /// Malformed values in the path should be rejected
14747         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case5
       12863  +
    /// Malformed values in query parameters should be rejected
       12864  +
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case6
14748  12865   
    #[::tokio::test]
14749         -
    async fn rest_json_path_byte_malformed_value_rejected_case5_malformed_request() {
       12866  +
    #[::tracing_test::traced_test]
       12867  +
    async fn rest_json_query_long_malformed_value_rejected_case6_malformed_request() {
14750  12868   
        {
14751  12869   
            #[allow(unused_mut)]
14752  12870   
            let mut http_request = http::Request::builder()
14753         -
                .uri("/MalformedByte/-Infinity")
       12871  +
                .uri("/MalformedLong/1")
14754  12872   
                .method("POST")
14755  12873   
                .body(::aws_smithy_http_server::body::Body::empty())
14756  12874   
                .unwrap();
       12875  +
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=NaN".parse().unwrap();
14757  12876   
            #[allow(unused_mut)]
14758  12877   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14759  12878   
            let config = crate::service::RestJsonConfig::builder().build();
14760  12879   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14761         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12880  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14762  12881   
                                let sender = sender.clone();
14763  12882   
                                async move {
14764         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12883  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14765  12884   
                                    sender.send(()).await.expect("receiver dropped early");
14766  12885   
                                    result
14767  12886   
                                }
14768  12887   
                            })
14769  12888   
                            .build_unchecked();
14770  12889   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14771  12890   
                .await
14772  12891   
                .expect("unable to make an HTTP request");
14773  12892   
            ::pretty_assertions::assert_eq!(
14774  12893   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14775  12894   
                http_response.status()
14776  12895   
            );
14777  12896   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14778  12897   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14779  12898   
                http_response.headers(),
14780  12899   
                expected_headers,
14781  12900   
            ));
14782  12901   
        }
14783  12902   
    }
14784         -
    /// Malformed values in the path should be rejected
14785         -
    /// Test ID: RestJsonPathByteMalformedValueRejected_case6
       12903  +
    /// Malformed values in headers should be rejected
       12904  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case0
14786  12905   
    #[::tokio::test]
14787         -
    async fn rest_json_path_byte_malformed_value_rejected_case6_malformed_request() {
       12906  +
    #[::tracing_test::traced_test]
       12907  +
    async fn rest_json_header_long_malformed_value_rejected_case0_malformed_request() {
14788  12908   
        {
14789  12909   
            #[allow(unused_mut)]
14790  12910   
            let mut http_request = http::Request::builder()
14791         -
                .uri("/MalformedByte/NaN")
       12911  +
                .uri("/MalformedLong/1")
14792  12912   
                .method("POST")
       12913  +
                .header("longInHeader", "true")
14793  12914   
                .body(::aws_smithy_http_server::body::Body::empty())
14794  12915   
                .unwrap();
14795  12916   
            #[allow(unused_mut)]
14796  12917   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14797  12918   
            let config = crate::service::RestJsonConfig::builder().build();
14798  12919   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14799         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12920  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14800  12921   
                                let sender = sender.clone();
14801  12922   
                                async move {
14802         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12923  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14803  12924   
                                    sender.send(()).await.expect("receiver dropped early");
14804  12925   
                                    result
14805  12926   
                                }
14806  12927   
                            })
14807  12928   
                            .build_unchecked();
14808  12929   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14809  12930   
                .await
14810  12931   
                .expect("unable to make an HTTP request");
14811  12932   
            ::pretty_assertions::assert_eq!(
14812  12933   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14813  12934   
                http_response.status()
14814  12935   
            );
14815  12936   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14816  12937   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14817  12938   
                http_response.headers(),
14818  12939   
                expected_headers,
14819  12940   
            ));
14820  12941   
        }
14821  12942   
    }
14822         -
    /// Malformed values in query parameters should be rejected
14823         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case0
       12943  +
    /// Malformed values in headers should be rejected
       12944  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case1
14824  12945   
    #[::tokio::test]
14825         -
    async fn rest_json_query_byte_malformed_value_rejected_case0_malformed_request() {
       12946  +
    #[::tracing_test::traced_test]
       12947  +
    async fn rest_json_header_long_malformed_value_rejected_case1_malformed_request() {
14826  12948   
        {
14827  12949   
            #[allow(unused_mut)]
14828  12950   
            let mut http_request = http::Request::builder()
14829         -
                .uri("/MalformedByte/1")
       12951  +
                .uri("/MalformedLong/1")
14830  12952   
                .method("POST")
       12953  +
                .header("longInHeader", "1.001")
14831  12954   
                .body(::aws_smithy_http_server::body::Body::empty())
14832  12955   
                .unwrap();
14833         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=true".parse().unwrap();
14834  12956   
            #[allow(unused_mut)]
14835  12957   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14836  12958   
            let config = crate::service::RestJsonConfig::builder().build();
14837  12959   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14838         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       12960  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14839  12961   
                                let sender = sender.clone();
14840  12962   
                                async move {
14841         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       12963  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14842  12964   
                                    sender.send(()).await.expect("receiver dropped early");
14843  12965   
                                    result
14844  12966   
                                }
14845  12967   
                            })
14846  12968   
                            .build_unchecked();
14847  12969   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14848  12970   
                .await
14849  12971   
                .expect("unable to make an HTTP request");
14850  12972   
            ::pretty_assertions::assert_eq!(
14851  12973   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14852  12974   
                http_response.status()
14853  12975   
            );
14854  12976   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14855  12977   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14856  12978   
                http_response.headers(),
14857  12979   
                expected_headers,
14858  12980   
            ));
14859  12981   
        }
14860  12982   
    }
14861         -
    /// Malformed values in query parameters should be rejected
14862         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case1
       12983  +
    /// Malformed values in headers should be rejected
       12984  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case2
14863  12985   
    #[::tokio::test]
14864         -
    async fn rest_json_query_byte_malformed_value_rejected_case1_malformed_request() {
       12986  +
    #[::tracing_test::traced_test]
       12987  +
    async fn rest_json_header_long_malformed_value_rejected_case2_malformed_request() {
14865  12988   
        {
14866  12989   
            #[allow(unused_mut)]
14867  12990   
            let mut http_request = http::Request::builder()
14868         -
                .uri("/MalformedByte/1")
       12991  +
                .uri("/MalformedLong/1")
14869  12992   
                .method("POST")
       12993  +
                .header("longInHeader", "2ABC")
14870  12994   
                .body(::aws_smithy_http_server::body::Body::empty())
14871  12995   
                .unwrap();
14872         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=1.001".parse().unwrap();
14873  12996   
            #[allow(unused_mut)]
14874  12997   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14875  12998   
            let config = crate::service::RestJsonConfig::builder().build();
14876  12999   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14877         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13000  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14878  13001   
                                let sender = sender.clone();
14879  13002   
                                async move {
14880         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13003  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14881  13004   
                                    sender.send(()).await.expect("receiver dropped early");
14882  13005   
                                    result
14883  13006   
                                }
14884  13007   
                            })
14885  13008   
                            .build_unchecked();
14886  13009   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14887  13010   
                .await
14888  13011   
                .expect("unable to make an HTTP request");
14889  13012   
            ::pretty_assertions::assert_eq!(
14890  13013   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14891  13014   
                http_response.status()
14892  13015   
            );
14893  13016   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14894  13017   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14895  13018   
                http_response.headers(),
14896  13019   
                expected_headers,
14897  13020   
            ));
14898  13021   
        }
14899  13022   
    }
14900         -
    /// Malformed values in query parameters should be rejected
14901         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case2
       13023  +
    /// Malformed values in headers should be rejected
       13024  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case3
14902  13025   
    #[::tokio::test]
14903         -
    async fn rest_json_query_byte_malformed_value_rejected_case2_malformed_request() {
       13026  +
    #[::tracing_test::traced_test]
       13027  +
    async fn rest_json_header_long_malformed_value_rejected_case3_malformed_request() {
14904  13028   
        {
14905  13029   
            #[allow(unused_mut)]
14906  13030   
            let mut http_request = http::Request::builder()
14907         -
                .uri("/MalformedByte/1")
       13031  +
                .uri("/MalformedLong/1")
14908  13032   
                .method("POST")
       13033  +
                .header("longInHeader", "0x42")
14909  13034   
                .body(::aws_smithy_http_server::body::Body::empty())
14910  13035   
                .unwrap();
14911         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=2ABC".parse().unwrap();
14912  13036   
            #[allow(unused_mut)]
14913  13037   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14914  13038   
            let config = crate::service::RestJsonConfig::builder().build();
14915  13039   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14916         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13040  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14917  13041   
                                let sender = sender.clone();
14918  13042   
                                async move {
14919         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13043  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14920  13044   
                                    sender.send(()).await.expect("receiver dropped early");
14921  13045   
                                    result
14922  13046   
                                }
14923  13047   
                            })
14924  13048   
                            .build_unchecked();
14925  13049   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14926  13050   
                .await
14927  13051   
                .expect("unable to make an HTTP request");
14928  13052   
            ::pretty_assertions::assert_eq!(
14929  13053   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14930  13054   
                http_response.status()
14931  13055   
            );
14932  13056   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14933  13057   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14934  13058   
                http_response.headers(),
14935  13059   
                expected_headers,
14936  13060   
            ));
14937  13061   
        }
14938  13062   
    }
14939         -
    /// Malformed values in query parameters should be rejected
14940         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case3
       13063  +
    /// Malformed values in headers should be rejected
       13064  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case4
14941  13065   
    #[::tokio::test]
14942         -
    async fn rest_json_query_byte_malformed_value_rejected_case3_malformed_request() {
       13066  +
    #[::tracing_test::traced_test]
       13067  +
    async fn rest_json_header_long_malformed_value_rejected_case4_malformed_request() {
14943  13068   
        {
14944  13069   
            #[allow(unused_mut)]
14945  13070   
            let mut http_request = http::Request::builder()
14946         -
                .uri("/MalformedByte/1")
       13071  +
                .uri("/MalformedLong/1")
14947  13072   
                .method("POST")
       13073  +
                .header("longInHeader", "Infinity")
14948  13074   
                .body(::aws_smithy_http_server::body::Body::empty())
14949  13075   
                .unwrap();
14950         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=0x42".parse().unwrap();
14951  13076   
            #[allow(unused_mut)]
14952  13077   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14953  13078   
            let config = crate::service::RestJsonConfig::builder().build();
14954  13079   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14955         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13080  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14956  13081   
                                let sender = sender.clone();
14957  13082   
                                async move {
14958         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13083  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14959  13084   
                                    sender.send(()).await.expect("receiver dropped early");
14960  13085   
                                    result
14961  13086   
                                }
14962  13087   
                            })
14963  13088   
                            .build_unchecked();
14964  13089   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
14965  13090   
                .await
14966  13091   
                .expect("unable to make an HTTP request");
14967  13092   
            ::pretty_assertions::assert_eq!(
14968  13093   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
14969  13094   
                http_response.status()
14970  13095   
            );
14971  13096   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
14972  13097   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
14973  13098   
                http_response.headers(),
14974  13099   
                expected_headers,
14975  13100   
            ));
14976  13101   
        }
14977  13102   
    }
14978         -
    /// Malformed values in query parameters should be rejected
14979         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case4
       13103  +
    /// Malformed values in headers should be rejected
       13104  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case5
14980  13105   
    #[::tokio::test]
14981         -
    async fn rest_json_query_byte_malformed_value_rejected_case4_malformed_request() {
       13106  +
    #[::tracing_test::traced_test]
       13107  +
    async fn rest_json_header_long_malformed_value_rejected_case5_malformed_request() {
14982  13108   
        {
14983  13109   
            #[allow(unused_mut)]
14984  13110   
            let mut http_request = http::Request::builder()
14985         -
                .uri("/MalformedByte/1")
       13111  +
                .uri("/MalformedLong/1")
14986  13112   
                .method("POST")
       13113  +
                .header("longInHeader", "-Infinity")
14987  13114   
                .body(::aws_smithy_http_server::body::Body::empty())
14988  13115   
                .unwrap();
14989         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=Infinity".parse().unwrap();
14990  13116   
            #[allow(unused_mut)]
14991  13117   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
14992  13118   
            let config = crate::service::RestJsonConfig::builder().build();
14993  13119   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
14994         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13120  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
14995  13121   
                                let sender = sender.clone();
14996  13122   
                                async move {
14997         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13123  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
14998  13124   
                                    sender.send(()).await.expect("receiver dropped early");
14999  13125   
                                    result
15000  13126   
                                }
15001  13127   
                            })
15002  13128   
                            .build_unchecked();
15003  13129   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15004  13130   
                .await
15005  13131   
                .expect("unable to make an HTTP request");
15006  13132   
            ::pretty_assertions::assert_eq!(
15007  13133   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15008  13134   
                http_response.status()
15009  13135   
            );
15010  13136   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15011  13137   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15012  13138   
                http_response.headers(),
15013  13139   
                expected_headers,
15014  13140   
            ));
15015  13141   
        }
15016  13142   
    }
15017         -
    /// Malformed values in query parameters should be rejected
15018         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case5
       13143  +
    /// Malformed values in headers should be rejected
       13144  +
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case6
15019  13145   
    #[::tokio::test]
15020         -
    async fn rest_json_query_byte_malformed_value_rejected_case5_malformed_request() {
       13146  +
    #[::tracing_test::traced_test]
       13147  +
    async fn rest_json_header_long_malformed_value_rejected_case6_malformed_request() {
15021  13148   
        {
15022  13149   
            #[allow(unused_mut)]
15023  13150   
            let mut http_request = http::Request::builder()
15024         -
                .uri("/MalformedByte/1")
       13151  +
                .uri("/MalformedLong/1")
15025  13152   
                .method("POST")
       13153  +
                .header("longInHeader", "NaN")
15026  13154   
                .body(::aws_smithy_http_server::body::Body::empty())
15027  13155   
                .unwrap();
15028         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-Infinity".parse().unwrap();
15029  13156   
            #[allow(unused_mut)]
15030  13157   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15031  13158   
            let config = crate::service::RestJsonConfig::builder().build();
15032  13159   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15033         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13160  +
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
15034  13161   
                                let sender = sender.clone();
15035  13162   
                                async move {
15036         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13163  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
15037  13164   
                                    sender.send(()).await.expect("receiver dropped early");
15038  13165   
                                    result
15039  13166   
                                }
15040  13167   
                            })
15041  13168   
                            .build_unchecked();
15042  13169   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15043  13170   
                .await
15044  13171   
                .expect("unable to make an HTTP request");
15045  13172   
            ::pretty_assertions::assert_eq!(
15046  13173   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15047  13174   
                http_response.status()
15048  13175   
            );
15049  13176   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15050  13177   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15051  13178   
                http_response.headers(),
15052  13179   
                expected_headers,
15053  13180   
            ));
15054  13181   
        }
15055  13182   
    }
15056         -
    /// Malformed values in query parameters should be rejected
15057         -
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case6
       13183  +
}
       13184  +
       13185  +
const CONTENT_TYPE_MALFORMEDSHORT: ::mime::Mime = ::mime::APPLICATION_JSON;
       13186  +
::pin_project_lite::pin_project! {
       13187  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       13188  +
    /// [`MalformedShortInput`](crate::input::MalformedShortInput) using modelled bindings.
       13189  +
    pub struct MalformedShortInputFuture {
       13190  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedShortInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       13191  +
    }
       13192  +
}
       13193  +
       13194  +
impl std::future::Future for MalformedShortInputFuture {
       13195  +
    type Output = Result<
       13196  +
        crate::input::MalformedShortInput,
       13197  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       13198  +
    >;
       13199  +
       13200  +
    fn poll(
       13201  +
        self: std::pin::Pin<&mut Self>,
       13202  +
        cx: &mut std::task::Context<'_>,
       13203  +
    ) -> std::task::Poll<Self::Output> {
       13204  +
        let this = self.project();
       13205  +
        this.inner.as_mut().poll(cx)
       13206  +
    }
       13207  +
}
       13208  +
       13209  +
impl<B>
       13210  +
    ::aws_smithy_http_server::request::FromRequest<
       13211  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       13212  +
        B,
       13213  +
    > for crate::input::MalformedShortInput
       13214  +
where
       13215  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       13216  +
    B: 'static,
       13217  +
       13218  +
    B::Data: Send,
       13219  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       13220  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       13221  +
{
       13222  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       13223  +
    type Future = MalformedShortInputFuture;
       13224  +
       13225  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       13226  +
        let fut = async move {
       13227  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       13228  +
                request.headers(),
       13229  +
                &CONTENT_TYPE_MALFORMEDSHORT,
       13230  +
            ) {
       13231  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       13232  +
            }
       13233  +
            crate::protocol_serde::shape_malformed_short::de_malformed_short_http_request(request)
       13234  +
                .await
       13235  +
                .map_err(Into::into)
       13236  +
        };
       13237  +
        use ::futures_util::future::TryFutureExt;
       13238  +
        let fut = fut.map_err(
       13239  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       13240  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       13241  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       13242  +
                    e,
       13243  +
                )
       13244  +
            },
       13245  +
        );
       13246  +
        MalformedShortInputFuture {
       13247  +
            inner: Box::pin(fut),
       13248  +
        }
       13249  +
    }
       13250  +
}
       13251  +
impl
       13252  +
    ::aws_smithy_http_server::response::IntoResponse<
       13253  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       13254  +
    > for crate::output::MalformedShortOutput
       13255  +
{
       13256  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       13257  +
        match crate::protocol_serde::shape_malformed_short::ser_malformed_short_http_response(self)
       13258  +
        {
       13259  +
            Ok(response) => response,
       13260  +
            Err(e) => {
       13261  +
                ::tracing::error!(error = %e, "failed to serialize response");
       13262  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       13263  +
            }
       13264  +
        }
       13265  +
    }
       13266  +
}
       13267  +
impl
       13268  +
    ::aws_smithy_http_server::response::IntoResponse<
       13269  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       13270  +
    > for crate::error::MalformedShortError
       13271  +
{
       13272  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       13273  +
        match crate::protocol_serde::shape_malformed_short::ser_malformed_short_http_error(&self) {
       13274  +
            Ok(mut response) => {
       13275  +
                response.extensions_mut().insert(
       13276  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       13277  +
                );
       13278  +
                response
       13279  +
            }
       13280  +
            Err(e) => {
       13281  +
                ::tracing::error!(error = %e, "failed to serialize response");
       13282  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       13283  +
            }
       13284  +
        }
       13285  +
    }
       13286  +
}
       13287  +
       13288  +
#[allow(unreachable_code, unused_variables)]
       13289  +
#[cfg(test)]
       13290  +
mod malformed_short_test {
       13291  +
       13292  +
    /// Underflow or overflow should result in SerializationException
       13293  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case0
15058  13294   
    #[::tokio::test]
15059         -
    async fn rest_json_query_byte_malformed_value_rejected_case6_malformed_request() {
       13295  +
    #[::tracing_test::traced_test]
       13296  +
    async fn rest_json_body_short_underflow_overflow_case0_malformed_request() {
15060  13297   
        {
15061  13298   
            #[allow(unused_mut)]
15062  13299   
            let mut http_request = http::Request::builder()
15063         -
                .uri("/MalformedByte/1")
       13300  +
                .uri("/MalformedShort/1")
15064  13301   
                .method("POST")
15065         -
                .body(::aws_smithy_http_server::body::Body::empty())
       13302  +
                .header("content-type", "application/json")
       13303  +
                .body(::aws_smithy_http_server::body::Body::from(
       13304  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 40000 }".as_bytes()),
       13305  +
                ))
15066  13306   
                .unwrap();
15067         -
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=NaN".parse().unwrap();
15068  13307   
            #[allow(unused_mut)]
15069  13308   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15070  13309   
            let config = crate::service::RestJsonConfig::builder().build();
15071  13310   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15072         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13311  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15073  13312   
                                let sender = sender.clone();
15074  13313   
                                async move {
15075         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13314  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15076  13315   
                                    sender.send(()).await.expect("receiver dropped early");
15077  13316   
                                    result
15078  13317   
                                }
15079  13318   
                            })
15080  13319   
                            .build_unchecked();
15081  13320   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15082  13321   
                .await
15083  13322   
                .expect("unable to make an HTTP request");
15084  13323   
            ::pretty_assertions::assert_eq!(
15085  13324   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15086  13325   
                http_response.status()
15087  13326   
            );
15088  13327   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15089  13328   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15090  13329   
                http_response.headers(),
15091  13330   
                expected_headers,
15092  13331   
            ));
15093  13332   
        }
15094  13333   
    }
15095         -
    /// Malformed values in headers should be rejected
15096         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case0
       13334  +
    /// Underflow or overflow should result in SerializationException
       13335  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case1
15097  13336   
    #[::tokio::test]
15098         -
    async fn rest_json_header_byte_malformed_value_rejected_case0_malformed_request() {
       13337  +
    #[::tracing_test::traced_test]
       13338  +
    async fn rest_json_body_short_underflow_overflow_case1_malformed_request() {
15099  13339   
        {
15100  13340   
            #[allow(unused_mut)]
15101  13341   
            let mut http_request = http::Request::builder()
15102         -
                .uri("/MalformedByte/1")
       13342  +
                .uri("/MalformedShort/1")
15103  13343   
                .method("POST")
15104         -
                .header("byteInHeader", "true")
15105         -
                .body(::aws_smithy_http_server::body::Body::empty())
       13344  +
                .header("content-type", "application/json")
       13345  +
                .body(::aws_smithy_http_server::body::Body::from(
       13346  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : -40000 }".as_bytes()),
       13347  +
                ))
15106  13348   
                .unwrap();
15107  13349   
            #[allow(unused_mut)]
15108  13350   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15109  13351   
            let config = crate::service::RestJsonConfig::builder().build();
15110  13352   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15111         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13353  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15112  13354   
                                let sender = sender.clone();
15113  13355   
                                async move {
15114         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13356  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15115  13357   
                                    sender.send(()).await.expect("receiver dropped early");
15116  13358   
                                    result
15117  13359   
                                }
15118  13360   
                            })
15119  13361   
                            .build_unchecked();
15120  13362   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15121  13363   
                .await
15122  13364   
                .expect("unable to make an HTTP request");
15123  13365   
            ::pretty_assertions::assert_eq!(
15124  13366   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15125  13367   
                http_response.status()
15126  13368   
            );
15127  13369   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15128  13370   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15129  13371   
                http_response.headers(),
15130  13372   
                expected_headers,
15131  13373   
            ));
15132  13374   
        }
15133  13375   
    }
15134         -
    /// Malformed values in headers should be rejected
15135         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case1
       13376  +
    /// Underflow or overflow should result in SerializationException
       13377  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case2
15136  13378   
    #[::tokio::test]
15137         -
    async fn rest_json_header_byte_malformed_value_rejected_case1_malformed_request() {
       13379  +
    #[::tracing_test::traced_test]
       13380  +
    async fn rest_json_body_short_underflow_overflow_case2_malformed_request() {
15138  13381   
        {
15139  13382   
            #[allow(unused_mut)]
15140  13383   
            let mut http_request = http::Request::builder()
15141         -
                .uri("/MalformedByte/1")
       13384  +
                .uri("/MalformedShort/1")
15142  13385   
                .method("POST")
15143         -
                .header("byteInHeader", "1.001")
15144         -
                .body(::aws_smithy_http_server::body::Body::empty())
       13386  +
                .header("content-type", "application/json")
       13387  +
                .body(::aws_smithy_http_server::body::Body::from(
       13388  +
                    ::bytes::Bytes::from_static(
       13389  +
                        "{ \"shortInBody\" : -9223372000000000000 }".as_bytes(),
       13390  +
                    ),
       13391  +
                ))
15145  13392   
                .unwrap();
15146  13393   
            #[allow(unused_mut)]
15147  13394   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15148  13395   
            let config = crate::service::RestJsonConfig::builder().build();
15149  13396   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15150         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13397  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15151  13398   
                                let sender = sender.clone();
15152  13399   
                                async move {
15153         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13400  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15154  13401   
                                    sender.send(()).await.expect("receiver dropped early");
15155  13402   
                                    result
15156  13403   
                                }
15157  13404   
                            })
15158  13405   
                            .build_unchecked();
15159  13406   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15160  13407   
                .await
15161  13408   
                .expect("unable to make an HTTP request");
15162  13409   
            ::pretty_assertions::assert_eq!(
15163  13410   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15164  13411   
                http_response.status()
15165  13412   
            );
15166  13413   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15167  13414   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15168  13415   
                http_response.headers(),
15169  13416   
                expected_headers,
15170  13417   
            ));
15171  13418   
        }
15172  13419   
    }
15173         -
    /// Malformed values in headers should be rejected
15174         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case2
       13420  +
    /// Underflow or overflow should result in SerializationException
       13421  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case3
15175  13422   
    #[::tokio::test]
15176         -
    async fn rest_json_header_byte_malformed_value_rejected_case2_malformed_request() {
       13423  +
    #[::tracing_test::traced_test]
       13424  +
    async fn rest_json_body_short_underflow_overflow_case3_malformed_request() {
15177  13425   
        {
15178  13426   
            #[allow(unused_mut)]
15179  13427   
            let mut http_request = http::Request::builder()
15180         -
                .uri("/MalformedByte/1")
       13428  +
                .uri("/MalformedShort/1")
15181  13429   
                .method("POST")
15182         -
                .header("byteInHeader", "2ABC")
15183         -
                .body(::aws_smithy_http_server::body::Body::empty())
       13430  +
                .header("content-type", "application/json")
       13431  +
                .body(::aws_smithy_http_server::body::Body::from(
       13432  +
                    ::bytes::Bytes::from_static(
       13433  +
                        "{ \"shortInBody\" : 9223372000000000000 }".as_bytes(),
       13434  +
                    ),
       13435  +
                ))
15184  13436   
                .unwrap();
15185  13437   
            #[allow(unused_mut)]
15186  13438   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15187  13439   
            let config = crate::service::RestJsonConfig::builder().build();
15188  13440   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15189         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13441  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15190  13442   
                                let sender = sender.clone();
15191  13443   
                                async move {
15192         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13444  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15193  13445   
                                    sender.send(()).await.expect("receiver dropped early");
15194  13446   
                                    result
15195  13447   
                                }
15196  13448   
                            })
15197  13449   
                            .build_unchecked();
15198  13450   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15199  13451   
                .await
15200  13452   
                .expect("unable to make an HTTP request");
15201  13453   
            ::pretty_assertions::assert_eq!(
15202  13454   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15203  13455   
                http_response.status()
15204  13456   
            );
15205  13457   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15206  13458   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15207  13459   
                http_response.headers(),
15208  13460   
                expected_headers,
15209  13461   
            ));
15210  13462   
        }
15211  13463   
    }
15212         -
    /// Malformed values in headers should be rejected
15213         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case3
       13464  +
    /// Underflow or overflow should result in SerializationException
       13465  +
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case4
15214  13466   
    #[::tokio::test]
15215         -
    async fn rest_json_header_byte_malformed_value_rejected_case3_malformed_request() {
       13467  +
    #[::tracing_test::traced_test]
       13468  +
    async fn rest_json_body_short_underflow_overflow_case4_malformed_request() {
15216  13469   
        {
15217  13470   
            #[allow(unused_mut)]
15218  13471   
            let mut http_request = http::Request::builder()
15219         -
                .uri("/MalformedByte/1")
       13472  +
                .uri("/MalformedShort/1")
15220  13473   
                .method("POST")
15221         -
                .header("byteInHeader", "0x42")
15222         -
                .body(::aws_smithy_http_server::body::Body::empty())
       13474  +
                .header("content-type", "application/json")
       13475  +
                .body(::aws_smithy_http_server::body::Body::from(
       13476  +
                    ::bytes::Bytes::from_static(
       13477  +
                        "{ \"shortInBody\" : 123000000000000000000000 }".as_bytes(),
       13478  +
                    ),
       13479  +
                ))
15223  13480   
                .unwrap();
15224  13481   
            #[allow(unused_mut)]
15225  13482   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15226  13483   
            let config = crate::service::RestJsonConfig::builder().build();
15227  13484   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15228         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13485  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15229  13486   
                                let sender = sender.clone();
15230  13487   
                                async move {
15231         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13488  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15232  13489   
                                    sender.send(()).await.expect("receiver dropped early");
15233  13490   
                                    result
15234  13491   
                                }
15235  13492   
                            })
15236  13493   
                            .build_unchecked();
15237  13494   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15238  13495   
                .await
15239  13496   
                .expect("unable to make an HTTP request");
15240  13497   
            ::pretty_assertions::assert_eq!(
15241  13498   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15242  13499   
                http_response.status()
15243  13500   
            );
15244  13501   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15245  13502   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15246  13503   
                http_response.headers(),
15247  13504   
                expected_headers,
15248  13505   
            ));
15249  13506   
        }
15250  13507   
    }
15251         -
    /// Malformed values in headers should be rejected
15252         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case4
       13508  +
    /// Underflow or overflow should result in SerializationException
       13509  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case0
15253  13510   
    #[::tokio::test]
15254         -
    async fn rest_json_header_byte_malformed_value_rejected_case4_malformed_request() {
       13511  +
    #[::tracing_test::traced_test]
       13512  +
    async fn rest_json_path_short_underflow_overflow_case0_malformed_request() {
15255  13513   
        {
15256  13514   
            #[allow(unused_mut)]
15257  13515   
            let mut http_request = http::Request::builder()
15258         -
                .uri("/MalformedByte/1")
       13516  +
                .uri("/MalformedShort/40000")
15259  13517   
                .method("POST")
15260         -
                .header("byteInHeader", "Infinity")
15261  13518   
                .body(::aws_smithy_http_server::body::Body::empty())
15262  13519   
                .unwrap();
15263  13520   
            #[allow(unused_mut)]
15264  13521   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15265  13522   
            let config = crate::service::RestJsonConfig::builder().build();
15266  13523   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15267         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13524  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15268  13525   
                                let sender = sender.clone();
15269  13526   
                                async move {
15270         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13527  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15271  13528   
                                    sender.send(()).await.expect("receiver dropped early");
15272  13529   
                                    result
15273  13530   
                                }
15274  13531   
                            })
15275  13532   
                            .build_unchecked();
15276  13533   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15277  13534   
                .await
15278  13535   
                .expect("unable to make an HTTP request");
15279  13536   
            ::pretty_assertions::assert_eq!(
15280  13537   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15281  13538   
                http_response.status()
15282  13539   
            );
15283  13540   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15284  13541   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15285  13542   
                http_response.headers(),
15286  13543   
                expected_headers,
15287  13544   
            ));
15288  13545   
        }
15289  13546   
    }
15290         -
    /// Malformed values in headers should be rejected
15291         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case5
       13547  +
    /// Underflow or overflow should result in SerializationException
       13548  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case1
15292  13549   
    #[::tokio::test]
15293         -
    async fn rest_json_header_byte_malformed_value_rejected_case5_malformed_request() {
       13550  +
    #[::tracing_test::traced_test]
       13551  +
    async fn rest_json_path_short_underflow_overflow_case1_malformed_request() {
15294  13552   
        {
15295  13553   
            #[allow(unused_mut)]
15296  13554   
            let mut http_request = http::Request::builder()
15297         -
                .uri("/MalformedByte/1")
       13555  +
                .uri("/MalformedShort/-40000")
15298  13556   
                .method("POST")
15299         -
                .header("byteInHeader", "-Infinity")
15300  13557   
                .body(::aws_smithy_http_server::body::Body::empty())
15301  13558   
                .unwrap();
15302  13559   
            #[allow(unused_mut)]
15303  13560   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15304  13561   
            let config = crate::service::RestJsonConfig::builder().build();
15305  13562   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15306         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13563  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15307  13564   
                                let sender = sender.clone();
15308  13565   
                                async move {
15309         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13566  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15310  13567   
                                    sender.send(()).await.expect("receiver dropped early");
15311  13568   
                                    result
15312  13569   
                                }
15313  13570   
                            })
15314  13571   
                            .build_unchecked();
15315  13572   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15316  13573   
                .await
15317  13574   
                .expect("unable to make an HTTP request");
15318  13575   
            ::pretty_assertions::assert_eq!(
15319  13576   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15320  13577   
                http_response.status()
15321  13578   
            );
15322  13579   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15323  13580   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15324  13581   
                http_response.headers(),
15325  13582   
                expected_headers,
15326  13583   
            ));
15327  13584   
        }
15328  13585   
    }
15329         -
    /// Malformed values in headers should be rejected
15330         -
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case6
       13586  +
    /// Underflow or overflow should result in SerializationException
       13587  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case2
15331  13588   
    #[::tokio::test]
15332         -
    async fn rest_json_header_byte_malformed_value_rejected_case6_malformed_request() {
       13589  +
    #[::tracing_test::traced_test]
       13590  +
    async fn rest_json_path_short_underflow_overflow_case2_malformed_request() {
15333  13591   
        {
15334  13592   
            #[allow(unused_mut)]
15335  13593   
            let mut http_request = http::Request::builder()
15336         -
                .uri("/MalformedByte/1")
       13594  +
                .uri("/MalformedShort/-9223372000000000000")
15337  13595   
                .method("POST")
15338         -
                .header("byteInHeader", "NaN")
15339  13596   
                .body(::aws_smithy_http_server::body::Body::empty())
15340  13597   
                .unwrap();
15341  13598   
            #[allow(unused_mut)]
15342  13599   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15343  13600   
            let config = crate::service::RestJsonConfig::builder().build();
15344  13601   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15345         -
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
       13602  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15346  13603   
                                let sender = sender.clone();
15347  13604   
                                async move {
15348         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
       13605  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15349  13606   
                                    sender.send(()).await.expect("receiver dropped early");
15350  13607   
                                    result
15351  13608   
                                }
15352  13609   
                            })
15353  13610   
                            .build_unchecked();
15354  13611   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15355  13612   
                .await
15356  13613   
                .expect("unable to make an HTTP request");
15357  13614   
            ::pretty_assertions::assert_eq!(
15358  13615   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15359  13616   
                http_response.status()
15360  13617   
            );
15361  13618   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15362  13619   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15363  13620   
                http_response.headers(),
15364  13621   
                expected_headers,
15365  13622   
            ));
15366  13623   
        }
15367  13624   
    }
15368         -
}
15369         -
#[cfg(test)]
15370         -
#[allow(unreachable_code, unused_variables)]
15371         -
mod server_malformed_content_type_with_body_test {
15372         -
    /// When there is modeled input, they content type must be application/json
15373         -
    /// Test ID: RestJsonWithBodyExpectsApplicationJsonContentType
       13625  +
    /// Underflow or overflow should result in SerializationException
       13626  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case3
15374  13627   
    #[::tokio::test]
15375         -
    async fn rest_json_with_body_expects_application_json_content_type_malformed_request() {
       13628  +
    #[::tracing_test::traced_test]
       13629  +
    async fn rest_json_path_short_underflow_overflow_case3_malformed_request() {
15376  13630   
        {
15377  13631   
            #[allow(unused_mut)]
15378  13632   
            let mut http_request = http::Request::builder()
15379         -
                .uri("/MalformedContentTypeWithBody")
       13633  +
                .uri("/MalformedShort/9223372000000000000")
15380  13634   
                .method("POST")
15381         -
                .header("content-type", "application/hal+json")
15382         -
                .body(::aws_smithy_http_server::body::Body::from(
15383         -
                    ::bytes::Bytes::from_static("{}".as_bytes()),
15384         -
                ))
       13635  +
                .body(::aws_smithy_http_server::body::Body::empty())
15385  13636   
                .unwrap();
15386  13637   
            #[allow(unused_mut)]
15387  13638   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15388  13639   
            let config = crate::service::RestJsonConfig::builder().build();
15389  13640   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15390         -
                            .malformed_content_type_with_body(move |input: crate::input::MalformedContentTypeWithBodyInput| {
       13641  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15391  13642   
                                let sender = sender.clone();
15392  13643   
                                async move {
15393         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithBodyOutput };
       13644  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15394  13645   
                                    sender.send(()).await.expect("receiver dropped early");
15395  13646   
                                    result
15396  13647   
                                }
15397  13648   
                            })
15398  13649   
                            .build_unchecked();
15399  13650   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15400  13651   
                .await
15401  13652   
                .expect("unable to make an HTTP request");
15402  13653   
            ::pretty_assertions::assert_eq!(
15403         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
       13654  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15404  13655   
                http_response.status()
15405  13656   
            );
15406         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
       13657  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15407  13658   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15408  13659   
                http_response.headers(),
15409  13660   
                expected_headers,
15410  13661   
            ));
15411  13662   
        }
15412  13663   
    }
15413         -
}
15414         -
#[cfg(test)]
15415         -
#[allow(unreachable_code, unused_variables)]
15416         -
mod server_malformed_content_type_without_body_test {
15417         -
    /// When there is no modeled input, content type must not be set and the body must be empty.
15418         -
    /// Test ID: RestJsonWithoutBodyExpectsEmptyContentType
       13664  +
    /// Underflow or overflow should result in SerializationException
       13665  +
    /// Test ID: RestJsonPathShortUnderflowOverflow_case4
15419  13666   
    #[::tokio::test]
15420         -
    async fn rest_json_without_body_expects_empty_content_type_malformed_request() {
       13667  +
    #[::tracing_test::traced_test]
       13668  +
    async fn rest_json_path_short_underflow_overflow_case4_malformed_request() {
15421  13669   
        {
15422  13670   
            #[allow(unused_mut)]
15423  13671   
            let mut http_request = http::Request::builder()
15424         -
                .uri("/MalformedContentTypeWithoutBody")
       13672  +
                .uri("/MalformedShort/123000000000000000000000")
15425  13673   
                .method("POST")
15426         -
                .header("content-type", "application/json")
15427         -
                .body(::aws_smithy_http_server::body::Body::from(
15428         -
                    ::bytes::Bytes::from_static("{}".as_bytes()),
15429         -
                ))
       13674  +
                .body(::aws_smithy_http_server::body::Body::empty())
15430  13675   
                .unwrap();
15431  13676   
            #[allow(unused_mut)]
15432  13677   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15433  13678   
            let config = crate::service::RestJsonConfig::builder().build();
15434  13679   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15435         -
                            .malformed_content_type_without_body(move |input: crate::input::MalformedContentTypeWithoutBodyInput| {
       13680  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15436  13681   
                                let sender = sender.clone();
15437  13682   
                                async move {
15438         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithoutBodyOutput };
       13683  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15439  13684   
                                    sender.send(()).await.expect("receiver dropped early");
15440  13685   
                                    result
15441  13686   
                                }
15442  13687   
                            })
15443  13688   
                            .build_unchecked();
15444  13689   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15445  13690   
                .await
15446  13691   
                .expect("unable to make an HTTP request");
15447  13692   
            ::pretty_assertions::assert_eq!(
15448         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
       13693  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15449  13694   
                http_response.status()
15450  13695   
            );
15451         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
       13696  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15452  13697   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15453  13698   
                http_response.headers(),
15454  13699   
                expected_headers,
15455  13700   
            ));
15456  13701   
        }
15457  13702   
    }
15458         -
}
15459         -
#[cfg(test)]
15460         -
#[allow(unreachable_code, unused_variables)]
15461         -
mod server_malformed_content_type_with_payload_test {
15462         -
    /// When there is a payload with a mediaType trait, the content type must match.
15463         -
    /// Test ID: RestJsonWithPayloadExpectsModeledContentType
       13703  +
    /// Underflow or overflow should result in SerializationException
       13704  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case0
15464  13705   
    #[::tokio::test]
15465         -
    async fn rest_json_with_payload_expects_modeled_content_type_malformed_request() {
       13706  +
    #[::tracing_test::traced_test]
       13707  +
    async fn rest_json_query_short_underflow_overflow_case0_malformed_request() {
15466  13708   
        {
15467  13709   
            #[allow(unused_mut)]
15468  13710   
            let mut http_request = http::Request::builder()
15469         -
                .uri("/MalformedContentTypeWithPayload")
       13711  +
                .uri("/MalformedShort/1")
15470  13712   
                .method("POST")
15471         -
                .header("content-type", "application/json")
15472         -
                .body(::aws_smithy_http_server::body::Body::from(
15473         -
                    ::bytes::Bytes::from_static("{}".as_bytes()),
15474         -
                ))
       13713  +
                .body(::aws_smithy_http_server::body::Body::empty())
15475  13714   
                .unwrap();
       13715  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=40000".parse().unwrap();
15476  13716   
            #[allow(unused_mut)]
15477  13717   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15478  13718   
            let config = crate::service::RestJsonConfig::builder().build();
15479  13719   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15480         -
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
       13720  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15481  13721   
                                let sender = sender.clone();
15482  13722   
                                async move {
15483         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
       13723  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15484  13724   
                                    sender.send(()).await.expect("receiver dropped early");
15485  13725   
                                    result
15486  13726   
                                }
15487  13727   
                            })
15488  13728   
                            .build_unchecked();
15489  13729   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15490  13730   
                .await
15491  13731   
                .expect("unable to make an HTTP request");
15492  13732   
            ::pretty_assertions::assert_eq!(
15493         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
       13733  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15494  13734   
                http_response.status()
15495  13735   
            );
15496         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
       13736  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15497  13737   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15498  13738   
                http_response.headers(),
15499  13739   
                expected_headers,
15500  13740   
            ));
15501  13741   
        }
15502  13742   
    }
15503         -
    /// When there is a payload without a mediaType trait, the content type must match the
15504         -
    /// implied content type of the shape.
15505         -
    /// Test ID: RestJsonWithPayloadExpectsImpliedContentType
       13743  +
    /// Underflow or overflow should result in SerializationException
       13744  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case1
15506  13745   
    #[::tokio::test]
15507         -
    async fn rest_json_with_payload_expects_implied_content_type_malformed_request() {
       13746  +
    #[::tracing_test::traced_test]
       13747  +
    async fn rest_json_query_short_underflow_overflow_case1_malformed_request() {
15508  13748   
        {
15509  13749   
            #[allow(unused_mut)]
15510  13750   
            let mut http_request = http::Request::builder()
15511         -
                .uri("/MalformedContentTypeWithPayload")
       13751  +
                .uri("/MalformedShort/1")
15512  13752   
                .method("POST")
15513         -
                .header("content-type", "application/json")
15514         -
                .body(::aws_smithy_http_server::body::Body::from(
15515         -
                    ::bytes::Bytes::from_static("{}".as_bytes()),
15516         -
                ))
       13753  +
                .body(::aws_smithy_http_server::body::Body::empty())
15517  13754   
                .unwrap();
       13755  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-40000".parse().unwrap();
15518  13756   
            #[allow(unused_mut)]
15519  13757   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15520  13758   
            let config = crate::service::RestJsonConfig::builder().build();
15521  13759   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15522         -
                            .malformed_content_type_with_payload(move |input: crate::input::MalformedContentTypeWithPayloadInput| {
       13760  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15523  13761   
                                let sender = sender.clone();
15524  13762   
                                async move {
15525         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedContentTypeWithPayloadOutput };
       13763  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15526  13764   
                                    sender.send(()).await.expect("receiver dropped early");
15527  13765   
                                    result
15528  13766   
                                }
15529  13767   
                            })
15530  13768   
                            .build_unchecked();
15531  13769   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15532  13770   
                .await
15533  13771   
                .expect("unable to make an HTTP request");
15534  13772   
            ::pretty_assertions::assert_eq!(
15535         -
                http::StatusCode::from_u16(415).expect("invalid expected HTTP status code"),
       13773  +
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15536  13774   
                http_response.status()
15537  13775   
            );
15538         -
            let expected_headers = [("x-amzn-errortype", "UnsupportedMediaTypeException")];
       13776  +
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15539  13777   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15540  13778   
                http_response.headers(),
15541  13779   
                expected_headers,
15542  13780   
            ));
15543  13781   
        }
15544  13782   
    }
15545         -
}
15546         -
#[cfg(test)]
15547         -
#[allow(unreachable_code, unused_variables)]
15548         -
mod server_malformed_double_test {
15549         -
    /// Malformed values in the body should be rejected
15550         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case0
       13783  +
    /// Underflow or overflow should result in SerializationException
       13784  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case2
15551  13785   
    #[::tokio::test]
15552         -
    async fn rest_json_body_double_malformed_value_rejected_case0_malformed_request() {
       13786  +
    #[::tracing_test::traced_test]
       13787  +
    async fn rest_json_query_short_underflow_overflow_case2_malformed_request() {
15553  13788   
        {
15554  13789   
            #[allow(unused_mut)]
15555  13790   
            let mut http_request = http::Request::builder()
15556         -
                .uri("/MalformedDouble/1")
       13791  +
                .uri("/MalformedShort/1")
15557  13792   
                .method("POST")
15558         -
                .header("content-type", "application/json")
15559         -
                .body(::aws_smithy_http_server::body::Body::from(
15560         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : \"123\" }".as_bytes()),
15561         -
                ))
       13793  +
                .body(::aws_smithy_http_server::body::Body::empty())
       13794  +
                .unwrap();
       13795  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-9223372000000000000"
       13796  +
                .parse()
15562  13797   
                .unwrap();
15563  13798   
            #[allow(unused_mut)]
15564  13799   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15565  13800   
            let config = crate::service::RestJsonConfig::builder().build();
15566  13801   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15567         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       13802  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15568  13803   
                                let sender = sender.clone();
15569  13804   
                                async move {
15570         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       13805  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15571  13806   
                                    sender.send(()).await.expect("receiver dropped early");
15572  13807   
                                    result
15573  13808   
                                }
15574  13809   
                            })
15575  13810   
                            .build_unchecked();
15576  13811   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15577  13812   
                .await
15578  13813   
                .expect("unable to make an HTTP request");
15579  13814   
            ::pretty_assertions::assert_eq!(
15580  13815   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15581  13816   
                http_response.status()
15582  13817   
            );
15583  13818   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15584  13819   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15585  13820   
                http_response.headers(),
15586  13821   
                expected_headers,
15587  13822   
            ));
15588  13823   
        }
15589  13824   
    }
15590         -
    /// Malformed values in the body should be rejected
15591         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case1
       13825  +
    /// Underflow or overflow should result in SerializationException
       13826  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case3
15592  13827   
    #[::tokio::test]
15593         -
    async fn rest_json_body_double_malformed_value_rejected_case1_malformed_request() {
       13828  +
    #[::tracing_test::traced_test]
       13829  +
    async fn rest_json_query_short_underflow_overflow_case3_malformed_request() {
15594  13830   
        {
15595  13831   
            #[allow(unused_mut)]
15596  13832   
            let mut http_request = http::Request::builder()
15597         -
                .uri("/MalformedDouble/1")
       13833  +
                .uri("/MalformedShort/1")
15598  13834   
                .method("POST")
15599         -
                .header("content-type", "application/json")
15600         -
                .body(::aws_smithy_http_server::body::Body::from(
15601         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : true }".as_bytes()),
15602         -
                ))
       13835  +
                .body(::aws_smithy_http_server::body::Body::empty())
       13836  +
                .unwrap();
       13837  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=9223372000000000000"
       13838  +
                .parse()
15603  13839   
                .unwrap();
15604  13840   
            #[allow(unused_mut)]
15605  13841   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15606  13842   
            let config = crate::service::RestJsonConfig::builder().build();
15607  13843   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15608         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       13844  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15609  13845   
                                let sender = sender.clone();
15610  13846   
                                async move {
15611         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       13847  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15612  13848   
                                    sender.send(()).await.expect("receiver dropped early");
15613  13849   
                                    result
15614  13850   
                                }
15615  13851   
                            })
15616  13852   
                            .build_unchecked();
15617  13853   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15618  13854   
                .await
15619  13855   
                .expect("unable to make an HTTP request");
15620  13856   
            ::pretty_assertions::assert_eq!(
15621  13857   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15622  13858   
                http_response.status()
15623  13859   
            );
15624  13860   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15625  13861   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15626  13862   
                http_response.headers(),
15627  13863   
                expected_headers,
15628  13864   
            ));
15629  13865   
        }
15630  13866   
    }
15631         -
    /// Malformed values in the body should be rejected
15632         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case2
       13867  +
    /// Underflow or overflow should result in SerializationException
       13868  +
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case4
15633  13869   
    #[::tokio::test]
15634         -
    async fn rest_json_body_double_malformed_value_rejected_case2_malformed_request() {
       13870  +
    #[::tracing_test::traced_test]
       13871  +
    async fn rest_json_query_short_underflow_overflow_case4_malformed_request() {
15635  13872   
        {
15636  13873   
            #[allow(unused_mut)]
15637  13874   
            let mut http_request = http::Request::builder()
15638         -
                .uri("/MalformedDouble/1")
       13875  +
                .uri("/MalformedShort/1")
15639  13876   
                .method("POST")
15640         -
                .header("content-type", "application/json")
15641         -
                .body(::aws_smithy_http_server::body::Body::from(
15642         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 2ABC }".as_bytes()),
15643         -
                ))
       13877  +
                .body(::aws_smithy_http_server::body::Body::empty())
       13878  +
                .unwrap();
       13879  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=123000000000000000000000"
       13880  +
                .parse()
15644  13881   
                .unwrap();
15645  13882   
            #[allow(unused_mut)]
15646  13883   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15647  13884   
            let config = crate::service::RestJsonConfig::builder().build();
15648  13885   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15649         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       13886  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15650  13887   
                                let sender = sender.clone();
15651  13888   
                                async move {
15652         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       13889  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15653  13890   
                                    sender.send(()).await.expect("receiver dropped early");
15654  13891   
                                    result
15655  13892   
                                }
15656  13893   
                            })
15657  13894   
                            .build_unchecked();
15658  13895   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15659  13896   
                .await
15660  13897   
                .expect("unable to make an HTTP request");
15661  13898   
            ::pretty_assertions::assert_eq!(
15662  13899   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15663  13900   
                http_response.status()
15664  13901   
            );
15665  13902   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15666  13903   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15667  13904   
                http_response.headers(),
15668  13905   
                expected_headers,
15669  13906   
            ));
15670  13907   
        }
15671  13908   
    }
15672         -
    /// Malformed values in the body should be rejected
15673         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case3
       13909  +
    /// Underflow or overflow should result in SerializationException
       13910  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case0
15674  13911   
    #[::tokio::test]
15675         -
    async fn rest_json_body_double_malformed_value_rejected_case3_malformed_request() {
       13912  +
    #[::tracing_test::traced_test]
       13913  +
    async fn rest_json_header_short_underflow_overflow_case0_malformed_request() {
15676  13914   
        {
15677  13915   
            #[allow(unused_mut)]
15678  13916   
            let mut http_request = http::Request::builder()
15679         -
                .uri("/MalformedDouble/1")
       13917  +
                .uri("/MalformedShort/1")
15680  13918   
                .method("POST")
15681         -
                .header("content-type", "application/json")
15682         -
                .body(::aws_smithy_http_server::body::Body::from(
15683         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : 0x42 }".as_bytes()),
15684         -
                ))
       13919  +
                .header("shortInHeader", "40000")
       13920  +
                .body(::aws_smithy_http_server::body::Body::empty())
15685  13921   
                .unwrap();
15686  13922   
            #[allow(unused_mut)]
15687  13923   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15688  13924   
            let config = crate::service::RestJsonConfig::builder().build();
15689  13925   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15690         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       13926  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15691  13927   
                                let sender = sender.clone();
15692  13928   
                                async move {
15693         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       13929  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15694  13930   
                                    sender.send(()).await.expect("receiver dropped early");
15695  13931   
                                    result
15696  13932   
                                }
15697  13933   
                            })
15698  13934   
                            .build_unchecked();
15699  13935   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15700  13936   
                .await
15701  13937   
                .expect("unable to make an HTTP request");
15702  13938   
            ::pretty_assertions::assert_eq!(
15703  13939   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15704  13940   
                http_response.status()
15705  13941   
            );
15706  13942   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15707  13943   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15708  13944   
                http_response.headers(),
15709  13945   
                expected_headers,
15710  13946   
            ));
15711  13947   
        }
15712  13948   
    }
15713         -
    /// Malformed values in the body should be rejected
15714         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case4
       13949  +
    /// Underflow or overflow should result in SerializationException
       13950  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case1
15715  13951   
    #[::tokio::test]
15716         -
    async fn rest_json_body_double_malformed_value_rejected_case4_malformed_request() {
       13952  +
    #[::tracing_test::traced_test]
       13953  +
    async fn rest_json_header_short_underflow_overflow_case1_malformed_request() {
15717  13954   
        {
15718  13955   
            #[allow(unused_mut)]
15719  13956   
            let mut http_request = http::Request::builder()
15720         -
                .uri("/MalformedDouble/1")
       13957  +
                .uri("/MalformedShort/1")
15721  13958   
                .method("POST")
15722         -
                .header("content-type", "application/json")
15723         -
                .body(::aws_smithy_http_server::body::Body::from(
15724         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : Infinity }".as_bytes()),
15725         -
                ))
       13959  +
                .header("shortInHeader", "-40000")
       13960  +
                .body(::aws_smithy_http_server::body::Body::empty())
15726  13961   
                .unwrap();
15727  13962   
            #[allow(unused_mut)]
15728  13963   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15729  13964   
            let config = crate::service::RestJsonConfig::builder().build();
15730  13965   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15731         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       13966  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15732  13967   
                                let sender = sender.clone();
15733  13968   
                                async move {
15734         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       13969  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15735  13970   
                                    sender.send(()).await.expect("receiver dropped early");
15736  13971   
                                    result
15737  13972   
                                }
15738  13973   
                            })
15739  13974   
                            .build_unchecked();
15740  13975   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15741  13976   
                .await
15742  13977   
                .expect("unable to make an HTTP request");
15743  13978   
            ::pretty_assertions::assert_eq!(
15744  13979   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15745  13980   
                http_response.status()
15746  13981   
            );
15747  13982   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15748  13983   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15749  13984   
                http_response.headers(),
15750  13985   
                expected_headers,
15751  13986   
            ));
15752  13987   
        }
15753  13988   
    }
15754         -
    /// Malformed values in the body should be rejected
15755         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case5
       13989  +
    /// Underflow or overflow should result in SerializationException
       13990  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case2
15756  13991   
    #[::tokio::test]
15757         -
    async fn rest_json_body_double_malformed_value_rejected_case5_malformed_request() {
       13992  +
    #[::tracing_test::traced_test]
       13993  +
    async fn rest_json_header_short_underflow_overflow_case2_malformed_request() {
15758  13994   
        {
15759  13995   
            #[allow(unused_mut)]
15760  13996   
            let mut http_request = http::Request::builder()
15761         -
                .uri("/MalformedDouble/1")
       13997  +
                .uri("/MalformedShort/1")
15762  13998   
                .method("POST")
15763         -
                .header("content-type", "application/json")
15764         -
                .body(::aws_smithy_http_server::body::Body::from(
15765         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : -Infinity }".as_bytes()),
15766         -
                ))
       13999  +
                .header("shortInHeader", "-9223372000000000000")
       14000  +
                .body(::aws_smithy_http_server::body::Body::empty())
15767  14001   
                .unwrap();
15768  14002   
            #[allow(unused_mut)]
15769  14003   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15770  14004   
            let config = crate::service::RestJsonConfig::builder().build();
15771  14005   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15772         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14006  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15773  14007   
                                let sender = sender.clone();
15774  14008   
                                async move {
15775         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14009  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15776  14010   
                                    sender.send(()).await.expect("receiver dropped early");
15777  14011   
                                    result
15778  14012   
                                }
15779  14013   
                            })
15780  14014   
                            .build_unchecked();
15781  14015   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15782  14016   
                .await
15783  14017   
                .expect("unable to make an HTTP request");
15784  14018   
            ::pretty_assertions::assert_eq!(
15785  14019   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15786  14020   
                http_response.status()
15787  14021   
            );
15788  14022   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15789  14023   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15790  14024   
                http_response.headers(),
15791  14025   
                expected_headers,
15792  14026   
            ));
15793  14027   
        }
15794  14028   
    }
15795         -
    /// Malformed values in the body should be rejected
15796         -
    /// Test ID: RestJsonBodyDoubleMalformedValueRejected_case6
       14029  +
    /// Underflow or overflow should result in SerializationException
       14030  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case3
15797  14031   
    #[::tokio::test]
15798         -
    async fn rest_json_body_double_malformed_value_rejected_case6_malformed_request() {
       14032  +
    #[::tracing_test::traced_test]
       14033  +
    async fn rest_json_header_short_underflow_overflow_case3_malformed_request() {
15799  14034   
        {
15800  14035   
            #[allow(unused_mut)]
15801  14036   
            let mut http_request = http::Request::builder()
15802         -
                .uri("/MalformedDouble/1")
       14037  +
                .uri("/MalformedShort/1")
15803  14038   
                .method("POST")
15804         -
                .header("content-type", "application/json")
15805         -
                .body(::aws_smithy_http_server::body::Body::from(
15806         -
                    ::bytes::Bytes::from_static("{ \"doubleInBody\" : NaN }".as_bytes()),
15807         -
                ))
       14039  +
                .header("shortInHeader", "9223372000000000000")
       14040  +
                .body(::aws_smithy_http_server::body::Body::empty())
15808  14041   
                .unwrap();
15809  14042   
            #[allow(unused_mut)]
15810  14043   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15811  14044   
            let config = crate::service::RestJsonConfig::builder().build();
15812  14045   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15813         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14046  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15814  14047   
                                let sender = sender.clone();
15815  14048   
                                async move {
15816         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14049  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15817  14050   
                                    sender.send(()).await.expect("receiver dropped early");
15818  14051   
                                    result
15819  14052   
                                }
15820  14053   
                            })
15821  14054   
                            .build_unchecked();
15822  14055   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15823  14056   
                .await
15824  14057   
                .expect("unable to make an HTTP request");
15825  14058   
            ::pretty_assertions::assert_eq!(
15826  14059   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15827  14060   
                http_response.status()
15828  14061   
            );
15829  14062   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15830  14063   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15831  14064   
                http_response.headers(),
15832  14065   
                expected_headers,
15833  14066   
            ));
15834  14067   
        }
15835  14068   
    }
15836         -
    /// Malformed values in the path should be rejected
15837         -
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case0
       14069  +
    /// Underflow or overflow should result in SerializationException
       14070  +
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case4
15838  14071   
    #[::tokio::test]
15839         -
    async fn rest_json_path_double_malformed_value_rejected_case0_malformed_request() {
       14072  +
    #[::tracing_test::traced_test]
       14073  +
    async fn rest_json_header_short_underflow_overflow_case4_malformed_request() {
15840  14074   
        {
15841  14075   
            #[allow(unused_mut)]
15842  14076   
            let mut http_request = http::Request::builder()
15843         -
                .uri("/MalformedDouble/true")
       14077  +
                .uri("/MalformedShort/1")
15844  14078   
                .method("POST")
       14079  +
                .header("shortInHeader", "123000000000000000000000")
15845  14080   
                .body(::aws_smithy_http_server::body::Body::empty())
15846  14081   
                .unwrap();
15847  14082   
            #[allow(unused_mut)]
15848  14083   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15849  14084   
            let config = crate::service::RestJsonConfig::builder().build();
15850  14085   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15851         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14086  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15852  14087   
                                let sender = sender.clone();
15853  14088   
                                async move {
15854         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14089  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15855  14090   
                                    sender.send(()).await.expect("receiver dropped early");
15856  14091   
                                    result
15857  14092   
                                }
15858  14093   
                            })
15859  14094   
                            .build_unchecked();
15860  14095   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15861  14096   
                .await
15862  14097   
                .expect("unable to make an HTTP request");
15863  14098   
            ::pretty_assertions::assert_eq!(
15864  14099   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15865  14100   
                http_response.status()
15866  14101   
            );
15867  14102   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15868  14103   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15869  14104   
                http_response.headers(),
15870  14105   
                expected_headers,
15871  14106   
            ));
15872  14107   
        }
15873  14108   
    }
15874         -
    /// Malformed values in the path should be rejected
15875         -
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case1
       14109  +
    /// Malformed values in the body should be rejected
       14110  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case0
15876  14111   
    #[::tokio::test]
15877         -
    async fn rest_json_path_double_malformed_value_rejected_case1_malformed_request() {
       14112  +
    #[::tracing_test::traced_test]
       14113  +
    async fn rest_json_body_short_malformed_value_rejected_case0_malformed_request() {
15878  14114   
        {
15879  14115   
            #[allow(unused_mut)]
15880  14116   
            let mut http_request = http::Request::builder()
15881         -
                .uri("/MalformedDouble/2ABC")
       14117  +
                .uri("/MalformedShort/1")
15882  14118   
                .method("POST")
15883         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14119  +
                .header("content-type", "application/json")
       14120  +
                .body(::aws_smithy_http_server::body::Body::from(
       14121  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"123\" }".as_bytes()),
       14122  +
                ))
15884  14123   
                .unwrap();
15885  14124   
            #[allow(unused_mut)]
15886  14125   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15887  14126   
            let config = crate::service::RestJsonConfig::builder().build();
15888  14127   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15889         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14128  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15890  14129   
                                let sender = sender.clone();
15891  14130   
                                async move {
15892         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14131  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15893  14132   
                                    sender.send(()).await.expect("receiver dropped early");
15894  14133   
                                    result
15895  14134   
                                }
15896  14135   
                            })
15897  14136   
                            .build_unchecked();
15898  14137   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15899  14138   
                .await
15900  14139   
                .expect("unable to make an HTTP request");
15901  14140   
            ::pretty_assertions::assert_eq!(
15902  14141   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15903  14142   
                http_response.status()
15904  14143   
            );
15905  14144   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15906  14145   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15907  14146   
                http_response.headers(),
15908  14147   
                expected_headers,
15909  14148   
            ));
15910  14149   
        }
15911  14150   
    }
15912         -
    /// Malformed values in the path should be rejected
15913         -
    /// Test ID: RestJsonPathDoubleMalformedValueRejected_case2
       14151  +
    /// Malformed values in the body should be rejected
       14152  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case1
15914  14153   
    #[::tokio::test]
15915         -
    async fn rest_json_path_double_malformed_value_rejected_case2_malformed_request() {
       14154  +
    #[::tracing_test::traced_test]
       14155  +
    async fn rest_json_body_short_malformed_value_rejected_case1_malformed_request() {
15916  14156   
        {
15917  14157   
            #[allow(unused_mut)]
15918  14158   
            let mut http_request = http::Request::builder()
15919         -
                .uri("/MalformedDouble/0x42")
       14159  +
                .uri("/MalformedShort/1")
15920  14160   
                .method("POST")
15921         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14161  +
                .header("content-type", "application/json")
       14162  +
                .body(::aws_smithy_http_server::body::Body::from(
       14163  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : true }".as_bytes()),
       14164  +
                ))
15922  14165   
                .unwrap();
15923  14166   
            #[allow(unused_mut)]
15924  14167   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15925  14168   
            let config = crate::service::RestJsonConfig::builder().build();
15926  14169   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15927         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14170  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15928  14171   
                                let sender = sender.clone();
15929  14172   
                                async move {
15930         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14173  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15931  14174   
                                    sender.send(()).await.expect("receiver dropped early");
15932  14175   
                                    result
15933  14176   
                                }
15934  14177   
                            })
15935  14178   
                            .build_unchecked();
15936  14179   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15937  14180   
                .await
15938  14181   
                .expect("unable to make an HTTP request");
15939  14182   
            ::pretty_assertions::assert_eq!(
15940  14183   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15941  14184   
                http_response.status()
15942  14185   
            );
15943  14186   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15944  14187   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15945  14188   
                http_response.headers(),
15946  14189   
                expected_headers,
15947  14190   
            ));
15948  14191   
        }
15949  14192   
    }
15950         -
    /// Malformed values in query parameters should be rejected
15951         -
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case0
       14193  +
    /// Malformed values in the body should be rejected
       14194  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case2
15952  14195   
    #[::tokio::test]
15953         -
    async fn rest_json_query_double_malformed_value_rejected_case0_malformed_request() {
       14196  +
    #[::tracing_test::traced_test]
       14197  +
    async fn rest_json_body_short_malformed_value_rejected_case2_malformed_request() {
15954  14198   
        {
15955  14199   
            #[allow(unused_mut)]
15956  14200   
            let mut http_request = http::Request::builder()
15957         -
                .uri("/MalformedDouble/1")
       14201  +
                .uri("/MalformedShort/1")
15958  14202   
                .method("POST")
15959         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14203  +
                .header("content-type", "application/json")
       14204  +
                .body(::aws_smithy_http_server::body::Body::from(
       14205  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 1.001 }".as_bytes()),
       14206  +
                ))
15960  14207   
                .unwrap();
15961         -
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=true".parse().unwrap();
15962  14208   
            #[allow(unused_mut)]
15963  14209   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
15964  14210   
            let config = crate::service::RestJsonConfig::builder().build();
15965  14211   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
15966         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14212  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
15967  14213   
                                let sender = sender.clone();
15968  14214   
                                async move {
15969         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14215  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
15970  14216   
                                    sender.send(()).await.expect("receiver dropped early");
15971  14217   
                                    result
15972  14218   
                                }
15973  14219   
                            })
15974  14220   
                            .build_unchecked();
15975  14221   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
15976  14222   
                .await
15977  14223   
                .expect("unable to make an HTTP request");
15978  14224   
            ::pretty_assertions::assert_eq!(
15979  14225   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
15980  14226   
                http_response.status()
15981  14227   
            );
15982  14228   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
15983  14229   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
15984  14230   
                http_response.headers(),
15985  14231   
                expected_headers,
15986  14232   
            ));
15987  14233   
        }
15988  14234   
    }
15989         -
    /// Malformed values in query parameters should be rejected
15990         -
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case1
       14235  +
    /// Malformed values in the body should be rejected
       14236  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case3
15991  14237   
    #[::tokio::test]
15992         -
    async fn rest_json_query_double_malformed_value_rejected_case1_malformed_request() {
       14238  +
    #[::tracing_test::traced_test]
       14239  +
    async fn rest_json_body_short_malformed_value_rejected_case3_malformed_request() {
15993  14240   
        {
15994  14241   
            #[allow(unused_mut)]
15995  14242   
            let mut http_request = http::Request::builder()
15996         -
                .uri("/MalformedDouble/1")
       14243  +
                .uri("/MalformedShort/1")
15997  14244   
                .method("POST")
15998         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14245  +
                .header("content-type", "application/json")
       14246  +
                .body(::aws_smithy_http_server::body::Body::from(
       14247  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 2ABC }".as_bytes()),
       14248  +
                ))
15999  14249   
                .unwrap();
16000         -
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=2ABC".parse().unwrap();
16001  14250   
            #[allow(unused_mut)]
16002  14251   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16003  14252   
            let config = crate::service::RestJsonConfig::builder().build();
16004  14253   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16005         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14254  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16006  14255   
                                let sender = sender.clone();
16007  14256   
                                async move {
16008         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14257  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16009  14258   
                                    sender.send(()).await.expect("receiver dropped early");
16010  14259   
                                    result
16011  14260   
                                }
16012  14261   
                            })
16013  14262   
                            .build_unchecked();
16014  14263   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16015  14264   
                .await
16016  14265   
                .expect("unable to make an HTTP request");
16017  14266   
            ::pretty_assertions::assert_eq!(
16018  14267   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16019  14268   
                http_response.status()
16020  14269   
            );
16021  14270   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16022  14271   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16023  14272   
                http_response.headers(),
16024  14273   
                expected_headers,
16025  14274   
            ));
16026  14275   
        }
16027  14276   
    }
16028         -
    /// Malformed values in query parameters should be rejected
16029         -
    /// Test ID: RestJsonQueryDoubleMalformedValueRejected_case2
       14277  +
    /// Malformed values in the body should be rejected
       14278  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case4
16030  14279   
    #[::tokio::test]
16031         -
    async fn rest_json_query_double_malformed_value_rejected_case2_malformed_request() {
       14280  +
    #[::tracing_test::traced_test]
       14281  +
    async fn rest_json_body_short_malformed_value_rejected_case4_malformed_request() {
16032  14282   
        {
16033  14283   
            #[allow(unused_mut)]
16034  14284   
            let mut http_request = http::Request::builder()
16035         -
                .uri("/MalformedDouble/1")
       14285  +
                .uri("/MalformedShort/1")
16036  14286   
                .method("POST")
16037         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14287  +
                .header("content-type", "application/json")
       14288  +
                .body(::aws_smithy_http_server::body::Body::from(
       14289  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 0x42 }".as_bytes()),
       14290  +
                ))
16038  14291   
                .unwrap();
16039         -
            *http_request.uri_mut() = "/MalformedDouble/1?doubleInQuery=0x42".parse().unwrap();
16040  14292   
            #[allow(unused_mut)]
16041  14293   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16042  14294   
            let config = crate::service::RestJsonConfig::builder().build();
16043  14295   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16044         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14296  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16045  14297   
                                let sender = sender.clone();
16046  14298   
                                async move {
16047         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14299  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16048  14300   
                                    sender.send(()).await.expect("receiver dropped early");
16049  14301   
                                    result
16050  14302   
                                }
16051  14303   
                            })
16052  14304   
                            .build_unchecked();
16053  14305   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16054  14306   
                .await
16055  14307   
                .expect("unable to make an HTTP request");
16056  14308   
            ::pretty_assertions::assert_eq!(
16057  14309   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16058  14310   
                http_response.status()
16059  14311   
            );
16060  14312   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16061  14313   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16062  14314   
                http_response.headers(),
16063  14315   
                expected_headers,
16064  14316   
            ));
16065  14317   
        }
16066  14318   
    }
16067         -
    /// Malformed values in headers should be rejected
16068         -
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case0
       14319  +
    /// Malformed values in the body should be rejected
       14320  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case5
16069  14321   
    #[::tokio::test]
16070         -
    async fn rest_json_header_double_malformed_value_rejected_case0_malformed_request() {
       14322  +
    #[::tracing_test::traced_test]
       14323  +
    async fn rest_json_body_short_malformed_value_rejected_case5_malformed_request() {
16071  14324   
        {
16072  14325   
            #[allow(unused_mut)]
16073  14326   
            let mut http_request = http::Request::builder()
16074         -
                .uri("/MalformedDouble/1")
       14327  +
                .uri("/MalformedShort/1")
16075  14328   
                .method("POST")
16076         -
                .header("doubleInHeader", "true")
16077         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14329  +
                .header("content-type", "application/json")
       14330  +
                .body(::aws_smithy_http_server::body::Body::from(
       14331  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : Infinity }".as_bytes()),
       14332  +
                ))
16078  14333   
                .unwrap();
16079  14334   
            #[allow(unused_mut)]
16080  14335   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16081  14336   
            let config = crate::service::RestJsonConfig::builder().build();
16082  14337   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16083         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14338  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16084  14339   
                                let sender = sender.clone();
16085  14340   
                                async move {
16086         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14341  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16087  14342   
                                    sender.send(()).await.expect("receiver dropped early");
16088  14343   
                                    result
16089  14344   
                                }
16090  14345   
                            })
16091  14346   
                            .build_unchecked();
16092  14347   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16093  14348   
                .await
16094  14349   
                .expect("unable to make an HTTP request");
16095  14350   
            ::pretty_assertions::assert_eq!(
16096  14351   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16097  14352   
                http_response.status()
16098  14353   
            );
16099  14354   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16100  14355   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16101  14356   
                http_response.headers(),
16102  14357   
                expected_headers,
16103  14358   
            ));
16104  14359   
        }
16105  14360   
    }
16106         -
    /// Malformed values in headers should be rejected
16107         -
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case1
       14361  +
    /// Malformed values in the body should be rejected
       14362  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case6
16108  14363   
    #[::tokio::test]
16109         -
    async fn rest_json_header_double_malformed_value_rejected_case1_malformed_request() {
       14364  +
    #[::tracing_test::traced_test]
       14365  +
    async fn rest_json_body_short_malformed_value_rejected_case6_malformed_request() {
16110  14366   
        {
16111  14367   
            #[allow(unused_mut)]
16112  14368   
            let mut http_request = http::Request::builder()
16113         -
                .uri("/MalformedDouble/1")
       14369  +
                .uri("/MalformedShort/1")
16114  14370   
                .method("POST")
16115         -
                .header("doubleInHeader", "2ABC")
16116         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14371  +
                .header("content-type", "application/json")
       14372  +
                .body(::aws_smithy_http_server::body::Body::from(
       14373  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"Infinity\" }".as_bytes()),
       14374  +
                ))
16117  14375   
                .unwrap();
16118  14376   
            #[allow(unused_mut)]
16119  14377   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16120  14378   
            let config = crate::service::RestJsonConfig::builder().build();
16121  14379   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16122         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14380  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16123  14381   
                                let sender = sender.clone();
16124  14382   
                                async move {
16125         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14383  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16126  14384   
                                    sender.send(()).await.expect("receiver dropped early");
16127  14385   
                                    result
16128  14386   
                                }
16129  14387   
                            })
16130  14388   
                            .build_unchecked();
16131  14389   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16132  14390   
                .await
16133  14391   
                .expect("unable to make an HTTP request");
16134  14392   
            ::pretty_assertions::assert_eq!(
16135  14393   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16136  14394   
                http_response.status()
16137  14395   
            );
16138  14396   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16139  14397   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16140  14398   
                http_response.headers(),
16141  14399   
                expected_headers,
16142  14400   
            ));
16143  14401   
        }
16144  14402   
    }
16145         -
    /// Malformed values in headers should be rejected
16146         -
    /// Test ID: RestJsonHeaderDoubleMalformedValueRejected_case2
       14403  +
    /// Malformed values in the body should be rejected
       14404  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case7
16147  14405   
    #[::tokio::test]
16148         -
    async fn rest_json_header_double_malformed_value_rejected_case2_malformed_request() {
       14406  +
    #[::tracing_test::traced_test]
       14407  +
    async fn rest_json_body_short_malformed_value_rejected_case7_malformed_request() {
16149  14408   
        {
16150  14409   
            #[allow(unused_mut)]
16151  14410   
            let mut http_request = http::Request::builder()
16152         -
                .uri("/MalformedDouble/1")
       14411  +
                .uri("/MalformedShort/1")
16153  14412   
                .method("POST")
16154         -
                .header("doubleInHeader", "0x42")
16155         -
                .body(::aws_smithy_http_server::body::Body::empty())
       14413  +
                .header("content-type", "application/json")
       14414  +
                .body(::aws_smithy_http_server::body::Body::from(
       14415  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : -Infinity }".as_bytes()),
       14416  +
                ))
16156  14417   
                .unwrap();
16157  14418   
            #[allow(unused_mut)]
16158  14419   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16159  14420   
            let config = crate::service::RestJsonConfig::builder().build();
16160  14421   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16161         -
                            .malformed_double(move |input: crate::input::MalformedDoubleInput| {
       14422  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16162  14423   
                                let sender = sender.clone();
16163  14424   
                                async move {
16164         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedDoubleOutput, crate::error::MalformedDoubleError> };
       14425  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16165  14426   
                                    sender.send(()).await.expect("receiver dropped early");
16166  14427   
                                    result
16167  14428   
                                }
16168  14429   
                            })
16169  14430   
                            .build_unchecked();
16170  14431   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16171  14432   
                .await
16172  14433   
                .expect("unable to make an HTTP request");
16173  14434   
            ::pretty_assertions::assert_eq!(
16174  14435   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16175  14436   
                http_response.status()
16176  14437   
            );
16177  14438   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16178  14439   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16179  14440   
                http_response.headers(),
16180  14441   
                expected_headers,
16181  14442   
            ));
16182  14443   
        }
16183  14444   
    }
16184         -
}
16185         -
#[cfg(test)]
16186         -
#[allow(unreachable_code, unused_variables)]
16187         -
mod server_malformed_float_test {
16188  14445   
    /// Malformed values in the body should be rejected
16189         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case0
       14446  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case8
16190  14447   
    #[::tokio::test]
16191         -
    async fn rest_json_body_float_malformed_value_rejected_case0_malformed_request() {
       14448  +
    #[::tracing_test::traced_test]
       14449  +
    async fn rest_json_body_short_malformed_value_rejected_case8_malformed_request() {
16192  14450   
        {
16193  14451   
            #[allow(unused_mut)]
16194  14452   
            let mut http_request = http::Request::builder()
16195         -
                .uri("/MalformedFloat/1")
       14453  +
                .uri("/MalformedShort/1")
16196  14454   
                .method("POST")
16197  14455   
                .header("content-type", "application/json")
16198  14456   
                .body(::aws_smithy_http_server::body::Body::from(
16199         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : \"123\" }".as_bytes()),
       14457  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"-Infinity\" }".as_bytes()),
16200  14458   
                ))
16201  14459   
                .unwrap();
16202  14460   
            #[allow(unused_mut)]
16203  14461   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16204  14462   
            let config = crate::service::RestJsonConfig::builder().build();
16205  14463   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16206         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14464  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16207  14465   
                                let sender = sender.clone();
16208  14466   
                                async move {
16209         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14467  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16210  14468   
                                    sender.send(()).await.expect("receiver dropped early");
16211  14469   
                                    result
16212  14470   
                                }
16213  14471   
                            })
16214  14472   
                            .build_unchecked();
16215  14473   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16216  14474   
                .await
16217  14475   
                .expect("unable to make an HTTP request");
16218  14476   
            ::pretty_assertions::assert_eq!(
16219  14477   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16220  14478   
                http_response.status()
16221  14479   
            );
16222  14480   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16223  14481   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16224  14482   
                http_response.headers(),
16225  14483   
                expected_headers,
16226  14484   
            ));
16227  14485   
        }
16228  14486   
    }
16229  14487   
    /// Malformed values in the body should be rejected
16230         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case1
       14488  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case9
16231  14489   
    #[::tokio::test]
16232         -
    async fn rest_json_body_float_malformed_value_rejected_case1_malformed_request() {
       14490  +
    #[::tracing_test::traced_test]
       14491  +
    async fn rest_json_body_short_malformed_value_rejected_case9_malformed_request() {
16233  14492   
        {
16234  14493   
            #[allow(unused_mut)]
16235  14494   
            let mut http_request = http::Request::builder()
16236         -
                .uri("/MalformedFloat/1")
       14495  +
                .uri("/MalformedShort/1")
16237  14496   
                .method("POST")
16238  14497   
                .header("content-type", "application/json")
16239  14498   
                .body(::aws_smithy_http_server::body::Body::from(
16240         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : true }".as_bytes()),
       14499  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : NaN }".as_bytes()),
16241  14500   
                ))
16242  14501   
                .unwrap();
16243  14502   
            #[allow(unused_mut)]
16244  14503   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16245  14504   
            let config = crate::service::RestJsonConfig::builder().build();
16246  14505   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16247         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14506  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16248  14507   
                                let sender = sender.clone();
16249  14508   
                                async move {
16250         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14509  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16251  14510   
                                    sender.send(()).await.expect("receiver dropped early");
16252  14511   
                                    result
16253  14512   
                                }
16254  14513   
                            })
16255  14514   
                            .build_unchecked();
16256  14515   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16257  14516   
                .await
16258  14517   
                .expect("unable to make an HTTP request");
16259  14518   
            ::pretty_assertions::assert_eq!(
16260  14519   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16261  14520   
                http_response.status()
16262  14521   
            );
16263  14522   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16264  14523   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16265  14524   
                http_response.headers(),
16266  14525   
                expected_headers,
16267  14526   
            ));
16268  14527   
        }
16269  14528   
    }
16270  14529   
    /// Malformed values in the body should be rejected
16271         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case2
       14530  +
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case10
16272  14531   
    #[::tokio::test]
16273         -
    async fn rest_json_body_float_malformed_value_rejected_case2_malformed_request() {
       14532  +
    #[::tracing_test::traced_test]
       14533  +
    async fn rest_json_body_short_malformed_value_rejected_case10_malformed_request() {
16274  14534   
        {
16275  14535   
            #[allow(unused_mut)]
16276  14536   
            let mut http_request = http::Request::builder()
16277         -
                .uri("/MalformedFloat/1")
       14537  +
                .uri("/MalformedShort/1")
16278  14538   
                .method("POST")
16279  14539   
                .header("content-type", "application/json")
16280  14540   
                .body(::aws_smithy_http_server::body::Body::from(
16281         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : 2ABC }".as_bytes()),
       14541  +
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"NaN\" }".as_bytes()),
16282  14542   
                ))
16283  14543   
                .unwrap();
16284  14544   
            #[allow(unused_mut)]
16285  14545   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16286  14546   
            let config = crate::service::RestJsonConfig::builder().build();
16287  14547   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16288         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14548  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16289  14549   
                                let sender = sender.clone();
16290  14550   
                                async move {
16291         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14551  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16292  14552   
                                    sender.send(()).await.expect("receiver dropped early");
16293  14553   
                                    result
16294  14554   
                                }
16295  14555   
                            })
16296  14556   
                            .build_unchecked();
16297  14557   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16298  14558   
                .await
16299  14559   
                .expect("unable to make an HTTP request");
16300  14560   
            ::pretty_assertions::assert_eq!(
16301  14561   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16302  14562   
                http_response.status()
16303  14563   
            );
16304  14564   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16305  14565   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16306  14566   
                http_response.headers(),
16307  14567   
                expected_headers,
16308  14568   
            ));
16309  14569   
        }
16310  14570   
    }
16311         -
    /// Malformed values in the body should be rejected
16312         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case3
       14571  +
    /// Malformed values in the path should be rejected
       14572  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case0
16313  14573   
    #[::tokio::test]
16314         -
    async fn rest_json_body_float_malformed_value_rejected_case3_malformed_request() {
       14574  +
    #[::tracing_test::traced_test]
       14575  +
    async fn rest_json_path_short_malformed_value_rejected_case0_malformed_request() {
16315  14576   
        {
16316  14577   
            #[allow(unused_mut)]
16317  14578   
            let mut http_request = http::Request::builder()
16318         -
                .uri("/MalformedFloat/1")
       14579  +
                .uri("/MalformedShort/true")
16319  14580   
                .method("POST")
16320         -
                .header("content-type", "application/json")
16321         -
                .body(::aws_smithy_http_server::body::Body::from(
16322         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : 0x42 }".as_bytes()),
16323         -
                ))
       14581  +
                .body(::aws_smithy_http_server::body::Body::empty())
16324  14582   
                .unwrap();
16325  14583   
            #[allow(unused_mut)]
16326  14584   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16327  14585   
            let config = crate::service::RestJsonConfig::builder().build();
16328  14586   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16329         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14587  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16330  14588   
                                let sender = sender.clone();
16331  14589   
                                async move {
16332         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14590  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16333  14591   
                                    sender.send(()).await.expect("receiver dropped early");
16334  14592   
                                    result
16335  14593   
                                }
16336  14594   
                            })
16337  14595   
                            .build_unchecked();
16338  14596   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16339  14597   
                .await
16340  14598   
                .expect("unable to make an HTTP request");
16341  14599   
            ::pretty_assertions::assert_eq!(
16342  14600   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16343  14601   
                http_response.status()
16344  14602   
            );
16345  14603   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16346  14604   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16347  14605   
                http_response.headers(),
16348  14606   
                expected_headers,
16349  14607   
            ));
16350  14608   
        }
16351  14609   
    }
16352         -
    /// Malformed values in the body should be rejected
16353         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case4
       14610  +
    /// Malformed values in the path should be rejected
       14611  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case1
16354  14612   
    #[::tokio::test]
16355         -
    async fn rest_json_body_float_malformed_value_rejected_case4_malformed_request() {
       14613  +
    #[::tracing_test::traced_test]
       14614  +
    async fn rest_json_path_short_malformed_value_rejected_case1_malformed_request() {
16356  14615   
        {
16357  14616   
            #[allow(unused_mut)]
16358  14617   
            let mut http_request = http::Request::builder()
16359         -
                .uri("/MalformedFloat/1")
       14618  +
                .uri("/MalformedShort/1.001")
16360  14619   
                .method("POST")
16361         -
                .header("content-type", "application/json")
16362         -
                .body(::aws_smithy_http_server::body::Body::from(
16363         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : Infinity }".as_bytes()),
16364         -
                ))
       14620  +
                .body(::aws_smithy_http_server::body::Body::empty())
16365  14621   
                .unwrap();
16366  14622   
            #[allow(unused_mut)]
16367  14623   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16368  14624   
            let config = crate::service::RestJsonConfig::builder().build();
16369  14625   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16370         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14626  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16371  14627   
                                let sender = sender.clone();
16372  14628   
                                async move {
16373         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14629  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16374  14630   
                                    sender.send(()).await.expect("receiver dropped early");
16375  14631   
                                    result
16376  14632   
                                }
16377  14633   
                            })
16378  14634   
                            .build_unchecked();
16379  14635   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16380  14636   
                .await
16381  14637   
                .expect("unable to make an HTTP request");
16382  14638   
            ::pretty_assertions::assert_eq!(
16383  14639   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16384  14640   
                http_response.status()
16385  14641   
            );
16386  14642   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16387  14643   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16388  14644   
                http_response.headers(),
16389  14645   
                expected_headers,
16390  14646   
            ));
16391  14647   
        }
16392  14648   
    }
16393         -
    /// Malformed values in the body should be rejected
16394         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case5
       14649  +
    /// Malformed values in the path should be rejected
       14650  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case2
16395  14651   
    #[::tokio::test]
16396         -
    async fn rest_json_body_float_malformed_value_rejected_case5_malformed_request() {
       14652  +
    #[::tracing_test::traced_test]
       14653  +
    async fn rest_json_path_short_malformed_value_rejected_case2_malformed_request() {
16397  14654   
        {
16398  14655   
            #[allow(unused_mut)]
16399  14656   
            let mut http_request = http::Request::builder()
16400         -
                .uri("/MalformedFloat/1")
       14657  +
                .uri("/MalformedShort/2ABC")
16401  14658   
                .method("POST")
16402         -
                .header("content-type", "application/json")
16403         -
                .body(::aws_smithy_http_server::body::Body::from(
16404         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : -Infinity }".as_bytes()),
16405         -
                ))
       14659  +
                .body(::aws_smithy_http_server::body::Body::empty())
16406  14660   
                .unwrap();
16407  14661   
            #[allow(unused_mut)]
16408  14662   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16409  14663   
            let config = crate::service::RestJsonConfig::builder().build();
16410  14664   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16411         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14665  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16412  14666   
                                let sender = sender.clone();
16413  14667   
                                async move {
16414         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14668  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16415  14669   
                                    sender.send(()).await.expect("receiver dropped early");
16416  14670   
                                    result
16417  14671   
                                }
16418  14672   
                            })
16419  14673   
                            .build_unchecked();
16420  14674   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16421  14675   
                .await
16422  14676   
                .expect("unable to make an HTTP request");
16423  14677   
            ::pretty_assertions::assert_eq!(
16424  14678   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16425  14679   
                http_response.status()
16426  14680   
            );
16427  14681   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16428  14682   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16429  14683   
                http_response.headers(),
16430  14684   
                expected_headers,
16431  14685   
            ));
16432  14686   
        }
16433  14687   
    }
16434         -
    /// Malformed values in the body should be rejected
16435         -
    /// Test ID: RestJsonBodyFloatMalformedValueRejected_case6
       14688  +
    /// Malformed values in the path should be rejected
       14689  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case3
16436  14690   
    #[::tokio::test]
16437         -
    async fn rest_json_body_float_malformed_value_rejected_case6_malformed_request() {
       14691  +
    #[::tracing_test::traced_test]
       14692  +
    async fn rest_json_path_short_malformed_value_rejected_case3_malformed_request() {
16438  14693   
        {
16439  14694   
            #[allow(unused_mut)]
16440  14695   
            let mut http_request = http::Request::builder()
16441         -
                .uri("/MalformedFloat/1")
       14696  +
                .uri("/MalformedShort/0x42")
16442  14697   
                .method("POST")
16443         -
                .header("content-type", "application/json")
16444         -
                .body(::aws_smithy_http_server::body::Body::from(
16445         -
                    ::bytes::Bytes::from_static("{ \"floatInBody\" : NaN }".as_bytes()),
16446         -
                ))
       14698  +
                .body(::aws_smithy_http_server::body::Body::empty())
16447  14699   
                .unwrap();
16448  14700   
            #[allow(unused_mut)]
16449  14701   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16450  14702   
            let config = crate::service::RestJsonConfig::builder().build();
16451  14703   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16452         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14704  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16453  14705   
                                let sender = sender.clone();
16454  14706   
                                async move {
16455         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14707  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16456  14708   
                                    sender.send(()).await.expect("receiver dropped early");
16457  14709   
                                    result
16458  14710   
                                }
16459  14711   
                            })
16460  14712   
                            .build_unchecked();
16461  14713   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16462  14714   
                .await
16463  14715   
                .expect("unable to make an HTTP request");
16464  14716   
            ::pretty_assertions::assert_eq!(
16465  14717   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16466  14718   
                http_response.status()
16467  14719   
            );
16468  14720   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16469  14721   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16470  14722   
                http_response.headers(),
16471  14723   
                expected_headers,
16472  14724   
            ));
16473  14725   
        }
16474  14726   
    }
16475  14727   
    /// Malformed values in the path should be rejected
16476         -
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case0
       14728  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case4
16477  14729   
    #[::tokio::test]
16478         -
    async fn rest_json_path_float_malformed_value_rejected_case0_malformed_request() {
       14730  +
    #[::tracing_test::traced_test]
       14731  +
    async fn rest_json_path_short_malformed_value_rejected_case4_malformed_request() {
16479  14732   
        {
16480  14733   
            #[allow(unused_mut)]
16481  14734   
            let mut http_request = http::Request::builder()
16482         -
                .uri("/MalformedFloat/true")
       14735  +
                .uri("/MalformedShort/Infinity")
16483  14736   
                .method("POST")
16484  14737   
                .body(::aws_smithy_http_server::body::Body::empty())
16485  14738   
                .unwrap();
16486  14739   
            #[allow(unused_mut)]
16487  14740   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16488  14741   
            let config = crate::service::RestJsonConfig::builder().build();
16489  14742   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16490         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14743  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16491  14744   
                                let sender = sender.clone();
16492  14745   
                                async move {
16493         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14746  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16494  14747   
                                    sender.send(()).await.expect("receiver dropped early");
16495  14748   
                                    result
16496  14749   
                                }
16497  14750   
                            })
16498  14751   
                            .build_unchecked();
16499  14752   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16500  14753   
                .await
16501  14754   
                .expect("unable to make an HTTP request");
16502  14755   
            ::pretty_assertions::assert_eq!(
16503  14756   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16504  14757   
                http_response.status()
16505  14758   
            );
16506  14759   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16507  14760   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16508  14761   
                http_response.headers(),
16509  14762   
                expected_headers,
16510  14763   
            ));
16511  14764   
        }
16512  14765   
    }
16513  14766   
    /// Malformed values in the path should be rejected
16514         -
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case1
       14767  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case5
16515  14768   
    #[::tokio::test]
16516         -
    async fn rest_json_path_float_malformed_value_rejected_case1_malformed_request() {
       14769  +
    #[::tracing_test::traced_test]
       14770  +
    async fn rest_json_path_short_malformed_value_rejected_case5_malformed_request() {
16517  14771   
        {
16518  14772   
            #[allow(unused_mut)]
16519  14773   
            let mut http_request = http::Request::builder()
16520         -
                .uri("/MalformedFloat/2ABC")
       14774  +
                .uri("/MalformedShort/-Infinity")
16521  14775   
                .method("POST")
16522  14776   
                .body(::aws_smithy_http_server::body::Body::empty())
16523  14777   
                .unwrap();
16524  14778   
            #[allow(unused_mut)]
16525  14779   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16526  14780   
            let config = crate::service::RestJsonConfig::builder().build();
16527  14781   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16528         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14782  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16529  14783   
                                let sender = sender.clone();
16530  14784   
                                async move {
16531         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14785  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16532  14786   
                                    sender.send(()).await.expect("receiver dropped early");
16533  14787   
                                    result
16534  14788   
                                }
16535  14789   
                            })
16536  14790   
                            .build_unchecked();
16537  14791   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16538  14792   
                .await
16539  14793   
                .expect("unable to make an HTTP request");
16540  14794   
            ::pretty_assertions::assert_eq!(
16541  14795   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16542  14796   
                http_response.status()
16543  14797   
            );
16544  14798   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16545  14799   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16546  14800   
                http_response.headers(),
16547  14801   
                expected_headers,
16548  14802   
            ));
16549  14803   
        }
16550  14804   
    }
16551  14805   
    /// Malformed values in the path should be rejected
16552         -
    /// Test ID: RestJsonPathFloatMalformedValueRejected_case2
       14806  +
    /// Test ID: RestJsonPathShortMalformedValueRejected_case6
16553  14807   
    #[::tokio::test]
16554         -
    async fn rest_json_path_float_malformed_value_rejected_case2_malformed_request() {
       14808  +
    #[::tracing_test::traced_test]
       14809  +
    async fn rest_json_path_short_malformed_value_rejected_case6_malformed_request() {
16555  14810   
        {
16556  14811   
            #[allow(unused_mut)]
16557  14812   
            let mut http_request = http::Request::builder()
16558         -
                .uri("/MalformedFloat/0x42")
       14813  +
                .uri("/MalformedShort/NaN")
16559  14814   
                .method("POST")
16560  14815   
                .body(::aws_smithy_http_server::body::Body::empty())
16561  14816   
                .unwrap();
16562  14817   
            #[allow(unused_mut)]
16563  14818   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16564  14819   
            let config = crate::service::RestJsonConfig::builder().build();
16565  14820   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16566         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14821  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16567  14822   
                                let sender = sender.clone();
16568  14823   
                                async move {
16569         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14824  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16570  14825   
                                    sender.send(()).await.expect("receiver dropped early");
16571  14826   
                                    result
16572  14827   
                                }
16573  14828   
                            })
16574  14829   
                            .build_unchecked();
16575  14830   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16576  14831   
                .await
16577  14832   
                .expect("unable to make an HTTP request");
16578  14833   
            ::pretty_assertions::assert_eq!(
16579  14834   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16580  14835   
                http_response.status()
16581  14836   
            );
16582  14837   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16583  14838   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16584  14839   
                http_response.headers(),
16585  14840   
                expected_headers,
16586  14841   
            ));
16587  14842   
        }
16588  14843   
    }
16589  14844   
    /// Malformed values in query parameters should be rejected
16590         -
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case0
       14845  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case0
16591  14846   
    #[::tokio::test]
16592         -
    async fn rest_json_query_float_malformed_value_rejected_case0_malformed_request() {
       14847  +
    #[::tracing_test::traced_test]
       14848  +
    async fn rest_json_query_short_malformed_value_rejected_case0_malformed_request() {
16593  14849   
        {
16594  14850   
            #[allow(unused_mut)]
16595  14851   
            let mut http_request = http::Request::builder()
16596         -
                .uri("/MalformedFloat/1")
       14852  +
                .uri("/MalformedShort/1")
16597  14853   
                .method("POST")
16598  14854   
                .body(::aws_smithy_http_server::body::Body::empty())
16599  14855   
                .unwrap();
16600         -
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=true".parse().unwrap();
       14856  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=true".parse().unwrap();
16601  14857   
            #[allow(unused_mut)]
16602  14858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16603  14859   
            let config = crate::service::RestJsonConfig::builder().build();
16604  14860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16605         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14861  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16606  14862   
                                let sender = sender.clone();
16607  14863   
                                async move {
16608         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14864  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16609  14865   
                                    sender.send(()).await.expect("receiver dropped early");
16610  14866   
                                    result
16611  14867   
                                }
16612  14868   
                            })
16613  14869   
                            .build_unchecked();
16614  14870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16615  14871   
                .await
16616  14872   
                .expect("unable to make an HTTP request");
16617  14873   
            ::pretty_assertions::assert_eq!(
16618  14874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16619  14875   
                http_response.status()
16620  14876   
            );
16621  14877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16622  14878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16623  14879   
                http_response.headers(),
16624  14880   
                expected_headers,
16625  14881   
            ));
16626  14882   
        }
16627  14883   
    }
16628  14884   
    /// Malformed values in query parameters should be rejected
16629         -
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case1
       14885  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case1
16630  14886   
    #[::tokio::test]
16631         -
    async fn rest_json_query_float_malformed_value_rejected_case1_malformed_request() {
       14887  +
    #[::tracing_test::traced_test]
       14888  +
    async fn rest_json_query_short_malformed_value_rejected_case1_malformed_request() {
16632  14889   
        {
16633  14890   
            #[allow(unused_mut)]
16634  14891   
            let mut http_request = http::Request::builder()
16635         -
                .uri("/MalformedFloat/1")
       14892  +
                .uri("/MalformedShort/1")
16636  14893   
                .method("POST")
16637  14894   
                .body(::aws_smithy_http_server::body::Body::empty())
16638  14895   
                .unwrap();
16639         -
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=2ABC".parse().unwrap();
       14896  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=1.001".parse().unwrap();
16640  14897   
            #[allow(unused_mut)]
16641  14898   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16642  14899   
            let config = crate::service::RestJsonConfig::builder().build();
16643  14900   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16644         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14901  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16645  14902   
                                let sender = sender.clone();
16646  14903   
                                async move {
16647         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14904  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16648  14905   
                                    sender.send(()).await.expect("receiver dropped early");
16649  14906   
                                    result
16650  14907   
                                }
16651  14908   
                            })
16652  14909   
                            .build_unchecked();
16653  14910   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16654  14911   
                .await
16655  14912   
                .expect("unable to make an HTTP request");
16656  14913   
            ::pretty_assertions::assert_eq!(
16657  14914   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16658  14915   
                http_response.status()
16659  14916   
            );
16660  14917   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16661  14918   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16662  14919   
                http_response.headers(),
16663  14920   
                expected_headers,
16664  14921   
            ));
16665  14922   
        }
16666  14923   
    }
16667  14924   
    /// Malformed values in query parameters should be rejected
16668         -
    /// Test ID: RestJsonQueryFloatMalformedValueRejected_case2
       14925  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case2
16669  14926   
    #[::tokio::test]
16670         -
    async fn rest_json_query_float_malformed_value_rejected_case2_malformed_request() {
       14927  +
    #[::tracing_test::traced_test]
       14928  +
    async fn rest_json_query_short_malformed_value_rejected_case2_malformed_request() {
16671  14929   
        {
16672  14930   
            #[allow(unused_mut)]
16673  14931   
            let mut http_request = http::Request::builder()
16674         -
                .uri("/MalformedFloat/1")
       14932  +
                .uri("/MalformedShort/1")
16675  14933   
                .method("POST")
16676  14934   
                .body(::aws_smithy_http_server::body::Body::empty())
16677  14935   
                .unwrap();
16678         -
            *http_request.uri_mut() = "/MalformedFloat/1?floatInQuery=0x42".parse().unwrap();
       14936  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=2ABC".parse().unwrap();
16679  14937   
            #[allow(unused_mut)]
16680  14938   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16681  14939   
            let config = crate::service::RestJsonConfig::builder().build();
16682  14940   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16683         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14941  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16684  14942   
                                let sender = sender.clone();
16685  14943   
                                async move {
16686         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14944  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16687  14945   
                                    sender.send(()).await.expect("receiver dropped early");
16688  14946   
                                    result
16689  14947   
                                }
16690  14948   
                            })
16691  14949   
                            .build_unchecked();
16692  14950   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16693  14951   
                .await
16694  14952   
                .expect("unable to make an HTTP request");
16695  14953   
            ::pretty_assertions::assert_eq!(
16696  14954   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16697  14955   
                http_response.status()
16698  14956   
            );
16699  14957   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16700  14958   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16701  14959   
                http_response.headers(),
16702  14960   
                expected_headers,
16703  14961   
            ));
16704  14962   
        }
16705  14963   
    }
16706         -
    /// Malformed values in headers should be rejected
16707         -
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case0
       14964  +
    /// Malformed values in query parameters should be rejected
       14965  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case3
16708  14966   
    #[::tokio::test]
16709         -
    async fn rest_json_header_float_malformed_value_rejected_case0_malformed_request() {
       14967  +
    #[::tracing_test::traced_test]
       14968  +
    async fn rest_json_query_short_malformed_value_rejected_case3_malformed_request() {
16710  14969   
        {
16711  14970   
            #[allow(unused_mut)]
16712  14971   
            let mut http_request = http::Request::builder()
16713         -
                .uri("/MalformedFloat/1")
       14972  +
                .uri("/MalformedShort/1")
16714  14973   
                .method("POST")
16715         -
                .header("floatInHeader", "true")
16716  14974   
                .body(::aws_smithy_http_server::body::Body::empty())
16717  14975   
                .unwrap();
       14976  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=0x42".parse().unwrap();
16718  14977   
            #[allow(unused_mut)]
16719  14978   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16720  14979   
            let config = crate::service::RestJsonConfig::builder().build();
16721  14980   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16722         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       14981  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16723  14982   
                                let sender = sender.clone();
16724  14983   
                                async move {
16725         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       14984  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16726  14985   
                                    sender.send(()).await.expect("receiver dropped early");
16727  14986   
                                    result
16728  14987   
                                }
16729  14988   
                            })
16730  14989   
                            .build_unchecked();
16731  14990   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16732  14991   
                .await
16733  14992   
                .expect("unable to make an HTTP request");
16734  14993   
            ::pretty_assertions::assert_eq!(
16735  14994   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16736  14995   
                http_response.status()
16737  14996   
            );
16738  14997   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16739  14998   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16740  14999   
                http_response.headers(),
16741  15000   
                expected_headers,
16742  15001   
            ));
16743  15002   
        }
16744  15003   
    }
16745         -
    /// Malformed values in headers should be rejected
16746         -
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case1
       15004  +
    /// Malformed values in query parameters should be rejected
       15005  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case4
16747  15006   
    #[::tokio::test]
16748         -
    async fn rest_json_header_float_malformed_value_rejected_case1_malformed_request() {
       15007  +
    #[::tracing_test::traced_test]
       15008  +
    async fn rest_json_query_short_malformed_value_rejected_case4_malformed_request() {
16749  15009   
        {
16750  15010   
            #[allow(unused_mut)]
16751  15011   
            let mut http_request = http::Request::builder()
16752         -
                .uri("/MalformedFloat/1")
       15012  +
                .uri("/MalformedShort/1")
16753  15013   
                .method("POST")
16754         -
                .header("floatInHeader", "2ABC")
16755  15014   
                .body(::aws_smithy_http_server::body::Body::empty())
16756  15015   
                .unwrap();
       15016  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=Infinity".parse().unwrap();
16757  15017   
            #[allow(unused_mut)]
16758  15018   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16759  15019   
            let config = crate::service::RestJsonConfig::builder().build();
16760  15020   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16761         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       15021  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16762  15022   
                                let sender = sender.clone();
16763  15023   
                                async move {
16764         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       15024  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16765  15025   
                                    sender.send(()).await.expect("receiver dropped early");
16766  15026   
                                    result
16767  15027   
                                }
16768  15028   
                            })
16769  15029   
                            .build_unchecked();
16770  15030   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16771  15031   
                .await
16772  15032   
                .expect("unable to make an HTTP request");
16773  15033   
            ::pretty_assertions::assert_eq!(
16774  15034   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16775  15035   
                http_response.status()
16776  15036   
            );
16777  15037   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16778  15038   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16779  15039   
                http_response.headers(),
16780  15040   
                expected_headers,
16781  15041   
            ));
16782  15042   
        }
16783  15043   
    }
16784         -
    /// Malformed values in headers should be rejected
16785         -
    /// Test ID: RestJsonHeaderFloatMalformedValueRejected_case2
       15044  +
    /// Malformed values in query parameters should be rejected
       15045  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case5
16786  15046   
    #[::tokio::test]
16787         -
    async fn rest_json_header_float_malformed_value_rejected_case2_malformed_request() {
       15047  +
    #[::tracing_test::traced_test]
       15048  +
    async fn rest_json_query_short_malformed_value_rejected_case5_malformed_request() {
16788  15049   
        {
16789  15050   
            #[allow(unused_mut)]
16790  15051   
            let mut http_request = http::Request::builder()
16791         -
                .uri("/MalformedFloat/1")
       15052  +
                .uri("/MalformedShort/1")
16792  15053   
                .method("POST")
16793         -
                .header("floatInHeader", "0x42")
16794  15054   
                .body(::aws_smithy_http_server::body::Body::empty())
16795  15055   
                .unwrap();
       15056  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-Infinity".parse().unwrap();
16796  15057   
            #[allow(unused_mut)]
16797  15058   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16798  15059   
            let config = crate::service::RestJsonConfig::builder().build();
16799  15060   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16800         -
                            .malformed_float(move |input: crate::input::MalformedFloatInput| {
       15061  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16801  15062   
                                let sender = sender.clone();
16802  15063   
                                async move {
16803         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedFloatOutput, crate::error::MalformedFloatError> };
       15064  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16804  15065   
                                    sender.send(()).await.expect("receiver dropped early");
16805  15066   
                                    result
16806  15067   
                                }
16807  15068   
                            })
16808  15069   
                            .build_unchecked();
16809  15070   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16810  15071   
                .await
16811  15072   
                .expect("unable to make an HTTP request");
16812  15073   
            ::pretty_assertions::assert_eq!(
16813  15074   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16814  15075   
                http_response.status()
16815  15076   
            );
16816  15077   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16817  15078   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16818  15079   
                http_response.headers(),
16819  15080   
                expected_headers,
16820  15081   
            ));
16821  15082   
        }
16822  15083   
    }
16823         -
}
16824         -
#[cfg(test)]
16825         -
#[allow(unreachable_code, unused_variables)]
16826         -
mod server_malformed_integer_test {
16827         -
    /// Underflow or overflow should result in SerializationException
16828         -
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case0
       15084  +
    /// Malformed values in query parameters should be rejected
       15085  +
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case6
16829  15086   
    #[::tokio::test]
16830         -
    async fn rest_json_body_integer_underflow_overflow_case0_malformed_request() {
       15087  +
    #[::tracing_test::traced_test]
       15088  +
    async fn rest_json_query_short_malformed_value_rejected_case6_malformed_request() {
16831  15089   
        {
16832  15090   
            #[allow(unused_mut)]
16833  15091   
            let mut http_request = http::Request::builder()
16834         -
                .uri("/MalformedInteger/1")
       15092  +
                .uri("/MalformedShort/1")
16835  15093   
                .method("POST")
16836         -
                .header("content-type", "application/json")
16837         -
                .body(::aws_smithy_http_server::body::Body::from(
16838         -
                    ::bytes::Bytes::from_static(
16839         -
                        "{ \"integerInBody\" : -9223372000000000000 }".as_bytes(),
16840         -
                    ),
16841         -
                ))
       15094  +
                .body(::aws_smithy_http_server::body::Body::empty())
16842  15095   
                .unwrap();
       15096  +
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=NaN".parse().unwrap();
16843  15097   
            #[allow(unused_mut)]
16844  15098   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16845  15099   
            let config = crate::service::RestJsonConfig::builder().build();
16846  15100   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16847         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15101  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16848  15102   
                                let sender = sender.clone();
16849  15103   
                                async move {
16850         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15104  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16851  15105   
                                    sender.send(()).await.expect("receiver dropped early");
16852  15106   
                                    result
16853  15107   
                                }
16854  15108   
                            })
16855  15109   
                            .build_unchecked();
16856  15110   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16857  15111   
                .await
16858  15112   
                .expect("unable to make an HTTP request");
16859  15113   
            ::pretty_assertions::assert_eq!(
16860  15114   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16861  15115   
                http_response.status()
16862  15116   
            );
16863  15117   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16864  15118   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16865  15119   
                http_response.headers(),
16866  15120   
                expected_headers,
16867  15121   
            ));
16868  15122   
        }
16869  15123   
    }
16870         -
    /// Underflow or overflow should result in SerializationException
16871         -
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case1
       15124  +
    /// Malformed values in headers should be rejected
       15125  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case0
16872  15126   
    #[::tokio::test]
16873         -
    async fn rest_json_body_integer_underflow_overflow_case1_malformed_request() {
       15127  +
    #[::tracing_test::traced_test]
       15128  +
    async fn rest_json_header_short_malformed_value_rejected_case0_malformed_request() {
16874  15129   
        {
16875  15130   
            #[allow(unused_mut)]
16876  15131   
            let mut http_request = http::Request::builder()
16877         -
                .uri("/MalformedInteger/1")
       15132  +
                .uri("/MalformedShort/1")
16878  15133   
                .method("POST")
16879         -
                .header("content-type", "application/json")
16880         -
                .body(::aws_smithy_http_server::body::Body::from(
16881         -
                    ::bytes::Bytes::from_static(
16882         -
                        "{ \"integerInBody\" : 9223372000000000000 }".as_bytes(),
16883         -
                    ),
16884         -
                ))
       15134  +
                .header("shortInHeader", "true")
       15135  +
                .body(::aws_smithy_http_server::body::Body::empty())
16885  15136   
                .unwrap();
16886  15137   
            #[allow(unused_mut)]
16887  15138   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16888  15139   
            let config = crate::service::RestJsonConfig::builder().build();
16889  15140   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16890         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15141  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16891  15142   
                                let sender = sender.clone();
16892  15143   
                                async move {
16893         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15144  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16894  15145   
                                    sender.send(()).await.expect("receiver dropped early");
16895  15146   
                                    result
16896  15147   
                                }
16897  15148   
                            })
16898  15149   
                            .build_unchecked();
16899  15150   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16900  15151   
                .await
16901  15152   
                .expect("unable to make an HTTP request");
16902  15153   
            ::pretty_assertions::assert_eq!(
16903  15154   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16904  15155   
                http_response.status()
16905  15156   
            );
16906  15157   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16907  15158   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16908  15159   
                http_response.headers(),
16909  15160   
                expected_headers,
16910  15161   
            ));
16911  15162   
        }
16912  15163   
    }
16913         -
    /// Underflow or overflow should result in SerializationException
16914         -
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case2
       15164  +
    /// Malformed values in headers should be rejected
       15165  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case1
16915  15166   
    #[::tokio::test]
16916         -
    async fn rest_json_body_integer_underflow_overflow_case2_malformed_request() {
       15167  +
    #[::tracing_test::traced_test]
       15168  +
    async fn rest_json_header_short_malformed_value_rejected_case1_malformed_request() {
16917  15169   
        {
16918  15170   
            #[allow(unused_mut)]
16919  15171   
            let mut http_request = http::Request::builder()
16920         -
                .uri("/MalformedInteger/1")
       15172  +
                .uri("/MalformedShort/1")
16921  15173   
                .method("POST")
16922         -
                .header("content-type", "application/json")
16923         -
                .body(::aws_smithy_http_server::body::Body::from(
16924         -
                    ::bytes::Bytes::from_static(
16925         -
                        "{ \"integerInBody\" : 123000000000000000000000 }".as_bytes(),
16926         -
                    ),
16927         -
                ))
       15174  +
                .header("shortInHeader", "1.001")
       15175  +
                .body(::aws_smithy_http_server::body::Body::empty())
16928  15176   
                .unwrap();
16929  15177   
            #[allow(unused_mut)]
16930  15178   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16931  15179   
            let config = crate::service::RestJsonConfig::builder().build();
16932  15180   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16933         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15181  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16934  15182   
                                let sender = sender.clone();
16935  15183   
                                async move {
16936         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15184  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16937  15185   
                                    sender.send(()).await.expect("receiver dropped early");
16938  15186   
                                    result
16939  15187   
                                }
16940  15188   
                            })
16941  15189   
                            .build_unchecked();
16942  15190   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16943  15191   
                .await
16944  15192   
                .expect("unable to make an HTTP request");
16945  15193   
            ::pretty_assertions::assert_eq!(
16946  15194   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16947  15195   
                http_response.status()
16948  15196   
            );
16949  15197   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16950  15198   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16951  15199   
                http_response.headers(),
16952  15200   
                expected_headers,
16953  15201   
            ));
16954  15202   
        }
16955  15203   
    }
16956         -
    /// Underflow or overflow should result in SerializationException
16957         -
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case0
       15204  +
    /// Malformed values in headers should be rejected
       15205  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case2
16958  15206   
    #[::tokio::test]
16959         -
    async fn rest_json_path_integer_underflow_overflow_case0_malformed_request() {
       15207  +
    #[::tracing_test::traced_test]
       15208  +
    async fn rest_json_header_short_malformed_value_rejected_case2_malformed_request() {
16960  15209   
        {
16961  15210   
            #[allow(unused_mut)]
16962  15211   
            let mut http_request = http::Request::builder()
16963         -
                .uri("/MalformedInteger/-9223372000000000000")
       15212  +
                .uri("/MalformedShort/1")
16964  15213   
                .method("POST")
       15214  +
                .header("shortInHeader", "2ABC")
16965  15215   
                .body(::aws_smithy_http_server::body::Body::empty())
16966  15216   
                .unwrap();
16967  15217   
            #[allow(unused_mut)]
16968  15218   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
16969  15219   
            let config = crate::service::RestJsonConfig::builder().build();
16970  15220   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
16971         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15221  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
16972  15222   
                                let sender = sender.clone();
16973  15223   
                                async move {
16974         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15224  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
16975  15225   
                                    sender.send(()).await.expect("receiver dropped early");
16976  15226   
                                    result
16977  15227   
                                }
16978  15228   
                            })
16979  15229   
                            .build_unchecked();
16980  15230   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
16981  15231   
                .await
16982  15232   
                .expect("unable to make an HTTP request");
16983  15233   
            ::pretty_assertions::assert_eq!(
16984  15234   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
16985  15235   
                http_response.status()
16986  15236   
            );
16987  15237   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
16988  15238   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
16989  15239   
                http_response.headers(),
16990  15240   
                expected_headers,
16991  15241   
            ));
16992  15242   
        }
16993  15243   
    }
16994         -
    /// Underflow or overflow should result in SerializationException
16995         -
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case1
       15244  +
    /// Malformed values in headers should be rejected
       15245  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case3
16996  15246   
    #[::tokio::test]
16997         -
    async fn rest_json_path_integer_underflow_overflow_case1_malformed_request() {
       15247  +
    #[::tracing_test::traced_test]
       15248  +
    async fn rest_json_header_short_malformed_value_rejected_case3_malformed_request() {
16998  15249   
        {
16999  15250   
            #[allow(unused_mut)]
17000  15251   
            let mut http_request = http::Request::builder()
17001         -
                .uri("/MalformedInteger/9223372000000000000")
       15252  +
                .uri("/MalformedShort/1")
17002  15253   
                .method("POST")
       15254  +
                .header("shortInHeader", "0x42")
17003  15255   
                .body(::aws_smithy_http_server::body::Body::empty())
17004  15256   
                .unwrap();
17005  15257   
            #[allow(unused_mut)]
17006  15258   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17007  15259   
            let config = crate::service::RestJsonConfig::builder().build();
17008  15260   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17009         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15261  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
17010  15262   
                                let sender = sender.clone();
17011  15263   
                                async move {
17012         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15264  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
17013  15265   
                                    sender.send(()).await.expect("receiver dropped early");
17014  15266   
                                    result
17015  15267   
                                }
17016  15268   
                            })
17017  15269   
                            .build_unchecked();
17018  15270   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17019  15271   
                .await
17020  15272   
                .expect("unable to make an HTTP request");
17021  15273   
            ::pretty_assertions::assert_eq!(
17022  15274   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17023  15275   
                http_response.status()
17024  15276   
            );
17025  15277   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17026  15278   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17027  15279   
                http_response.headers(),
17028  15280   
                expected_headers,
17029  15281   
            ));
17030  15282   
        }
17031  15283   
    }
17032         -
    /// Underflow or overflow should result in SerializationException
17033         -
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case2
       15284  +
    /// Malformed values in headers should be rejected
       15285  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case4
17034  15286   
    #[::tokio::test]
17035         -
    async fn rest_json_path_integer_underflow_overflow_case2_malformed_request() {
       15287  +
    #[::tracing_test::traced_test]
       15288  +
    async fn rest_json_header_short_malformed_value_rejected_case4_malformed_request() {
17036  15289   
        {
17037  15290   
            #[allow(unused_mut)]
17038  15291   
            let mut http_request = http::Request::builder()
17039         -
                .uri("/MalformedInteger/123000000000000000000000")
       15292  +
                .uri("/MalformedShort/1")
17040  15293   
                .method("POST")
       15294  +
                .header("shortInHeader", "Infinity")
17041  15295   
                .body(::aws_smithy_http_server::body::Body::empty())
17042  15296   
                .unwrap();
17043  15297   
            #[allow(unused_mut)]
17044  15298   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17045  15299   
            let config = crate::service::RestJsonConfig::builder().build();
17046  15300   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17047         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15301  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
17048  15302   
                                let sender = sender.clone();
17049  15303   
                                async move {
17050         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15304  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
17051  15305   
                                    sender.send(()).await.expect("receiver dropped early");
17052  15306   
                                    result
17053  15307   
                                }
17054  15308   
                            })
17055  15309   
                            .build_unchecked();
17056  15310   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17057  15311   
                .await
17058  15312   
                .expect("unable to make an HTTP request");
17059  15313   
            ::pretty_assertions::assert_eq!(
17060  15314   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17061  15315   
                http_response.status()
17062  15316   
            );
17063  15317   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17064  15318   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17065  15319   
                http_response.headers(),
17066  15320   
                expected_headers,
17067  15321   
            ));
17068  15322   
        }
17069  15323   
    }
17070         -
    /// Underflow or overflow should result in SerializationException
17071         -
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case0
       15324  +
    /// Malformed values in headers should be rejected
       15325  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case5
17072  15326   
    #[::tokio::test]
17073         -
    async fn rest_json_query_integer_underflow_overflow_case0_malformed_request() {
       15327  +
    #[::tracing_test::traced_test]
       15328  +
    async fn rest_json_header_short_malformed_value_rejected_case5_malformed_request() {
17074  15329   
        {
17075  15330   
            #[allow(unused_mut)]
17076  15331   
            let mut http_request = http::Request::builder()
17077         -
                .uri("/MalformedInteger/1")
       15332  +
                .uri("/MalformedShort/1")
17078  15333   
                .method("POST")
       15334  +
                .header("shortInHeader", "-Infinity")
17079  15335   
                .body(::aws_smithy_http_server::body::Body::empty())
17080  15336   
                .unwrap();
17081         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-9223372000000000000"
17082         -
                .parse()
17083         -
                .unwrap();
17084  15337   
            #[allow(unused_mut)]
17085  15338   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17086  15339   
            let config = crate::service::RestJsonConfig::builder().build();
17087  15340   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17088         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15341  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
17089  15342   
                                let sender = sender.clone();
17090  15343   
                                async move {
17091         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15344  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
17092  15345   
                                    sender.send(()).await.expect("receiver dropped early");
17093  15346   
                                    result
17094  15347   
                                }
17095  15348   
                            })
17096  15349   
                            .build_unchecked();
17097  15350   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17098  15351   
                .await
17099  15352   
                .expect("unable to make an HTTP request");
17100  15353   
            ::pretty_assertions::assert_eq!(
17101  15354   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17102  15355   
                http_response.status()
17103  15356   
            );
17104  15357   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17105  15358   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17106  15359   
                http_response.headers(),
17107  15360   
                expected_headers,
17108  15361   
            ));
17109  15362   
        }
17110  15363   
    }
17111         -
    /// Underflow or overflow should result in SerializationException
17112         -
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case1
       15364  +
    /// Malformed values in headers should be rejected
       15365  +
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case6
17113  15366   
    #[::tokio::test]
17114         -
    async fn rest_json_query_integer_underflow_overflow_case1_malformed_request() {
       15367  +
    #[::tracing_test::traced_test]
       15368  +
    async fn rest_json_header_short_malformed_value_rejected_case6_malformed_request() {
17115  15369   
        {
17116  15370   
            #[allow(unused_mut)]
17117  15371   
            let mut http_request = http::Request::builder()
17118         -
                .uri("/MalformedInteger/1")
       15372  +
                .uri("/MalformedShort/1")
17119  15373   
                .method("POST")
       15374  +
                .header("shortInHeader", "NaN")
17120  15375   
                .body(::aws_smithy_http_server::body::Body::empty())
17121  15376   
                .unwrap();
17122         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=9223372000000000000"
17123         -
                .parse()
17124         -
                .unwrap();
17125  15377   
            #[allow(unused_mut)]
17126  15378   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17127  15379   
            let config = crate::service::RestJsonConfig::builder().build();
17128  15380   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17129         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15381  +
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
17130  15382   
                                let sender = sender.clone();
17131  15383   
                                async move {
17132         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15384  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
17133  15385   
                                    sender.send(()).await.expect("receiver dropped early");
17134  15386   
                                    result
17135  15387   
                                }
17136  15388   
                            })
17137  15389   
                            .build_unchecked();
17138  15390   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17139  15391   
                .await
17140  15392   
                .expect("unable to make an HTTP request");
17141  15393   
            ::pretty_assertions::assert_eq!(
17142  15394   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17143  15395   
                http_response.status()
17144  15396   
            );
17145  15397   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17146  15398   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17147  15399   
                http_response.headers(),
17148  15400   
                expected_headers,
17149  15401   
            ));
17150  15402   
        }
17151  15403   
    }
       15404  +
}
       15405  +
       15406  +
const CONTENT_TYPE_MALFORMEDBYTE: ::mime::Mime = ::mime::APPLICATION_JSON;
       15407  +
::pin_project_lite::pin_project! {
       15408  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       15409  +
    /// [`MalformedByteInput`](crate::input::MalformedByteInput) using modelled bindings.
       15410  +
    pub struct MalformedByteInputFuture {
       15411  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedByteInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       15412  +
    }
       15413  +
}
       15414  +
       15415  +
impl std::future::Future for MalformedByteInputFuture {
       15416  +
    type Output = Result<
       15417  +
        crate::input::MalformedByteInput,
       15418  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       15419  +
    >;
       15420  +
       15421  +
    fn poll(
       15422  +
        self: std::pin::Pin<&mut Self>,
       15423  +
        cx: &mut std::task::Context<'_>,
       15424  +
    ) -> std::task::Poll<Self::Output> {
       15425  +
        let this = self.project();
       15426  +
        this.inner.as_mut().poll(cx)
       15427  +
    }
       15428  +
}
       15429  +
       15430  +
impl<B>
       15431  +
    ::aws_smithy_http_server::request::FromRequest<
       15432  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       15433  +
        B,
       15434  +
    > for crate::input::MalformedByteInput
       15435  +
where
       15436  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       15437  +
    B: 'static,
       15438  +
       15439  +
    B::Data: Send,
       15440  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       15441  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       15442  +
{
       15443  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       15444  +
    type Future = MalformedByteInputFuture;
       15445  +
       15446  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       15447  +
        let fut = async move {
       15448  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       15449  +
                request.headers(),
       15450  +
                &CONTENT_TYPE_MALFORMEDBYTE,
       15451  +
            ) {
       15452  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       15453  +
            }
       15454  +
            crate::protocol_serde::shape_malformed_byte::de_malformed_byte_http_request(request)
       15455  +
                .await
       15456  +
                .map_err(Into::into)
       15457  +
        };
       15458  +
        use ::futures_util::future::TryFutureExt;
       15459  +
        let fut = fut.map_err(
       15460  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       15461  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       15462  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       15463  +
                    e,
       15464  +
                )
       15465  +
            },
       15466  +
        );
       15467  +
        MalformedByteInputFuture {
       15468  +
            inner: Box::pin(fut),
       15469  +
        }
       15470  +
    }
       15471  +
}
       15472  +
impl
       15473  +
    ::aws_smithy_http_server::response::IntoResponse<
       15474  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       15475  +
    > for crate::output::MalformedByteOutput
       15476  +
{
       15477  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       15478  +
        match crate::protocol_serde::shape_malformed_byte::ser_malformed_byte_http_response(self) {
       15479  +
            Ok(response) => response,
       15480  +
            Err(e) => {
       15481  +
                ::tracing::error!(error = %e, "failed to serialize response");
       15482  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       15483  +
            }
       15484  +
        }
       15485  +
    }
       15486  +
}
       15487  +
impl
       15488  +
    ::aws_smithy_http_server::response::IntoResponse<
       15489  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       15490  +
    > for crate::error::MalformedByteError
       15491  +
{
       15492  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       15493  +
        match crate::protocol_serde::shape_malformed_byte::ser_malformed_byte_http_error(&self) {
       15494  +
            Ok(mut response) => {
       15495  +
                response.extensions_mut().insert(
       15496  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       15497  +
                );
       15498  +
                response
       15499  +
            }
       15500  +
            Err(e) => {
       15501  +
                ::tracing::error!(error = %e, "failed to serialize response");
       15502  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       15503  +
            }
       15504  +
        }
       15505  +
    }
       15506  +
}
       15507  +
       15508  +
#[allow(unreachable_code, unused_variables)]
       15509  +
#[cfg(test)]
       15510  +
mod malformed_byte_test {
       15511  +
17152  15512   
    /// Underflow or overflow should result in SerializationException
17153         -
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case2
       15513  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case0
17154  15514   
    #[::tokio::test]
17155         -
    async fn rest_json_query_integer_underflow_overflow_case2_malformed_request() {
       15515  +
    #[::tracing_test::traced_test]
       15516  +
    async fn rest_json_body_byte_underflow_overflow_case0_malformed_request() {
17156  15517   
        {
17157  15518   
            #[allow(unused_mut)]
17158  15519   
            let mut http_request = http::Request::builder()
17159         -
                .uri("/MalformedInteger/1")
       15520  +
                .uri("/MalformedByte/1")
17160  15521   
                .method("POST")
17161         -
                .body(::aws_smithy_http_server::body::Body::empty())
17162         -
                .unwrap();
17163         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=123000000000000000000000"
17164         -
                .parse()
       15522  +
                .header("content-type", "application/json")
       15523  +
                .body(::aws_smithy_http_server::body::Body::from(
       15524  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 256 }".as_bytes()),
       15525  +
                ))
17165  15526   
                .unwrap();
17166  15527   
            #[allow(unused_mut)]
17167  15528   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17168  15529   
            let config = crate::service::RestJsonConfig::builder().build();
17169  15530   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17170         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15531  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17171  15532   
                                let sender = sender.clone();
17172  15533   
                                async move {
17173         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15534  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17174  15535   
                                    sender.send(()).await.expect("receiver dropped early");
17175  15536   
                                    result
17176  15537   
                                }
17177  15538   
                            })
17178  15539   
                            .build_unchecked();
17179  15540   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17180  15541   
                .await
17181  15542   
                .expect("unable to make an HTTP request");
17182  15543   
            ::pretty_assertions::assert_eq!(
17183  15544   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17184  15545   
                http_response.status()
17185  15546   
            );
17186  15547   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17187  15548   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17188  15549   
                http_response.headers(),
17189  15550   
                expected_headers,
17190  15551   
            ));
17191  15552   
        }
17192  15553   
    }
17193  15554   
    /// Underflow or overflow should result in SerializationException
17194         -
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case0
       15555  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case1
17195  15556   
    #[::tokio::test]
17196         -
    async fn rest_json_header_integer_underflow_overflow_case0_malformed_request() {
       15557  +
    #[::tracing_test::traced_test]
       15558  +
    async fn rest_json_body_byte_underflow_overflow_case1_malformed_request() {
17197  15559   
        {
17198  15560   
            #[allow(unused_mut)]
17199  15561   
            let mut http_request = http::Request::builder()
17200         -
                .uri("/MalformedInteger/1")
       15562  +
                .uri("/MalformedByte/1")
17201  15563   
                .method("POST")
17202         -
                .header("integerInHeader", "-9223372000000000000")
17203         -
                .body(::aws_smithy_http_server::body::Body::empty())
       15564  +
                .header("content-type", "application/json")
       15565  +
                .body(::aws_smithy_http_server::body::Body::from(
       15566  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : -256 }".as_bytes()),
       15567  +
                ))
17204  15568   
                .unwrap();
17205  15569   
            #[allow(unused_mut)]
17206  15570   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17207  15571   
            let config = crate::service::RestJsonConfig::builder().build();
17208  15572   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17209         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15573  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17210  15574   
                                let sender = sender.clone();
17211  15575   
                                async move {
17212         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15576  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17213  15577   
                                    sender.send(()).await.expect("receiver dropped early");
17214  15578   
                                    result
17215  15579   
                                }
17216  15580   
                            })
17217  15581   
                            .build_unchecked();
17218  15582   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17219  15583   
                .await
17220  15584   
                .expect("unable to make an HTTP request");
17221  15585   
            ::pretty_assertions::assert_eq!(
17222  15586   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17223  15587   
                http_response.status()
17224  15588   
            );
17225  15589   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17226  15590   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17227  15591   
                http_response.headers(),
17228  15592   
                expected_headers,
17229  15593   
            ));
17230  15594   
        }
17231  15595   
    }
17232  15596   
    /// Underflow or overflow should result in SerializationException
17233         -
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case1
       15597  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case2
17234  15598   
    #[::tokio::test]
17235         -
    async fn rest_json_header_integer_underflow_overflow_case1_malformed_request() {
       15599  +
    #[::tracing_test::traced_test]
       15600  +
    async fn rest_json_body_byte_underflow_overflow_case2_malformed_request() {
17236  15601   
        {
17237  15602   
            #[allow(unused_mut)]
17238  15603   
            let mut http_request = http::Request::builder()
17239         -
                .uri("/MalformedInteger/1")
       15604  +
                .uri("/MalformedByte/1")
17240  15605   
                .method("POST")
17241         -
                .header("integerInHeader", "9223372000000000000")
17242         -
                .body(::aws_smithy_http_server::body::Body::empty())
       15606  +
                .header("content-type", "application/json")
       15607  +
                .body(::aws_smithy_http_server::body::Body::from(
       15608  +
                    ::bytes::Bytes::from_static(
       15609  +
                        "{ \"byteInBody\" : -9223372000000000000 }".as_bytes(),
       15610  +
                    ),
       15611  +
                ))
17243  15612   
                .unwrap();
17244  15613   
            #[allow(unused_mut)]
17245  15614   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17246  15615   
            let config = crate::service::RestJsonConfig::builder().build();
17247  15616   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17248         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15617  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17249  15618   
                                let sender = sender.clone();
17250  15619   
                                async move {
17251         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15620  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17252  15621   
                                    sender.send(()).await.expect("receiver dropped early");
17253  15622   
                                    result
17254  15623   
                                }
17255  15624   
                            })
17256  15625   
                            .build_unchecked();
17257  15626   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17258  15627   
                .await
17259  15628   
                .expect("unable to make an HTTP request");
17260  15629   
            ::pretty_assertions::assert_eq!(
17261  15630   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17262  15631   
                http_response.status()
17263  15632   
            );
17264  15633   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17265  15634   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17266  15635   
                http_response.headers(),
17267  15636   
                expected_headers,
17268  15637   
            ));
17269  15638   
        }
17270  15639   
    }
17271  15640   
    /// Underflow or overflow should result in SerializationException
17272         -
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case2
       15641  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case3
17273  15642   
    #[::tokio::test]
17274         -
    async fn rest_json_header_integer_underflow_overflow_case2_malformed_request() {
       15643  +
    #[::tracing_test::traced_test]
       15644  +
    async fn rest_json_body_byte_underflow_overflow_case3_malformed_request() {
17275  15645   
        {
17276  15646   
            #[allow(unused_mut)]
17277  15647   
            let mut http_request = http::Request::builder()
17278         -
                .uri("/MalformedInteger/1")
       15648  +
                .uri("/MalformedByte/1")
17279  15649   
                .method("POST")
17280         -
                .header("integerInHeader", "123000000000000000000000")
17281         -
                .body(::aws_smithy_http_server::body::Body::empty())
       15650  +
                .header("content-type", "application/json")
       15651  +
                .body(::aws_smithy_http_server::body::Body::from(
       15652  +
                    ::bytes::Bytes::from_static(
       15653  +
                        "{ \"byteInBody\" : 9223372000000000000 }".as_bytes(),
       15654  +
                    ),
       15655  +
                ))
17282  15656   
                .unwrap();
17283  15657   
            #[allow(unused_mut)]
17284  15658   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17285  15659   
            let config = crate::service::RestJsonConfig::builder().build();
17286  15660   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17287         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15661  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17288  15662   
                                let sender = sender.clone();
17289  15663   
                                async move {
17290         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15664  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17291  15665   
                                    sender.send(()).await.expect("receiver dropped early");
17292  15666   
                                    result
17293  15667   
                                }
17294  15668   
                            })
17295  15669   
                            .build_unchecked();
17296  15670   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17297  15671   
                .await
17298  15672   
                .expect("unable to make an HTTP request");
17299  15673   
            ::pretty_assertions::assert_eq!(
17300  15674   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17301  15675   
                http_response.status()
17302  15676   
            );
17303  15677   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17304  15678   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17305  15679   
                http_response.headers(),
17306  15680   
                expected_headers,
17307  15681   
            ));
17308  15682   
        }
17309  15683   
    }
17310         -
    /// Malformed values in the body should be rejected
17311         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case0
       15684  +
    /// Underflow or overflow should result in SerializationException
       15685  +
    /// Test ID: RestJsonBodyByteUnderflowOverflow_case4
17312  15686   
    #[::tokio::test]
17313         -
    async fn rest_json_body_integer_malformed_value_rejected_case0_malformed_request() {
       15687  +
    #[::tracing_test::traced_test]
       15688  +
    async fn rest_json_body_byte_underflow_overflow_case4_malformed_request() {
17314  15689   
        {
17315  15690   
            #[allow(unused_mut)]
17316  15691   
            let mut http_request = http::Request::builder()
17317         -
                .uri("/MalformedInteger/1")
       15692  +
                .uri("/MalformedByte/1")
17318  15693   
                .method("POST")
17319  15694   
                .header("content-type", "application/json")
17320  15695   
                .body(::aws_smithy_http_server::body::Body::from(
17321         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"123\" }".as_bytes()),
       15696  +
                    ::bytes::Bytes::from_static(
       15697  +
                        "{ \"byteInBody\" : 123000000000000000000000 }".as_bytes(),
       15698  +
                    ),
17322  15699   
                ))
17323  15700   
                .unwrap();
17324  15701   
            #[allow(unused_mut)]
17325  15702   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17326  15703   
            let config = crate::service::RestJsonConfig::builder().build();
17327  15704   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17328         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15705  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17329  15706   
                                let sender = sender.clone();
17330  15707   
                                async move {
17331         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15708  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17332  15709   
                                    sender.send(()).await.expect("receiver dropped early");
17333  15710   
                                    result
17334  15711   
                                }
17335  15712   
                            })
17336  15713   
                            .build_unchecked();
17337  15714   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17338  15715   
                .await
17339  15716   
                .expect("unable to make an HTTP request");
17340  15717   
            ::pretty_assertions::assert_eq!(
17341  15718   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17342  15719   
                http_response.status()
17343  15720   
            );
17344  15721   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17345  15722   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17346  15723   
                http_response.headers(),
17347  15724   
                expected_headers,
17348  15725   
            ));
17349  15726   
        }
17350  15727   
    }
17351         -
    /// Malformed values in the body should be rejected
17352         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case1
       15728  +
    /// Underflow or overflow should result in SerializationException
       15729  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case0
17353  15730   
    #[::tokio::test]
17354         -
    async fn rest_json_body_integer_malformed_value_rejected_case1_malformed_request() {
       15731  +
    #[::tracing_test::traced_test]
       15732  +
    async fn rest_json_path_byte_underflow_overflow_case0_malformed_request() {
17355  15733   
        {
17356  15734   
            #[allow(unused_mut)]
17357  15735   
            let mut http_request = http::Request::builder()
17358         -
                .uri("/MalformedInteger/1")
       15736  +
                .uri("/MalformedByte/256")
17359  15737   
                .method("POST")
17360         -
                .header("content-type", "application/json")
17361         -
                .body(::aws_smithy_http_server::body::Body::from(
17362         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : true }".as_bytes()),
17363         -
                ))
       15738  +
                .body(::aws_smithy_http_server::body::Body::empty())
17364  15739   
                .unwrap();
17365  15740   
            #[allow(unused_mut)]
17366  15741   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17367  15742   
            let config = crate::service::RestJsonConfig::builder().build();
17368  15743   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17369         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15744  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17370  15745   
                                let sender = sender.clone();
17371  15746   
                                async move {
17372         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15747  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17373  15748   
                                    sender.send(()).await.expect("receiver dropped early");
17374  15749   
                                    result
17375  15750   
                                }
17376  15751   
                            })
17377  15752   
                            .build_unchecked();
17378  15753   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17379  15754   
                .await
17380  15755   
                .expect("unable to make an HTTP request");
17381  15756   
            ::pretty_assertions::assert_eq!(
17382  15757   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17383  15758   
                http_response.status()
17384  15759   
            );
17385  15760   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17386  15761   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17387  15762   
                http_response.headers(),
17388  15763   
                expected_headers,
17389  15764   
            ));
17390  15765   
        }
17391  15766   
    }
17392         -
    /// Malformed values in the body should be rejected
17393         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case2
       15767  +
    /// Underflow or overflow should result in SerializationException
       15768  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case1
17394  15769   
    #[::tokio::test]
17395         -
    async fn rest_json_body_integer_malformed_value_rejected_case2_malformed_request() {
       15770  +
    #[::tracing_test::traced_test]
       15771  +
    async fn rest_json_path_byte_underflow_overflow_case1_malformed_request() {
17396  15772   
        {
17397  15773   
            #[allow(unused_mut)]
17398  15774   
            let mut http_request = http::Request::builder()
17399         -
                .uri("/MalformedInteger/1")
       15775  +
                .uri("/MalformedByte/-256")
17400  15776   
                .method("POST")
17401         -
                .header("content-type", "application/json")
17402         -
                .body(::aws_smithy_http_server::body::Body::from(
17403         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 1.001 }".as_bytes()),
17404         -
                ))
       15777  +
                .body(::aws_smithy_http_server::body::Body::empty())
17405  15778   
                .unwrap();
17406  15779   
            #[allow(unused_mut)]
17407  15780   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17408  15781   
            let config = crate::service::RestJsonConfig::builder().build();
17409  15782   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17410         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15783  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17411  15784   
                                let sender = sender.clone();
17412  15785   
                                async move {
17413         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15786  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17414  15787   
                                    sender.send(()).await.expect("receiver dropped early");
17415  15788   
                                    result
17416  15789   
                                }
17417  15790   
                            })
17418  15791   
                            .build_unchecked();
17419  15792   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17420  15793   
                .await
17421  15794   
                .expect("unable to make an HTTP request");
17422  15795   
            ::pretty_assertions::assert_eq!(
17423  15796   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17424  15797   
                http_response.status()
17425  15798   
            );
17426  15799   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17427  15800   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17428  15801   
                http_response.headers(),
17429  15802   
                expected_headers,
17430  15803   
            ));
17431  15804   
        }
17432  15805   
    }
17433         -
    /// Malformed values in the body should be rejected
17434         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case3
       15806  +
    /// Underflow or overflow should result in SerializationException
       15807  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case2
17435  15808   
    #[::tokio::test]
17436         -
    async fn rest_json_body_integer_malformed_value_rejected_case3_malformed_request() {
       15809  +
    #[::tracing_test::traced_test]
       15810  +
    async fn rest_json_path_byte_underflow_overflow_case2_malformed_request() {
17437  15811   
        {
17438  15812   
            #[allow(unused_mut)]
17439  15813   
            let mut http_request = http::Request::builder()
17440         -
                .uri("/MalformedInteger/1")
       15814  +
                .uri("/MalformedByte/-9223372000000000000")
17441  15815   
                .method("POST")
17442         -
                .header("content-type", "application/json")
17443         -
                .body(::aws_smithy_http_server::body::Body::from(
17444         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 2ABC }".as_bytes()),
17445         -
                ))
       15816  +
                .body(::aws_smithy_http_server::body::Body::empty())
17446  15817   
                .unwrap();
17447  15818   
            #[allow(unused_mut)]
17448  15819   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17449  15820   
            let config = crate::service::RestJsonConfig::builder().build();
17450  15821   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17451         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15822  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17452  15823   
                                let sender = sender.clone();
17453  15824   
                                async move {
17454         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15825  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17455  15826   
                                    sender.send(()).await.expect("receiver dropped early");
17456  15827   
                                    result
17457  15828   
                                }
17458  15829   
                            })
17459  15830   
                            .build_unchecked();
17460  15831   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17461  15832   
                .await
17462  15833   
                .expect("unable to make an HTTP request");
17463  15834   
            ::pretty_assertions::assert_eq!(
17464  15835   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17465  15836   
                http_response.status()
17466  15837   
            );
17467  15838   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17468  15839   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17469  15840   
                http_response.headers(),
17470  15841   
                expected_headers,
17471  15842   
            ));
17472  15843   
        }
17473  15844   
    }
17474         -
    /// Malformed values in the body should be rejected
17475         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case4
       15845  +
    /// Underflow or overflow should result in SerializationException
       15846  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case3
17476  15847   
    #[::tokio::test]
17477         -
    async fn rest_json_body_integer_malformed_value_rejected_case4_malformed_request() {
       15848  +
    #[::tracing_test::traced_test]
       15849  +
    async fn rest_json_path_byte_underflow_overflow_case3_malformed_request() {
17478  15850   
        {
17479  15851   
            #[allow(unused_mut)]
17480  15852   
            let mut http_request = http::Request::builder()
17481         -
                .uri("/MalformedInteger/1")
       15853  +
                .uri("/MalformedByte/9223372000000000000")
17482  15854   
                .method("POST")
17483         -
                .header("content-type", "application/json")
17484         -
                .body(::aws_smithy_http_server::body::Body::from(
17485         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 0x42 }".as_bytes()),
17486         -
                ))
       15855  +
                .body(::aws_smithy_http_server::body::Body::empty())
17487  15856   
                .unwrap();
17488  15857   
            #[allow(unused_mut)]
17489  15858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17490  15859   
            let config = crate::service::RestJsonConfig::builder().build();
17491  15860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17492         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15861  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17493  15862   
                                let sender = sender.clone();
17494  15863   
                                async move {
17495         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15864  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17496  15865   
                                    sender.send(()).await.expect("receiver dropped early");
17497  15866   
                                    result
17498  15867   
                                }
17499  15868   
                            })
17500  15869   
                            .build_unchecked();
17501  15870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17502  15871   
                .await
17503  15872   
                .expect("unable to make an HTTP request");
17504  15873   
            ::pretty_assertions::assert_eq!(
17505  15874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17506  15875   
                http_response.status()
17507  15876   
            );
17508  15877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17509  15878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17510  15879   
                http_response.headers(),
17511  15880   
                expected_headers,
17512  15881   
            ));
17513  15882   
        }
17514  15883   
    }
17515         -
    /// Malformed values in the body should be rejected
17516         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case5
       15884  +
    /// Underflow or overflow should result in SerializationException
       15885  +
    /// Test ID: RestJsonPathByteUnderflowOverflow_case4
17517  15886   
    #[::tokio::test]
17518         -
    async fn rest_json_body_integer_malformed_value_rejected_case5_malformed_request() {
       15887  +
    #[::tracing_test::traced_test]
       15888  +
    async fn rest_json_path_byte_underflow_overflow_case4_malformed_request() {
17519  15889   
        {
17520  15890   
            #[allow(unused_mut)]
17521  15891   
            let mut http_request = http::Request::builder()
17522         -
                .uri("/MalformedInteger/1")
       15892  +
                .uri("/MalformedByte/123000000000000000000000")
17523  15893   
                .method("POST")
17524         -
                .header("content-type", "application/json")
17525         -
                .body(::aws_smithy_http_server::body::Body::from(
17526         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : Infinity }".as_bytes()),
17527         -
                ))
       15894  +
                .body(::aws_smithy_http_server::body::Body::empty())
17528  15895   
                .unwrap();
17529  15896   
            #[allow(unused_mut)]
17530  15897   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17531  15898   
            let config = crate::service::RestJsonConfig::builder().build();
17532  15899   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17533         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15900  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17534  15901   
                                let sender = sender.clone();
17535  15902   
                                async move {
17536         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15903  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17537  15904   
                                    sender.send(()).await.expect("receiver dropped early");
17538  15905   
                                    result
17539  15906   
                                }
17540  15907   
                            })
17541  15908   
                            .build_unchecked();
17542  15909   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17543  15910   
                .await
17544  15911   
                .expect("unable to make an HTTP request");
17545  15912   
            ::pretty_assertions::assert_eq!(
17546  15913   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17547  15914   
                http_response.status()
17548  15915   
            );
17549  15916   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17550  15917   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17551  15918   
                http_response.headers(),
17552  15919   
                expected_headers,
17553  15920   
            ));
17554  15921   
        }
17555  15922   
    }
17556         -
    /// Malformed values in the body should be rejected
17557         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case6
       15923  +
    /// Underflow or overflow should result in SerializationException
       15924  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case0
17558  15925   
    #[::tokio::test]
17559         -
    async fn rest_json_body_integer_malformed_value_rejected_case6_malformed_request() {
       15926  +
    #[::tracing_test::traced_test]
       15927  +
    async fn rest_json_query_byte_underflow_overflow_case0_malformed_request() {
17560  15928   
        {
17561  15929   
            #[allow(unused_mut)]
17562  15930   
            let mut http_request = http::Request::builder()
17563         -
                .uri("/MalformedInteger/1")
       15931  +
                .uri("/MalformedByte/1")
17564  15932   
                .method("POST")
17565         -
                .header("content-type", "application/json")
17566         -
                .body(::aws_smithy_http_server::body::Body::from(
17567         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"Infinity\" }".as_bytes()),
17568         -
                ))
       15933  +
                .body(::aws_smithy_http_server::body::Body::empty())
17569  15934   
                .unwrap();
       15935  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=256".parse().unwrap();
17570  15936   
            #[allow(unused_mut)]
17571  15937   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17572  15938   
            let config = crate::service::RestJsonConfig::builder().build();
17573  15939   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17574         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15940  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17575  15941   
                                let sender = sender.clone();
17576  15942   
                                async move {
17577         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15943  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17578  15944   
                                    sender.send(()).await.expect("receiver dropped early");
17579  15945   
                                    result
17580  15946   
                                }
17581  15947   
                            })
17582  15948   
                            .build_unchecked();
17583  15949   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17584  15950   
                .await
17585  15951   
                .expect("unable to make an HTTP request");
17586  15952   
            ::pretty_assertions::assert_eq!(
17587  15953   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17588  15954   
                http_response.status()
17589  15955   
            );
17590  15956   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17591  15957   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17592  15958   
                http_response.headers(),
17593  15959   
                expected_headers,
17594  15960   
            ));
17595  15961   
        }
17596  15962   
    }
17597         -
    /// Malformed values in the body should be rejected
17598         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case7
       15963  +
    /// Underflow or overflow should result in SerializationException
       15964  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case1
17599  15965   
    #[::tokio::test]
17600         -
    async fn rest_json_body_integer_malformed_value_rejected_case7_malformed_request() {
       15966  +
    #[::tracing_test::traced_test]
       15967  +
    async fn rest_json_query_byte_underflow_overflow_case1_malformed_request() {
17601  15968   
        {
17602  15969   
            #[allow(unused_mut)]
17603  15970   
            let mut http_request = http::Request::builder()
17604         -
                .uri("/MalformedInteger/1")
       15971  +
                .uri("/MalformedByte/1")
17605  15972   
                .method("POST")
17606         -
                .header("content-type", "application/json")
17607         -
                .body(::aws_smithy_http_server::body::Body::from(
17608         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : -Infinity }".as_bytes()),
17609         -
                ))
       15973  +
                .body(::aws_smithy_http_server::body::Body::empty())
17610  15974   
                .unwrap();
       15975  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-256".parse().unwrap();
17611  15976   
            #[allow(unused_mut)]
17612  15977   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17613  15978   
            let config = crate::service::RestJsonConfig::builder().build();
17614  15979   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17615         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       15980  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17616  15981   
                                let sender = sender.clone();
17617  15982   
                                async move {
17618         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       15983  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17619  15984   
                                    sender.send(()).await.expect("receiver dropped early");
17620  15985   
                                    result
17621  15986   
                                }
17622  15987   
                            })
17623  15988   
                            .build_unchecked();
17624  15989   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17625  15990   
                .await
17626  15991   
                .expect("unable to make an HTTP request");
17627  15992   
            ::pretty_assertions::assert_eq!(
17628  15993   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17629  15994   
                http_response.status()
17630  15995   
            );
17631  15996   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17632  15997   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17633  15998   
                http_response.headers(),
17634  15999   
                expected_headers,
17635  16000   
            ));
17636  16001   
        }
17637  16002   
    }
17638         -
    /// Malformed values in the body should be rejected
17639         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case8
       16003  +
    /// Underflow or overflow should result in SerializationException
       16004  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case2
17640  16005   
    #[::tokio::test]
17641         -
    async fn rest_json_body_integer_malformed_value_rejected_case8_malformed_request() {
       16006  +
    #[::tracing_test::traced_test]
       16007  +
    async fn rest_json_query_byte_underflow_overflow_case2_malformed_request() {
17642  16008   
        {
17643  16009   
            #[allow(unused_mut)]
17644  16010   
            let mut http_request = http::Request::builder()
17645         -
                .uri("/MalformedInteger/1")
       16011  +
                .uri("/MalformedByte/1")
17646  16012   
                .method("POST")
17647         -
                .header("content-type", "application/json")
17648         -
                .body(::aws_smithy_http_server::body::Body::from(
17649         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"-Infinity\" }".as_bytes()),
17650         -
                ))
       16013  +
                .body(::aws_smithy_http_server::body::Body::empty())
       16014  +
                .unwrap();
       16015  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-9223372000000000000"
       16016  +
                .parse()
17651  16017   
                .unwrap();
17652  16018   
            #[allow(unused_mut)]
17653  16019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17654  16020   
            let config = crate::service::RestJsonConfig::builder().build();
17655  16021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17656         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16022  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17657  16023   
                                let sender = sender.clone();
17658  16024   
                                async move {
17659         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16025  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17660  16026   
                                    sender.send(()).await.expect("receiver dropped early");
17661  16027   
                                    result
17662  16028   
                                }
17663  16029   
                            })
17664  16030   
                            .build_unchecked();
17665  16031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17666  16032   
                .await
17667  16033   
                .expect("unable to make an HTTP request");
17668  16034   
            ::pretty_assertions::assert_eq!(
17669  16035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17670  16036   
                http_response.status()
17671  16037   
            );
17672  16038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17673  16039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17674  16040   
                http_response.headers(),
17675  16041   
                expected_headers,
17676  16042   
            ));
17677  16043   
        }
17678  16044   
    }
17679         -
    /// Malformed values in the body should be rejected
17680         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case9
       16045  +
    /// Underflow or overflow should result in SerializationException
       16046  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case3
17681  16047   
    #[::tokio::test]
17682         -
    async fn rest_json_body_integer_malformed_value_rejected_case9_malformed_request() {
       16048  +
    #[::tracing_test::traced_test]
       16049  +
    async fn rest_json_query_byte_underflow_overflow_case3_malformed_request() {
17683  16050   
        {
17684  16051   
            #[allow(unused_mut)]
17685  16052   
            let mut http_request = http::Request::builder()
17686         -
                .uri("/MalformedInteger/1")
       16053  +
                .uri("/MalformedByte/1")
17687  16054   
                .method("POST")
17688         -
                .header("content-type", "application/json")
17689         -
                .body(::aws_smithy_http_server::body::Body::from(
17690         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : NaN }".as_bytes()),
17691         -
                ))
       16055  +
                .body(::aws_smithy_http_server::body::Body::empty())
       16056  +
                .unwrap();
       16057  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=9223372000000000000"
       16058  +
                .parse()
17692  16059   
                .unwrap();
17693  16060   
            #[allow(unused_mut)]
17694  16061   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17695  16062   
            let config = crate::service::RestJsonConfig::builder().build();
17696  16063   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17697         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16064  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17698  16065   
                                let sender = sender.clone();
17699  16066   
                                async move {
17700         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16067  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17701  16068   
                                    sender.send(()).await.expect("receiver dropped early");
17702  16069   
                                    result
17703  16070   
                                }
17704  16071   
                            })
17705  16072   
                            .build_unchecked();
17706  16073   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17707  16074   
                .await
17708  16075   
                .expect("unable to make an HTTP request");
17709  16076   
            ::pretty_assertions::assert_eq!(
17710  16077   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17711  16078   
                http_response.status()
17712  16079   
            );
17713  16080   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17714  16081   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17715  16082   
                http_response.headers(),
17716  16083   
                expected_headers,
17717  16084   
            ));
17718  16085   
        }
17719  16086   
    }
17720         -
    /// Malformed values in the body should be rejected
17721         -
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case10
       16087  +
    /// Underflow or overflow should result in SerializationException
       16088  +
    /// Test ID: RestJsonQueryByteUnderflowOverflow_case4
17722  16089   
    #[::tokio::test]
17723         -
    async fn rest_json_body_integer_malformed_value_rejected_case10_malformed_request() {
       16090  +
    #[::tracing_test::traced_test]
       16091  +
    async fn rest_json_query_byte_underflow_overflow_case4_malformed_request() {
17724  16092   
        {
17725  16093   
            #[allow(unused_mut)]
17726  16094   
            let mut http_request = http::Request::builder()
17727         -
                .uri("/MalformedInteger/1")
       16095  +
                .uri("/MalformedByte/1")
17728  16096   
                .method("POST")
17729         -
                .header("content-type", "application/json")
17730         -
                .body(::aws_smithy_http_server::body::Body::from(
17731         -
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"NaN\" }".as_bytes()),
17732         -
                ))
       16097  +
                .body(::aws_smithy_http_server::body::Body::empty())
       16098  +
                .unwrap();
       16099  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=123000000000000000000000"
       16100  +
                .parse()
17733  16101   
                .unwrap();
17734  16102   
            #[allow(unused_mut)]
17735  16103   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17736  16104   
            let config = crate::service::RestJsonConfig::builder().build();
17737  16105   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17738         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16106  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17739  16107   
                                let sender = sender.clone();
17740  16108   
                                async move {
17741         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16109  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17742  16110   
                                    sender.send(()).await.expect("receiver dropped early");
17743  16111   
                                    result
17744  16112   
                                }
17745  16113   
                            })
17746  16114   
                            .build_unchecked();
17747  16115   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17748  16116   
                .await
17749  16117   
                .expect("unable to make an HTTP request");
17750  16118   
            ::pretty_assertions::assert_eq!(
17751  16119   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17752  16120   
                http_response.status()
17753  16121   
            );
17754  16122   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17755  16123   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17756  16124   
                http_response.headers(),
17757  16125   
                expected_headers,
17758  16126   
            ));
17759  16127   
        }
17760  16128   
    }
17761         -
    /// Malformed values in the path should be rejected
17762         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case0
       16129  +
    /// Underflow or overflow should result in SerializationException
       16130  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case0
17763  16131   
    #[::tokio::test]
17764         -
    async fn rest_json_path_integer_malformed_value_rejected_case0_malformed_request() {
       16132  +
    #[::tracing_test::traced_test]
       16133  +
    async fn rest_json_header_byte_underflow_overflow_case0_malformed_request() {
17765  16134   
        {
17766  16135   
            #[allow(unused_mut)]
17767  16136   
            let mut http_request = http::Request::builder()
17768         -
                .uri("/MalformedInteger/true")
       16137  +
                .uri("/MalformedByte/1")
17769  16138   
                .method("POST")
       16139  +
                .header("byteInHeader", "256")
17770  16140   
                .body(::aws_smithy_http_server::body::Body::empty())
17771  16141   
                .unwrap();
17772  16142   
            #[allow(unused_mut)]
17773  16143   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17774  16144   
            let config = crate::service::RestJsonConfig::builder().build();
17775  16145   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17776         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16146  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17777  16147   
                                let sender = sender.clone();
17778  16148   
                                async move {
17779         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16149  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17780  16150   
                                    sender.send(()).await.expect("receiver dropped early");
17781  16151   
                                    result
17782  16152   
                                }
17783  16153   
                            })
17784  16154   
                            .build_unchecked();
17785  16155   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17786  16156   
                .await
17787  16157   
                .expect("unable to make an HTTP request");
17788  16158   
            ::pretty_assertions::assert_eq!(
17789  16159   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17790  16160   
                http_response.status()
17791  16161   
            );
17792  16162   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17793  16163   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17794  16164   
                http_response.headers(),
17795  16165   
                expected_headers,
17796  16166   
            ));
17797  16167   
        }
17798  16168   
    }
17799         -
    /// Malformed values in the path should be rejected
17800         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case1
       16169  +
    /// Underflow or overflow should result in SerializationException
       16170  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case1
17801  16171   
    #[::tokio::test]
17802         -
    async fn rest_json_path_integer_malformed_value_rejected_case1_malformed_request() {
       16172  +
    #[::tracing_test::traced_test]
       16173  +
    async fn rest_json_header_byte_underflow_overflow_case1_malformed_request() {
17803  16174   
        {
17804  16175   
            #[allow(unused_mut)]
17805  16176   
            let mut http_request = http::Request::builder()
17806         -
                .uri("/MalformedInteger/1.001")
       16177  +
                .uri("/MalformedByte/1")
17807  16178   
                .method("POST")
       16179  +
                .header("byteInHeader", "-256")
17808  16180   
                .body(::aws_smithy_http_server::body::Body::empty())
17809  16181   
                .unwrap();
17810  16182   
            #[allow(unused_mut)]
17811  16183   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17812  16184   
            let config = crate::service::RestJsonConfig::builder().build();
17813  16185   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17814         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16186  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17815  16187   
                                let sender = sender.clone();
17816  16188   
                                async move {
17817         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16189  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17818  16190   
                                    sender.send(()).await.expect("receiver dropped early");
17819  16191   
                                    result
17820  16192   
                                }
17821  16193   
                            })
17822  16194   
                            .build_unchecked();
17823  16195   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17824  16196   
                .await
17825  16197   
                .expect("unable to make an HTTP request");
17826  16198   
            ::pretty_assertions::assert_eq!(
17827  16199   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17828  16200   
                http_response.status()
17829  16201   
            );
17830  16202   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17831  16203   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17832  16204   
                http_response.headers(),
17833  16205   
                expected_headers,
17834  16206   
            ));
17835  16207   
        }
17836  16208   
    }
17837         -
    /// Malformed values in the path should be rejected
17838         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case2
       16209  +
    /// Underflow or overflow should result in SerializationException
       16210  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case2
17839  16211   
    #[::tokio::test]
17840         -
    async fn rest_json_path_integer_malformed_value_rejected_case2_malformed_request() {
       16212  +
    #[::tracing_test::traced_test]
       16213  +
    async fn rest_json_header_byte_underflow_overflow_case2_malformed_request() {
17841  16214   
        {
17842  16215   
            #[allow(unused_mut)]
17843  16216   
            let mut http_request = http::Request::builder()
17844         -
                .uri("/MalformedInteger/2ABC")
       16217  +
                .uri("/MalformedByte/1")
17845  16218   
                .method("POST")
       16219  +
                .header("byteInHeader", "-9223372000000000000")
17846  16220   
                .body(::aws_smithy_http_server::body::Body::empty())
17847  16221   
                .unwrap();
17848  16222   
            #[allow(unused_mut)]
17849  16223   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17850  16224   
            let config = crate::service::RestJsonConfig::builder().build();
17851  16225   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17852         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16226  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17853  16227   
                                let sender = sender.clone();
17854  16228   
                                async move {
17855         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16229  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17856  16230   
                                    sender.send(()).await.expect("receiver dropped early");
17857  16231   
                                    result
17858  16232   
                                }
17859  16233   
                            })
17860  16234   
                            .build_unchecked();
17861  16235   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17862  16236   
                .await
17863  16237   
                .expect("unable to make an HTTP request");
17864  16238   
            ::pretty_assertions::assert_eq!(
17865  16239   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17866  16240   
                http_response.status()
17867  16241   
            );
17868  16242   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17869  16243   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17870  16244   
                http_response.headers(),
17871  16245   
                expected_headers,
17872  16246   
            ));
17873  16247   
        }
17874  16248   
    }
17875         -
    /// Malformed values in the path should be rejected
17876         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case3
       16249  +
    /// Underflow or overflow should result in SerializationException
       16250  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case3
17877  16251   
    #[::tokio::test]
17878         -
    async fn rest_json_path_integer_malformed_value_rejected_case3_malformed_request() {
       16252  +
    #[::tracing_test::traced_test]
       16253  +
    async fn rest_json_header_byte_underflow_overflow_case3_malformed_request() {
17879  16254   
        {
17880  16255   
            #[allow(unused_mut)]
17881  16256   
            let mut http_request = http::Request::builder()
17882         -
                .uri("/MalformedInteger/0x42")
       16257  +
                .uri("/MalformedByte/1")
17883  16258   
                .method("POST")
       16259  +
                .header("byteInHeader", "9223372000000000000")
17884  16260   
                .body(::aws_smithy_http_server::body::Body::empty())
17885  16261   
                .unwrap();
17886  16262   
            #[allow(unused_mut)]
17887  16263   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17888  16264   
            let config = crate::service::RestJsonConfig::builder().build();
17889  16265   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17890         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16266  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17891  16267   
                                let sender = sender.clone();
17892  16268   
                                async move {
17893         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16269  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17894  16270   
                                    sender.send(()).await.expect("receiver dropped early");
17895  16271   
                                    result
17896  16272   
                                }
17897  16273   
                            })
17898  16274   
                            .build_unchecked();
17899  16275   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17900  16276   
                .await
17901  16277   
                .expect("unable to make an HTTP request");
17902  16278   
            ::pretty_assertions::assert_eq!(
17903  16279   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17904  16280   
                http_response.status()
17905  16281   
            );
17906  16282   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17907  16283   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17908  16284   
                http_response.headers(),
17909  16285   
                expected_headers,
17910  16286   
            ));
17911  16287   
        }
17912  16288   
    }
17913         -
    /// Malformed values in the path should be rejected
17914         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case4
       16289  +
    /// Underflow or overflow should result in SerializationException
       16290  +
    /// Test ID: RestJsonHeaderByteUnderflowOverflow_case4
17915  16291   
    #[::tokio::test]
17916         -
    async fn rest_json_path_integer_malformed_value_rejected_case4_malformed_request() {
       16292  +
    #[::tracing_test::traced_test]
       16293  +
    async fn rest_json_header_byte_underflow_overflow_case4_malformed_request() {
17917  16294   
        {
17918  16295   
            #[allow(unused_mut)]
17919  16296   
            let mut http_request = http::Request::builder()
17920         -
                .uri("/MalformedInteger/Infinity")
       16297  +
                .uri("/MalformedByte/1")
17921  16298   
                .method("POST")
       16299  +
                .header("byteInHeader", "123000000000000000000000")
17922  16300   
                .body(::aws_smithy_http_server::body::Body::empty())
17923  16301   
                .unwrap();
17924  16302   
            #[allow(unused_mut)]
17925  16303   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17926  16304   
            let config = crate::service::RestJsonConfig::builder().build();
17927  16305   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17928         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16306  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17929  16307   
                                let sender = sender.clone();
17930  16308   
                                async move {
17931         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16309  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17932  16310   
                                    sender.send(()).await.expect("receiver dropped early");
17933  16311   
                                    result
17934  16312   
                                }
17935  16313   
                            })
17936  16314   
                            .build_unchecked();
17937  16315   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17938  16316   
                .await
17939  16317   
                .expect("unable to make an HTTP request");
17940  16318   
            ::pretty_assertions::assert_eq!(
17941  16319   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17942  16320   
                http_response.status()
17943  16321   
            );
17944  16322   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17945  16323   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17946  16324   
                http_response.headers(),
17947  16325   
                expected_headers,
17948  16326   
            ));
17949  16327   
        }
17950  16328   
    }
17951         -
    /// Malformed values in the path should be rejected
17952         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case5
       16329  +
    /// Malformed values in the body should be rejected
       16330  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case0
17953  16331   
    #[::tokio::test]
17954         -
    async fn rest_json_path_integer_malformed_value_rejected_case5_malformed_request() {
       16332  +
    #[::tracing_test::traced_test]
       16333  +
    async fn rest_json_body_byte_malformed_value_rejected_case0_malformed_request() {
17955  16334   
        {
17956  16335   
            #[allow(unused_mut)]
17957  16336   
            let mut http_request = http::Request::builder()
17958         -
                .uri("/MalformedInteger/-Infinity")
       16337  +
                .uri("/MalformedByte/1")
17959  16338   
                .method("POST")
17960         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16339  +
                .header("content-type", "application/json")
       16340  +
                .body(::aws_smithy_http_server::body::Body::from(
       16341  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"123\" }".as_bytes()),
       16342  +
                ))
17961  16343   
                .unwrap();
17962  16344   
            #[allow(unused_mut)]
17963  16345   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
17964  16346   
            let config = crate::service::RestJsonConfig::builder().build();
17965  16347   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
17966         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16348  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
17967  16349   
                                let sender = sender.clone();
17968  16350   
                                async move {
17969         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16351  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
17970  16352   
                                    sender.send(()).await.expect("receiver dropped early");
17971  16353   
                                    result
17972  16354   
                                }
17973  16355   
                            })
17974  16356   
                            .build_unchecked();
17975  16357   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
17976  16358   
                .await
17977  16359   
                .expect("unable to make an HTTP request");
17978  16360   
            ::pretty_assertions::assert_eq!(
17979  16361   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
17980  16362   
                http_response.status()
17981  16363   
            );
17982  16364   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
17983  16365   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
17984  16366   
                http_response.headers(),
17985  16367   
                expected_headers,
17986  16368   
            ));
17987  16369   
        }
17988  16370   
    }
17989         -
    /// Malformed values in the path should be rejected
17990         -
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case6
       16371  +
    /// Malformed values in the body should be rejected
       16372  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case1
17991  16373   
    #[::tokio::test]
17992         -
    async fn rest_json_path_integer_malformed_value_rejected_case6_malformed_request() {
       16374  +
    #[::tracing_test::traced_test]
       16375  +
    async fn rest_json_body_byte_malformed_value_rejected_case1_malformed_request() {
17993  16376   
        {
17994  16377   
            #[allow(unused_mut)]
17995  16378   
            let mut http_request = http::Request::builder()
17996         -
                .uri("/MalformedInteger/NaN")
       16379  +
                .uri("/MalformedByte/1")
17997  16380   
                .method("POST")
17998         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16381  +
                .header("content-type", "application/json")
       16382  +
                .body(::aws_smithy_http_server::body::Body::from(
       16383  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : true }".as_bytes()),
       16384  +
                ))
17999  16385   
                .unwrap();
18000  16386   
            #[allow(unused_mut)]
18001  16387   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18002  16388   
            let config = crate::service::RestJsonConfig::builder().build();
18003  16389   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18004         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16390  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18005  16391   
                                let sender = sender.clone();
18006  16392   
                                async move {
18007         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16393  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18008  16394   
                                    sender.send(()).await.expect("receiver dropped early");
18009  16395   
                                    result
18010  16396   
                                }
18011  16397   
                            })
18012  16398   
                            .build_unchecked();
18013  16399   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18014  16400   
                .await
18015  16401   
                .expect("unable to make an HTTP request");
18016  16402   
            ::pretty_assertions::assert_eq!(
18017  16403   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18018  16404   
                http_response.status()
18019  16405   
            );
18020  16406   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18021  16407   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18022  16408   
                http_response.headers(),
18023  16409   
                expected_headers,
18024  16410   
            ));
18025  16411   
        }
18026  16412   
    }
18027         -
    /// Malformed values in query parameters should be rejected
18028         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case0
       16413  +
    /// Malformed values in the body should be rejected
       16414  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case2
18029  16415   
    #[::tokio::test]
18030         -
    async fn rest_json_query_integer_malformed_value_rejected_case0_malformed_request() {
       16416  +
    #[::tracing_test::traced_test]
       16417  +
    async fn rest_json_body_byte_malformed_value_rejected_case2_malformed_request() {
18031  16418   
        {
18032  16419   
            #[allow(unused_mut)]
18033  16420   
            let mut http_request = http::Request::builder()
18034         -
                .uri("/MalformedInteger/1")
       16421  +
                .uri("/MalformedByte/1")
18035  16422   
                .method("POST")
18036         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16423  +
                .header("content-type", "application/json")
       16424  +
                .body(::aws_smithy_http_server::body::Body::from(
       16425  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 1.001 }".as_bytes()),
       16426  +
                ))
18037  16427   
                .unwrap();
18038         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=true".parse().unwrap();
18039  16428   
            #[allow(unused_mut)]
18040  16429   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18041  16430   
            let config = crate::service::RestJsonConfig::builder().build();
18042  16431   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18043         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16432  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18044  16433   
                                let sender = sender.clone();
18045  16434   
                                async move {
18046         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16435  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18047  16436   
                                    sender.send(()).await.expect("receiver dropped early");
18048  16437   
                                    result
18049  16438   
                                }
18050  16439   
                            })
18051  16440   
                            .build_unchecked();
18052  16441   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18053  16442   
                .await
18054  16443   
                .expect("unable to make an HTTP request");
18055  16444   
            ::pretty_assertions::assert_eq!(
18056  16445   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18057  16446   
                http_response.status()
18058  16447   
            );
18059  16448   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18060  16449   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18061  16450   
                http_response.headers(),
18062  16451   
                expected_headers,
18063  16452   
            ));
18064  16453   
        }
18065  16454   
    }
18066         -
    /// Malformed values in query parameters should be rejected
18067         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case1
       16455  +
    /// Malformed values in the body should be rejected
       16456  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case3
18068  16457   
    #[::tokio::test]
18069         -
    async fn rest_json_query_integer_malformed_value_rejected_case1_malformed_request() {
       16458  +
    #[::tracing_test::traced_test]
       16459  +
    async fn rest_json_body_byte_malformed_value_rejected_case3_malformed_request() {
18070  16460   
        {
18071  16461   
            #[allow(unused_mut)]
18072  16462   
            let mut http_request = http::Request::builder()
18073         -
                .uri("/MalformedInteger/1")
       16463  +
                .uri("/MalformedByte/1")
18074  16464   
                .method("POST")
18075         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16465  +
                .header("content-type", "application/json")
       16466  +
                .body(::aws_smithy_http_server::body::Body::from(
       16467  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 2ABC }".as_bytes()),
       16468  +
                ))
18076  16469   
                .unwrap();
18077         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=1.001".parse().unwrap();
18078  16470   
            #[allow(unused_mut)]
18079  16471   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18080  16472   
            let config = crate::service::RestJsonConfig::builder().build();
18081  16473   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18082         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16474  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18083  16475   
                                let sender = sender.clone();
18084  16476   
                                async move {
18085         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16477  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18086  16478   
                                    sender.send(()).await.expect("receiver dropped early");
18087  16479   
                                    result
18088  16480   
                                }
18089  16481   
                            })
18090  16482   
                            .build_unchecked();
18091  16483   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18092  16484   
                .await
18093  16485   
                .expect("unable to make an HTTP request");
18094  16486   
            ::pretty_assertions::assert_eq!(
18095  16487   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18096  16488   
                http_response.status()
18097  16489   
            );
18098  16490   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18099  16491   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18100  16492   
                http_response.headers(),
18101  16493   
                expected_headers,
18102  16494   
            ));
18103  16495   
        }
18104  16496   
    }
18105         -
    /// Malformed values in query parameters should be rejected
18106         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case2
       16497  +
    /// Malformed values in the body should be rejected
       16498  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case4
18107  16499   
    #[::tokio::test]
18108         -
    async fn rest_json_query_integer_malformed_value_rejected_case2_malformed_request() {
       16500  +
    #[::tracing_test::traced_test]
       16501  +
    async fn rest_json_body_byte_malformed_value_rejected_case4_malformed_request() {
18109  16502   
        {
18110  16503   
            #[allow(unused_mut)]
18111  16504   
            let mut http_request = http::Request::builder()
18112         -
                .uri("/MalformedInteger/1")
       16505  +
                .uri("/MalformedByte/1")
18113  16506   
                .method("POST")
18114         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16507  +
                .header("content-type", "application/json")
       16508  +
                .body(::aws_smithy_http_server::body::Body::from(
       16509  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : 0x42 }".as_bytes()),
       16510  +
                ))
18115  16511   
                .unwrap();
18116         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=2ABC".parse().unwrap();
18117  16512   
            #[allow(unused_mut)]
18118  16513   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18119  16514   
            let config = crate::service::RestJsonConfig::builder().build();
18120  16515   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18121         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16516  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18122  16517   
                                let sender = sender.clone();
18123  16518   
                                async move {
18124         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16519  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18125  16520   
                                    sender.send(()).await.expect("receiver dropped early");
18126  16521   
                                    result
18127  16522   
                                }
18128  16523   
                            })
18129  16524   
                            .build_unchecked();
18130  16525   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18131  16526   
                .await
18132  16527   
                .expect("unable to make an HTTP request");
18133  16528   
            ::pretty_assertions::assert_eq!(
18134  16529   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18135  16530   
                http_response.status()
18136  16531   
            );
18137  16532   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18138  16533   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18139  16534   
                http_response.headers(),
18140  16535   
                expected_headers,
18141  16536   
            ));
18142  16537   
        }
18143  16538   
    }
18144         -
    /// Malformed values in query parameters should be rejected
18145         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case3
       16539  +
    /// Malformed values in the body should be rejected
       16540  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case5
18146  16541   
    #[::tokio::test]
18147         -
    async fn rest_json_query_integer_malformed_value_rejected_case3_malformed_request() {
       16542  +
    #[::tracing_test::traced_test]
       16543  +
    async fn rest_json_body_byte_malformed_value_rejected_case5_malformed_request() {
18148  16544   
        {
18149  16545   
            #[allow(unused_mut)]
18150  16546   
            let mut http_request = http::Request::builder()
18151         -
                .uri("/MalformedInteger/1")
       16547  +
                .uri("/MalformedByte/1")
18152  16548   
                .method("POST")
18153         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16549  +
                .header("content-type", "application/json")
       16550  +
                .body(::aws_smithy_http_server::body::Body::from(
       16551  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : Infinity }".as_bytes()),
       16552  +
                ))
18154  16553   
                .unwrap();
18155         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=0x42".parse().unwrap();
18156  16554   
            #[allow(unused_mut)]
18157  16555   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18158  16556   
            let config = crate::service::RestJsonConfig::builder().build();
18159  16557   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18160         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16558  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18161  16559   
                                let sender = sender.clone();
18162  16560   
                                async move {
18163         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16561  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18164  16562   
                                    sender.send(()).await.expect("receiver dropped early");
18165  16563   
                                    result
18166  16564   
                                }
18167  16565   
                            })
18168  16566   
                            .build_unchecked();
18169  16567   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18170  16568   
                .await
18171  16569   
                .expect("unable to make an HTTP request");
18172  16570   
            ::pretty_assertions::assert_eq!(
18173  16571   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18174  16572   
                http_response.status()
18175  16573   
            );
18176  16574   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18177  16575   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18178  16576   
                http_response.headers(),
18179  16577   
                expected_headers,
18180  16578   
            ));
18181  16579   
        }
18182  16580   
    }
18183         -
    /// Malformed values in query parameters should be rejected
18184         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case4
       16581  +
    /// Malformed values in the body should be rejected
       16582  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case6
18185  16583   
    #[::tokio::test]
18186         -
    async fn rest_json_query_integer_malformed_value_rejected_case4_malformed_request() {
       16584  +
    #[::tracing_test::traced_test]
       16585  +
    async fn rest_json_body_byte_malformed_value_rejected_case6_malformed_request() {
18187  16586   
        {
18188  16587   
            #[allow(unused_mut)]
18189  16588   
            let mut http_request = http::Request::builder()
18190         -
                .uri("/MalformedInteger/1")
       16589  +
                .uri("/MalformedByte/1")
18191  16590   
                .method("POST")
18192         -
                .body(::aws_smithy_http_server::body::Body::empty())
18193         -
                .unwrap();
18194         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=Infinity"
18195         -
                .parse()
       16591  +
                .header("content-type", "application/json")
       16592  +
                .body(::aws_smithy_http_server::body::Body::from(
       16593  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"Infinity\" }".as_bytes()),
       16594  +
                ))
18196  16595   
                .unwrap();
18197  16596   
            #[allow(unused_mut)]
18198  16597   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18199  16598   
            let config = crate::service::RestJsonConfig::builder().build();
18200  16599   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18201         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16600  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18202  16601   
                                let sender = sender.clone();
18203  16602   
                                async move {
18204         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16603  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18205  16604   
                                    sender.send(()).await.expect("receiver dropped early");
18206  16605   
                                    result
18207  16606   
                                }
18208  16607   
                            })
18209  16608   
                            .build_unchecked();
18210  16609   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18211  16610   
                .await
18212  16611   
                .expect("unable to make an HTTP request");
18213  16612   
            ::pretty_assertions::assert_eq!(
18214  16613   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18215  16614   
                http_response.status()
18216  16615   
            );
18217  16616   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18218  16617   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18219  16618   
                http_response.headers(),
18220  16619   
                expected_headers,
18221  16620   
            ));
18222  16621   
        }
18223  16622   
    }
18224         -
    /// Malformed values in query parameters should be rejected
18225         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case5
       16623  +
    /// Malformed values in the body should be rejected
       16624  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case7
18226  16625   
    #[::tokio::test]
18227         -
    async fn rest_json_query_integer_malformed_value_rejected_case5_malformed_request() {
       16626  +
    #[::tracing_test::traced_test]
       16627  +
    async fn rest_json_body_byte_malformed_value_rejected_case7_malformed_request() {
18228  16628   
        {
18229  16629   
            #[allow(unused_mut)]
18230  16630   
            let mut http_request = http::Request::builder()
18231         -
                .uri("/MalformedInteger/1")
       16631  +
                .uri("/MalformedByte/1")
18232  16632   
                .method("POST")
18233         -
                .body(::aws_smithy_http_server::body::Body::empty())
18234         -
                .unwrap();
18235         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-Infinity"
18236         -
                .parse()
       16633  +
                .header("content-type", "application/json")
       16634  +
                .body(::aws_smithy_http_server::body::Body::from(
       16635  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : -Infinity }".as_bytes()),
       16636  +
                ))
18237  16637   
                .unwrap();
18238  16638   
            #[allow(unused_mut)]
18239  16639   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18240  16640   
            let config = crate::service::RestJsonConfig::builder().build();
18241  16641   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18242         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16642  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18243  16643   
                                let sender = sender.clone();
18244  16644   
                                async move {
18245         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16645  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18246  16646   
                                    sender.send(()).await.expect("receiver dropped early");
18247  16647   
                                    result
18248  16648   
                                }
18249  16649   
                            })
18250  16650   
                            .build_unchecked();
18251  16651   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18252  16652   
                .await
18253  16653   
                .expect("unable to make an HTTP request");
18254  16654   
            ::pretty_assertions::assert_eq!(
18255  16655   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18256  16656   
                http_response.status()
18257  16657   
            );
18258  16658   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18259  16659   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18260  16660   
                http_response.headers(),
18261  16661   
                expected_headers,
18262  16662   
            ));
18263  16663   
        }
18264  16664   
    }
18265         -
    /// Malformed values in query parameters should be rejected
18266         -
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case6
       16665  +
    /// Malformed values in the body should be rejected
       16666  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case8
18267  16667   
    #[::tokio::test]
18268         -
    async fn rest_json_query_integer_malformed_value_rejected_case6_malformed_request() {
       16668  +
    #[::tracing_test::traced_test]
       16669  +
    async fn rest_json_body_byte_malformed_value_rejected_case8_malformed_request() {
18269  16670   
        {
18270  16671   
            #[allow(unused_mut)]
18271  16672   
            let mut http_request = http::Request::builder()
18272         -
                .uri("/MalformedInteger/1")
       16673  +
                .uri("/MalformedByte/1")
18273  16674   
                .method("POST")
18274         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16675  +
                .header("content-type", "application/json")
       16676  +
                .body(::aws_smithy_http_server::body::Body::from(
       16677  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"-Infinity\" }".as_bytes()),
       16678  +
                ))
18275  16679   
                .unwrap();
18276         -
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=NaN".parse().unwrap();
18277  16680   
            #[allow(unused_mut)]
18278  16681   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18279  16682   
            let config = crate::service::RestJsonConfig::builder().build();
18280  16683   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18281         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16684  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18282  16685   
                                let sender = sender.clone();
18283  16686   
                                async move {
18284         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16687  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18285  16688   
                                    sender.send(()).await.expect("receiver dropped early");
18286  16689   
                                    result
18287  16690   
                                }
18288  16691   
                            })
18289  16692   
                            .build_unchecked();
18290  16693   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18291  16694   
                .await
18292  16695   
                .expect("unable to make an HTTP request");
18293  16696   
            ::pretty_assertions::assert_eq!(
18294  16697   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18295  16698   
                http_response.status()
18296  16699   
            );
18297  16700   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18298  16701   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18299  16702   
                http_response.headers(),
18300  16703   
                expected_headers,
18301  16704   
            ));
18302  16705   
        }
18303  16706   
    }
18304         -
    /// Malformed values in headers should be rejected
18305         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case0
       16707  +
    /// Malformed values in the body should be rejected
       16708  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case9
18306  16709   
    #[::tokio::test]
18307         -
    async fn rest_json_header_integer_malformed_value_rejected_case0_malformed_request() {
       16710  +
    #[::tracing_test::traced_test]
       16711  +
    async fn rest_json_body_byte_malformed_value_rejected_case9_malformed_request() {
18308  16712   
        {
18309  16713   
            #[allow(unused_mut)]
18310  16714   
            let mut http_request = http::Request::builder()
18311         -
                .uri("/MalformedInteger/1")
       16715  +
                .uri("/MalformedByte/1")
18312  16716   
                .method("POST")
18313         -
                .header("integerInHeader", "true")
18314         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16717  +
                .header("content-type", "application/json")
       16718  +
                .body(::aws_smithy_http_server::body::Body::from(
       16719  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : NaN }".as_bytes()),
       16720  +
                ))
18315  16721   
                .unwrap();
18316  16722   
            #[allow(unused_mut)]
18317  16723   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18318  16724   
            let config = crate::service::RestJsonConfig::builder().build();
18319  16725   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18320         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16726  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18321  16727   
                                let sender = sender.clone();
18322  16728   
                                async move {
18323         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16729  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18324  16730   
                                    sender.send(()).await.expect("receiver dropped early");
18325  16731   
                                    result
18326  16732   
                                }
18327  16733   
                            })
18328  16734   
                            .build_unchecked();
18329  16735   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18330  16736   
                .await
18331  16737   
                .expect("unable to make an HTTP request");
18332  16738   
            ::pretty_assertions::assert_eq!(
18333  16739   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18334  16740   
                http_response.status()
18335  16741   
            );
18336  16742   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18337  16743   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18338  16744   
                http_response.headers(),
18339  16745   
                expected_headers,
18340  16746   
            ));
18341  16747   
        }
18342  16748   
    }
18343         -
    /// Malformed values in headers should be rejected
18344         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case1
       16749  +
    /// Malformed values in the body should be rejected
       16750  +
    /// Test ID: RestJsonBodyByteMalformedValueRejected_case10
18345  16751   
    #[::tokio::test]
18346         -
    async fn rest_json_header_integer_malformed_value_rejected_case1_malformed_request() {
       16752  +
    #[::tracing_test::traced_test]
       16753  +
    async fn rest_json_body_byte_malformed_value_rejected_case10_malformed_request() {
18347  16754   
        {
18348  16755   
            #[allow(unused_mut)]
18349  16756   
            let mut http_request = http::Request::builder()
18350         -
                .uri("/MalformedInteger/1")
       16757  +
                .uri("/MalformedByte/1")
18351  16758   
                .method("POST")
18352         -
                .header("integerInHeader", "1.001")
18353         -
                .body(::aws_smithy_http_server::body::Body::empty())
       16759  +
                .header("content-type", "application/json")
       16760  +
                .body(::aws_smithy_http_server::body::Body::from(
       16761  +
                    ::bytes::Bytes::from_static("{ \"byteInBody\" : \"NaN\" }".as_bytes()),
       16762  +
                ))
18354  16763   
                .unwrap();
18355  16764   
            #[allow(unused_mut)]
18356  16765   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18357  16766   
            let config = crate::service::RestJsonConfig::builder().build();
18358  16767   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18359         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16768  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18360  16769   
                                let sender = sender.clone();
18361  16770   
                                async move {
18362         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16771  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18363  16772   
                                    sender.send(()).await.expect("receiver dropped early");
18364  16773   
                                    result
18365  16774   
                                }
18366  16775   
                            })
18367  16776   
                            .build_unchecked();
18368  16777   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18369  16778   
                .await
18370  16779   
                .expect("unable to make an HTTP request");
18371  16780   
            ::pretty_assertions::assert_eq!(
18372  16781   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18373  16782   
                http_response.status()
18374  16783   
            );
18375  16784   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18376  16785   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18377  16786   
                http_response.headers(),
18378  16787   
                expected_headers,
18379  16788   
            ));
18380  16789   
        }
18381  16790   
    }
18382         -
    /// Malformed values in headers should be rejected
18383         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case2
       16791  +
    /// Malformed values in the path should be rejected
       16792  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case0
18384  16793   
    #[::tokio::test]
18385         -
    async fn rest_json_header_integer_malformed_value_rejected_case2_malformed_request() {
       16794  +
    #[::tracing_test::traced_test]
       16795  +
    async fn rest_json_path_byte_malformed_value_rejected_case0_malformed_request() {
18386  16796   
        {
18387  16797   
            #[allow(unused_mut)]
18388  16798   
            let mut http_request = http::Request::builder()
18389         -
                .uri("/MalformedInteger/1")
       16799  +
                .uri("/MalformedByte/true")
18390  16800   
                .method("POST")
18391         -
                .header("integerInHeader", "2ABC")
18392  16801   
                .body(::aws_smithy_http_server::body::Body::empty())
18393  16802   
                .unwrap();
18394  16803   
            #[allow(unused_mut)]
18395  16804   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18396  16805   
            let config = crate::service::RestJsonConfig::builder().build();
18397  16806   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18398         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16807  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18399  16808   
                                let sender = sender.clone();
18400  16809   
                                async move {
18401         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16810  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18402  16811   
                                    sender.send(()).await.expect("receiver dropped early");
18403  16812   
                                    result
18404  16813   
                                }
18405  16814   
                            })
18406  16815   
                            .build_unchecked();
18407  16816   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18408  16817   
                .await
18409  16818   
                .expect("unable to make an HTTP request");
18410  16819   
            ::pretty_assertions::assert_eq!(
18411  16820   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18412  16821   
                http_response.status()
18413  16822   
            );
18414  16823   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18415  16824   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18416  16825   
                http_response.headers(),
18417  16826   
                expected_headers,
18418  16827   
            ));
18419  16828   
        }
18420  16829   
    }
18421         -
    /// Malformed values in headers should be rejected
18422         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case3
       16830  +
    /// Malformed values in the path should be rejected
       16831  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case1
18423  16832   
    #[::tokio::test]
18424         -
    async fn rest_json_header_integer_malformed_value_rejected_case3_malformed_request() {
       16833  +
    #[::tracing_test::traced_test]
       16834  +
    async fn rest_json_path_byte_malformed_value_rejected_case1_malformed_request() {
18425  16835   
        {
18426  16836   
            #[allow(unused_mut)]
18427  16837   
            let mut http_request = http::Request::builder()
18428         -
                .uri("/MalformedInteger/1")
       16838  +
                .uri("/MalformedByte/1.001")
18429  16839   
                .method("POST")
18430         -
                .header("integerInHeader", "0x42")
18431  16840   
                .body(::aws_smithy_http_server::body::Body::empty())
18432  16841   
                .unwrap();
18433  16842   
            #[allow(unused_mut)]
18434  16843   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18435  16844   
            let config = crate::service::RestJsonConfig::builder().build();
18436  16845   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18437         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16846  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18438  16847   
                                let sender = sender.clone();
18439  16848   
                                async move {
18440         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16849  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18441  16850   
                                    sender.send(()).await.expect("receiver dropped early");
18442  16851   
                                    result
18443  16852   
                                }
18444  16853   
                            })
18445  16854   
                            .build_unchecked();
18446  16855   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18447  16856   
                .await
18448  16857   
                .expect("unable to make an HTTP request");
18449  16858   
            ::pretty_assertions::assert_eq!(
18450  16859   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18451  16860   
                http_response.status()
18452  16861   
            );
18453  16862   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18454  16863   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18455  16864   
                http_response.headers(),
18456  16865   
                expected_headers,
18457  16866   
            ));
18458  16867   
        }
18459  16868   
    }
18460         -
    /// Malformed values in headers should be rejected
18461         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case4
       16869  +
    /// Malformed values in the path should be rejected
       16870  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case2
18462  16871   
    #[::tokio::test]
18463         -
    async fn rest_json_header_integer_malformed_value_rejected_case4_malformed_request() {
       16872  +
    #[::tracing_test::traced_test]
       16873  +
    async fn rest_json_path_byte_malformed_value_rejected_case2_malformed_request() {
18464  16874   
        {
18465  16875   
            #[allow(unused_mut)]
18466  16876   
            let mut http_request = http::Request::builder()
18467         -
                .uri("/MalformedInteger/1")
       16877  +
                .uri("/MalformedByte/2ABC")
18468  16878   
                .method("POST")
18469         -
                .header("integerInHeader", "Infinity")
18470  16879   
                .body(::aws_smithy_http_server::body::Body::empty())
18471  16880   
                .unwrap();
18472  16881   
            #[allow(unused_mut)]
18473  16882   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18474  16883   
            let config = crate::service::RestJsonConfig::builder().build();
18475  16884   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18476         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16885  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18477  16886   
                                let sender = sender.clone();
18478  16887   
                                async move {
18479         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16888  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18480  16889   
                                    sender.send(()).await.expect("receiver dropped early");
18481  16890   
                                    result
18482  16891   
                                }
18483  16892   
                            })
18484  16893   
                            .build_unchecked();
18485  16894   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18486  16895   
                .await
18487  16896   
                .expect("unable to make an HTTP request");
18488  16897   
            ::pretty_assertions::assert_eq!(
18489  16898   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18490  16899   
                http_response.status()
18491  16900   
            );
18492  16901   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18493  16902   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18494  16903   
                http_response.headers(),
18495  16904   
                expected_headers,
18496  16905   
            ));
18497  16906   
        }
18498  16907   
    }
18499         -
    /// Malformed values in headers should be rejected
18500         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case5
       16908  +
    /// Malformed values in the path should be rejected
       16909  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case3
18501  16910   
    #[::tokio::test]
18502         -
    async fn rest_json_header_integer_malformed_value_rejected_case5_malformed_request() {
       16911  +
    #[::tracing_test::traced_test]
       16912  +
    async fn rest_json_path_byte_malformed_value_rejected_case3_malformed_request() {
18503  16913   
        {
18504  16914   
            #[allow(unused_mut)]
18505  16915   
            let mut http_request = http::Request::builder()
18506         -
                .uri("/MalformedInteger/1")
       16916  +
                .uri("/MalformedByte/0x42")
18507  16917   
                .method("POST")
18508         -
                .header("integerInHeader", "-Infinity")
18509  16918   
                .body(::aws_smithy_http_server::body::Body::empty())
18510  16919   
                .unwrap();
18511  16920   
            #[allow(unused_mut)]
18512  16921   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18513  16922   
            let config = crate::service::RestJsonConfig::builder().build();
18514  16923   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18515         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16924  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18516  16925   
                                let sender = sender.clone();
18517  16926   
                                async move {
18518         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16927  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18519  16928   
                                    sender.send(()).await.expect("receiver dropped early");
18520  16929   
                                    result
18521  16930   
                                }
18522  16931   
                            })
18523  16932   
                            .build_unchecked();
18524  16933   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18525  16934   
                .await
18526  16935   
                .expect("unable to make an HTTP request");
18527  16936   
            ::pretty_assertions::assert_eq!(
18528  16937   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18529  16938   
                http_response.status()
18530  16939   
            );
18531  16940   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18532  16941   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18533  16942   
                http_response.headers(),
18534  16943   
                expected_headers,
18535  16944   
            ));
18536  16945   
        }
18537  16946   
    }
18538         -
    /// Malformed values in headers should be rejected
18539         -
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case6
       16947  +
    /// Malformed values in the path should be rejected
       16948  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case4
18540  16949   
    #[::tokio::test]
18541         -
    async fn rest_json_header_integer_malformed_value_rejected_case6_malformed_request() {
       16950  +
    #[::tracing_test::traced_test]
       16951  +
    async fn rest_json_path_byte_malformed_value_rejected_case4_malformed_request() {
18542  16952   
        {
18543  16953   
            #[allow(unused_mut)]
18544  16954   
            let mut http_request = http::Request::builder()
18545         -
                .uri("/MalformedInteger/1")
       16955  +
                .uri("/MalformedByte/Infinity")
18546  16956   
                .method("POST")
18547         -
                .header("integerInHeader", "NaN")
18548  16957   
                .body(::aws_smithy_http_server::body::Body::empty())
18549  16958   
                .unwrap();
18550  16959   
            #[allow(unused_mut)]
18551  16960   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18552  16961   
            let config = crate::service::RestJsonConfig::builder().build();
18553  16962   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18554         -
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
       16963  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18555  16964   
                                let sender = sender.clone();
18556  16965   
                                async move {
18557         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
       16966  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18558  16967   
                                    sender.send(()).await.expect("receiver dropped early");
18559  16968   
                                    result
18560  16969   
                                }
18561  16970   
                            })
18562  16971   
                            .build_unchecked();
18563  16972   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18564  16973   
                .await
18565  16974   
                .expect("unable to make an HTTP request");
18566  16975   
            ::pretty_assertions::assert_eq!(
18567  16976   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18568  16977   
                http_response.status()
18569  16978   
            );
18570  16979   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18571  16980   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18572  16981   
                http_response.headers(),
18573  16982   
                expected_headers,
18574  16983   
            ));
18575  16984   
        }
18576  16985   
    }
18577         -
}
18578         -
#[cfg(test)]
18579         -
#[allow(unreachable_code, unused_variables)]
18580         -
mod server_malformed_list_test {
18581         -
    /// When a dense list contains null, the response should be a 400
18582         -
    /// SerializationException.
18583         -
    /// Test ID: RestJsonBodyMalformedListNullItem
       16986  +
    /// Malformed values in the path should be rejected
       16987  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case5
18584  16988   
    #[::tokio::test]
18585         -
    async fn rest_json_body_malformed_list_null_item_malformed_request() {
       16989  +
    #[::tracing_test::traced_test]
       16990  +
    async fn rest_json_path_byte_malformed_value_rejected_case5_malformed_request() {
18586  16991   
        {
18587  16992   
            #[allow(unused_mut)]
18588  16993   
            let mut http_request = http::Request::builder()
18589         -
                .uri("/MalformedList")
       16994  +
                .uri("/MalformedByte/-Infinity")
18590  16995   
                .method("POST")
18591         -
                .header("content-type", "application/json")
18592         -
                .body(::aws_smithy_http_server::body::Body::from(
18593         -
                    ::bytes::Bytes::from_static(
18594         -
                        "{ \"bodyList\" : [\"a\", null, \"b\", \"c\"] }".as_bytes(),
18595         -
                    ),
18596         -
                ))
       16996  +
                .body(::aws_smithy_http_server::body::Body::empty())
18597  16997   
                .unwrap();
18598  16998   
            #[allow(unused_mut)]
18599  16999   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18600  17000   
            let config = crate::service::RestJsonConfig::builder().build();
18601  17001   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18602         -
                            .malformed_list(move |input: crate::input::MalformedListInput| {
       17002  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18603  17003   
                                let sender = sender.clone();
18604  17004   
                                async move {
18605         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
       17005  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18606  17006   
                                    sender.send(()).await.expect("receiver dropped early");
18607  17007   
                                    result
18608  17008   
                                }
18609  17009   
                            })
18610  17010   
                            .build_unchecked();
18611  17011   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18612  17012   
                .await
18613  17013   
                .expect("unable to make an HTTP request");
18614  17014   
            ::pretty_assertions::assert_eq!(
18615  17015   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18616  17016   
                http_response.status()
18617  17017   
            );
18618  17018   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18619  17019   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18620  17020   
                http_response.headers(),
18621  17021   
                expected_headers,
18622  17022   
            ));
18623  17023   
        }
18624  17024   
    }
18625         -
    /// When a list does not have a closing bracket, the response should be
18626         -
    /// a 400 SerializationException.
18627         -
    /// Test ID: RestJsonBodyMalformedListUnclosed
       17025  +
    /// Malformed values in the path should be rejected
       17026  +
    /// Test ID: RestJsonPathByteMalformedValueRejected_case6
18628  17027   
    #[::tokio::test]
18629         -
    async fn rest_json_body_malformed_list_unclosed_malformed_request() {
       17028  +
    #[::tracing_test::traced_test]
       17029  +
    async fn rest_json_path_byte_malformed_value_rejected_case6_malformed_request() {
18630  17030   
        {
18631  17031   
            #[allow(unused_mut)]
18632  17032   
            let mut http_request = http::Request::builder()
18633         -
                .uri("/MalformedList")
       17033  +
                .uri("/MalformedByte/NaN")
18634  17034   
                .method("POST")
18635         -
                .header("content-type", "application/json")
18636         -
                .body(::aws_smithy_http_server::body::Body::from(
18637         -
                    ::bytes::Bytes::from_static(
18638         -
                        "{ \"bodyList\" : [\"a\", \"b\", \"c\" }".as_bytes(),
18639         -
                    ),
18640         -
                ))
       17035  +
                .body(::aws_smithy_http_server::body::Body::empty())
18641  17036   
                .unwrap();
18642  17037   
            #[allow(unused_mut)]
18643  17038   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18644  17039   
            let config = crate::service::RestJsonConfig::builder().build();
18645  17040   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18646         -
                            .malformed_list(move |input: crate::input::MalformedListInput| {
       17041  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18647  17042   
                                let sender = sender.clone();
18648  17043   
                                async move {
18649         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
       17044  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18650  17045   
                                    sender.send(()).await.expect("receiver dropped early");
18651  17046   
                                    result
18652  17047   
                                }
18653  17048   
                            })
18654  17049   
                            .build_unchecked();
18655  17050   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18656  17051   
                .await
18657  17052   
                .expect("unable to make an HTTP request");
18658  17053   
            ::pretty_assertions::assert_eq!(
18659  17054   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18660  17055   
                http_response.status()
18661  17056   
            );
18662  17057   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18663  17058   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18664  17059   
                http_response.headers(),
18665  17060   
                expected_headers,
18666  17061   
            ));
18667  17062   
        }
18668  17063   
    }
18669         -
}
18670         -
#[cfg(test)]
18671         -
#[allow(unreachable_code, unused_variables)]
18672         -
mod server_malformed_long_test {
18673         -
    /// Underflow or overflow should result in SerializationException
18674         -
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case0
       17064  +
    /// Malformed values in query parameters should be rejected
       17065  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case0
18675  17066   
    #[::tokio::test]
18676         -
    async fn rest_json_body_long_underflow_overflow_case0_malformed_request() {
       17067  +
    #[::tracing_test::traced_test]
       17068  +
    async fn rest_json_query_byte_malformed_value_rejected_case0_malformed_request() {
18677  17069   
        {
18678  17070   
            #[allow(unused_mut)]
18679  17071   
            let mut http_request = http::Request::builder()
18680         -
                .uri("/MalformedLong/1")
       17072  +
                .uri("/MalformedByte/1")
18681  17073   
                .method("POST")
18682         -
                .header("content-type", "application/json")
18683         -
                .body(::aws_smithy_http_server::body::Body::from(
18684         -
                    ::bytes::Bytes::from_static(
18685         -
                        "{ \"longInBody\" : -184467440737095500000 }".as_bytes(),
18686         -
                    ),
18687         -
                ))
       17074  +
                .body(::aws_smithy_http_server::body::Body::empty())
18688  17075   
                .unwrap();
       17076  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=true".parse().unwrap();
18689  17077   
            #[allow(unused_mut)]
18690  17078   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18691  17079   
            let config = crate::service::RestJsonConfig::builder().build();
18692  17080   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18693         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17081  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18694  17082   
                                let sender = sender.clone();
18695  17083   
                                async move {
18696         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17084  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18697  17085   
                                    sender.send(()).await.expect("receiver dropped early");
18698  17086   
                                    result
18699  17087   
                                }
18700  17088   
                            })
18701  17089   
                            .build_unchecked();
18702  17090   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18703  17091   
                .await
18704  17092   
                .expect("unable to make an HTTP request");
18705  17093   
            ::pretty_assertions::assert_eq!(
18706  17094   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18707  17095   
                http_response.status()
18708  17096   
            );
18709  17097   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18710  17098   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18711  17099   
                http_response.headers(),
18712  17100   
                expected_headers,
18713  17101   
            ));
18714  17102   
        }
18715  17103   
    }
18716         -
    /// Underflow or overflow should result in SerializationException
18717         -
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case1
       17104  +
    /// Malformed values in query parameters should be rejected
       17105  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case1
18718  17106   
    #[::tokio::test]
18719         -
    async fn rest_json_body_long_underflow_overflow_case1_malformed_request() {
       17107  +
    #[::tracing_test::traced_test]
       17108  +
    async fn rest_json_query_byte_malformed_value_rejected_case1_malformed_request() {
18720  17109   
        {
18721  17110   
            #[allow(unused_mut)]
18722  17111   
            let mut http_request = http::Request::builder()
18723         -
                .uri("/MalformedLong/1")
       17112  +
                .uri("/MalformedByte/1")
18724  17113   
                .method("POST")
18725         -
                .header("content-type", "application/json")
18726         -
                .body(::aws_smithy_http_server::body::Body::from(
18727         -
                    ::bytes::Bytes::from_static(
18728         -
                        "{ \"longInBody\" : 184467440737095500000 }".as_bytes(),
18729         -
                    ),
18730         -
                ))
       17114  +
                .body(::aws_smithy_http_server::body::Body::empty())
18731  17115   
                .unwrap();
       17116  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=1.001".parse().unwrap();
18732  17117   
            #[allow(unused_mut)]
18733  17118   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18734  17119   
            let config = crate::service::RestJsonConfig::builder().build();
18735  17120   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18736         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17121  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18737  17122   
                                let sender = sender.clone();
18738  17123   
                                async move {
18739         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17124  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18740  17125   
                                    sender.send(()).await.expect("receiver dropped early");
18741  17126   
                                    result
18742  17127   
                                }
18743  17128   
                            })
18744  17129   
                            .build_unchecked();
18745  17130   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18746  17131   
                .await
18747  17132   
                .expect("unable to make an HTTP request");
18748  17133   
            ::pretty_assertions::assert_eq!(
18749  17134   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18750  17135   
                http_response.status()
18751  17136   
            );
18752  17137   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18753  17138   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18754  17139   
                http_response.headers(),
18755  17140   
                expected_headers,
18756  17141   
            ));
18757  17142   
        }
18758  17143   
    }
18759         -
    /// Underflow or overflow should result in SerializationException
18760         -
    /// Test ID: RestJsonBodyLongUnderflowOverflow_case2
       17144  +
    /// Malformed values in query parameters should be rejected
       17145  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case2
18761  17146   
    #[::tokio::test]
18762         -
    async fn rest_json_body_long_underflow_overflow_case2_malformed_request() {
       17147  +
    #[::tracing_test::traced_test]
       17148  +
    async fn rest_json_query_byte_malformed_value_rejected_case2_malformed_request() {
18763  17149   
        {
18764  17150   
            #[allow(unused_mut)]
18765  17151   
            let mut http_request = http::Request::builder()
18766         -
                .uri("/MalformedLong/1")
       17152  +
                .uri("/MalformedByte/1")
18767  17153   
                .method("POST")
18768         -
                .header("content-type", "application/json")
18769         -
                .body(::aws_smithy_http_server::body::Body::from(
18770         -
                    ::bytes::Bytes::from_static(
18771         -
                        "{ \"longInBody\" : 123000000000000000000000 }".as_bytes(),
18772         -
                    ),
18773         -
                ))
       17154  +
                .body(::aws_smithy_http_server::body::Body::empty())
18774  17155   
                .unwrap();
       17156  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=2ABC".parse().unwrap();
18775  17157   
            #[allow(unused_mut)]
18776  17158   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18777  17159   
            let config = crate::service::RestJsonConfig::builder().build();
18778  17160   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18779         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17161  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18780  17162   
                                let sender = sender.clone();
18781  17163   
                                async move {
18782         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17164  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18783  17165   
                                    sender.send(()).await.expect("receiver dropped early");
18784  17166   
                                    result
18785  17167   
                                }
18786  17168   
                            })
18787  17169   
                            .build_unchecked();
18788  17170   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18789  17171   
                .await
18790  17172   
                .expect("unable to make an HTTP request");
18791  17173   
            ::pretty_assertions::assert_eq!(
18792  17174   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18793  17175   
                http_response.status()
18794  17176   
            );
18795  17177   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18796  17178   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18797  17179   
                http_response.headers(),
18798  17180   
                expected_headers,
18799  17181   
            ));
18800  17182   
        }
18801  17183   
    }
18802         -
    /// Underflow or overflow should result in SerializationException
18803         -
    /// Test ID: RestJsonPathLongUnderflowOverflow_case0
       17184  +
    /// Malformed values in query parameters should be rejected
       17185  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case3
18804  17186   
    #[::tokio::test]
18805         -
    async fn rest_json_path_long_underflow_overflow_case0_malformed_request() {
       17187  +
    #[::tracing_test::traced_test]
       17188  +
    async fn rest_json_query_byte_malformed_value_rejected_case3_malformed_request() {
18806  17189   
        {
18807  17190   
            #[allow(unused_mut)]
18808  17191   
            let mut http_request = http::Request::builder()
18809         -
                .uri("/MalformedLong/-184467440737095500000")
       17192  +
                .uri("/MalformedByte/1")
18810  17193   
                .method("POST")
18811  17194   
                .body(::aws_smithy_http_server::body::Body::empty())
18812  17195   
                .unwrap();
       17196  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=0x42".parse().unwrap();
18813  17197   
            #[allow(unused_mut)]
18814  17198   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18815  17199   
            let config = crate::service::RestJsonConfig::builder().build();
18816  17200   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18817         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17201  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18818  17202   
                                let sender = sender.clone();
18819  17203   
                                async move {
18820         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17204  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18821  17205   
                                    sender.send(()).await.expect("receiver dropped early");
18822  17206   
                                    result
18823  17207   
                                }
18824  17208   
                            })
18825  17209   
                            .build_unchecked();
18826  17210   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18827  17211   
                .await
18828  17212   
                .expect("unable to make an HTTP request");
18829  17213   
            ::pretty_assertions::assert_eq!(
18830  17214   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18831  17215   
                http_response.status()
18832  17216   
            );
18833  17217   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18834  17218   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18835  17219   
                http_response.headers(),
18836  17220   
                expected_headers,
18837  17221   
            ));
18838  17222   
        }
18839  17223   
    }
18840         -
    /// Underflow or overflow should result in SerializationException
18841         -
    /// Test ID: RestJsonPathLongUnderflowOverflow_case1
       17224  +
    /// Malformed values in query parameters should be rejected
       17225  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case4
18842  17226   
    #[::tokio::test]
18843         -
    async fn rest_json_path_long_underflow_overflow_case1_malformed_request() {
       17227  +
    #[::tracing_test::traced_test]
       17228  +
    async fn rest_json_query_byte_malformed_value_rejected_case4_malformed_request() {
18844  17229   
        {
18845  17230   
            #[allow(unused_mut)]
18846  17231   
            let mut http_request = http::Request::builder()
18847         -
                .uri("/MalformedLong/184467440737095500000")
       17232  +
                .uri("/MalformedByte/1")
18848  17233   
                .method("POST")
18849  17234   
                .body(::aws_smithy_http_server::body::Body::empty())
18850  17235   
                .unwrap();
       17236  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=Infinity".parse().unwrap();
18851  17237   
            #[allow(unused_mut)]
18852  17238   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18853  17239   
            let config = crate::service::RestJsonConfig::builder().build();
18854  17240   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18855         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17241  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18856  17242   
                                let sender = sender.clone();
18857  17243   
                                async move {
18858         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17244  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18859  17245   
                                    sender.send(()).await.expect("receiver dropped early");
18860  17246   
                                    result
18861  17247   
                                }
18862  17248   
                            })
18863  17249   
                            .build_unchecked();
18864  17250   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18865  17251   
                .await
18866  17252   
                .expect("unable to make an HTTP request");
18867  17253   
            ::pretty_assertions::assert_eq!(
18868  17254   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18869  17255   
                http_response.status()
18870  17256   
            );
18871  17257   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18872  17258   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18873  17259   
                http_response.headers(),
18874  17260   
                expected_headers,
18875  17261   
            ));
18876  17262   
        }
18877  17263   
    }
18878         -
    /// Underflow or overflow should result in SerializationException
18879         -
    /// Test ID: RestJsonPathLongUnderflowOverflow_case2
       17264  +
    /// Malformed values in query parameters should be rejected
       17265  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case5
18880  17266   
    #[::tokio::test]
18881         -
    async fn rest_json_path_long_underflow_overflow_case2_malformed_request() {
       17267  +
    #[::tracing_test::traced_test]
       17268  +
    async fn rest_json_query_byte_malformed_value_rejected_case5_malformed_request() {
18882  17269   
        {
18883  17270   
            #[allow(unused_mut)]
18884  17271   
            let mut http_request = http::Request::builder()
18885         -
                .uri("/MalformedLong/123000000000000000000000")
       17272  +
                .uri("/MalformedByte/1")
18886  17273   
                .method("POST")
18887  17274   
                .body(::aws_smithy_http_server::body::Body::empty())
18888  17275   
                .unwrap();
       17276  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=-Infinity".parse().unwrap();
18889  17277   
            #[allow(unused_mut)]
18890  17278   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18891  17279   
            let config = crate::service::RestJsonConfig::builder().build();
18892  17280   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18893         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17281  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18894  17282   
                                let sender = sender.clone();
18895  17283   
                                async move {
18896         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17284  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18897  17285   
                                    sender.send(()).await.expect("receiver dropped early");
18898  17286   
                                    result
18899  17287   
                                }
18900  17288   
                            })
18901  17289   
                            .build_unchecked();
18902  17290   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18903  17291   
                .await
18904  17292   
                .expect("unable to make an HTTP request");
18905  17293   
            ::pretty_assertions::assert_eq!(
18906  17294   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18907  17295   
                http_response.status()
18908  17296   
            );
18909  17297   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18910  17298   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18911  17299   
                http_response.headers(),
18912  17300   
                expected_headers,
18913  17301   
            ));
18914  17302   
        }
18915  17303   
    }
18916         -
    /// Underflow or overflow should result in SerializationException
18917         -
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case0
       17304  +
    /// Malformed values in query parameters should be rejected
       17305  +
    /// Test ID: RestJsonQueryByteMalformedValueRejected_case6
18918  17306   
    #[::tokio::test]
18919         -
    async fn rest_json_query_long_underflow_overflow_case0_malformed_request() {
       17307  +
    #[::tracing_test::traced_test]
       17308  +
    async fn rest_json_query_byte_malformed_value_rejected_case6_malformed_request() {
18920  17309   
        {
18921  17310   
            #[allow(unused_mut)]
18922  17311   
            let mut http_request = http::Request::builder()
18923         -
                .uri("/MalformedLong/1")
       17312  +
                .uri("/MalformedByte/1")
18924  17313   
                .method("POST")
18925  17314   
                .body(::aws_smithy_http_server::body::Body::empty())
18926  17315   
                .unwrap();
18927         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-184467440737095500000"
18928         -
                .parse()
18929         -
                .unwrap();
       17316  +
            *http_request.uri_mut() = "/MalformedByte/1?byteInQuery=NaN".parse().unwrap();
18930  17317   
            #[allow(unused_mut)]
18931  17318   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18932  17319   
            let config = crate::service::RestJsonConfig::builder().build();
18933  17320   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18934         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17321  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18935  17322   
                                let sender = sender.clone();
18936  17323   
                                async move {
18937         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17324  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18938  17325   
                                    sender.send(()).await.expect("receiver dropped early");
18939  17326   
                                    result
18940  17327   
                                }
18941  17328   
                            })
18942  17329   
                            .build_unchecked();
18943  17330   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18944  17331   
                .await
18945  17332   
                .expect("unable to make an HTTP request");
18946  17333   
            ::pretty_assertions::assert_eq!(
18947  17334   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18948  17335   
                http_response.status()
18949  17336   
            );
18950  17337   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18951  17338   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18952  17339   
                http_response.headers(),
18953  17340   
                expected_headers,
18954  17341   
            ));
18955  17342   
        }
18956  17343   
    }
18957         -
    /// Underflow or overflow should result in SerializationException
18958         -
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case1
       17344  +
    /// Malformed values in headers should be rejected
       17345  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case0
18959  17346   
    #[::tokio::test]
18960         -
    async fn rest_json_query_long_underflow_overflow_case1_malformed_request() {
       17347  +
    #[::tracing_test::traced_test]
       17348  +
    async fn rest_json_header_byte_malformed_value_rejected_case0_malformed_request() {
18961  17349   
        {
18962  17350   
            #[allow(unused_mut)]
18963  17351   
            let mut http_request = http::Request::builder()
18964         -
                .uri("/MalformedLong/1")
       17352  +
                .uri("/MalformedByte/1")
18965  17353   
                .method("POST")
       17354  +
                .header("byteInHeader", "true")
18966  17355   
                .body(::aws_smithy_http_server::body::Body::empty())
18967  17356   
                .unwrap();
18968         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=184467440737095500000"
18969         -
                .parse()
18970         -
                .unwrap();
18971  17357   
            #[allow(unused_mut)]
18972  17358   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
18973  17359   
            let config = crate::service::RestJsonConfig::builder().build();
18974  17360   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
18975         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17361  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
18976  17362   
                                let sender = sender.clone();
18977  17363   
                                async move {
18978         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17364  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
18979  17365   
                                    sender.send(()).await.expect("receiver dropped early");
18980  17366   
                                    result
18981  17367   
                                }
18982  17368   
                            })
18983  17369   
                            .build_unchecked();
18984  17370   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
18985  17371   
                .await
18986  17372   
                .expect("unable to make an HTTP request");
18987  17373   
            ::pretty_assertions::assert_eq!(
18988  17374   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
18989  17375   
                http_response.status()
18990  17376   
            );
18991  17377   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
18992  17378   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
18993  17379   
                http_response.headers(),
18994  17380   
                expected_headers,
18995  17381   
            ));
18996  17382   
        }
18997  17383   
    }
18998         -
    /// Underflow or overflow should result in SerializationException
18999         -
    /// Test ID: RestJsonQueryLongUnderflowOverflow_case2
       17384  +
    /// Malformed values in headers should be rejected
       17385  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case1
19000  17386   
    #[::tokio::test]
19001         -
    async fn rest_json_query_long_underflow_overflow_case2_malformed_request() {
       17387  +
    #[::tracing_test::traced_test]
       17388  +
    async fn rest_json_header_byte_malformed_value_rejected_case1_malformed_request() {
19002  17389   
        {
19003  17390   
            #[allow(unused_mut)]
19004  17391   
            let mut http_request = http::Request::builder()
19005         -
                .uri("/MalformedLong/1")
       17392  +
                .uri("/MalformedByte/1")
19006  17393   
                .method("POST")
       17394  +
                .header("byteInHeader", "1.001")
19007  17395   
                .body(::aws_smithy_http_server::body::Body::empty())
19008  17396   
                .unwrap();
19009         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=123000000000000000000000"
19010         -
                .parse()
19011         -
                .unwrap();
19012  17397   
            #[allow(unused_mut)]
19013  17398   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19014  17399   
            let config = crate::service::RestJsonConfig::builder().build();
19015  17400   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19016         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17401  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
19017  17402   
                                let sender = sender.clone();
19018  17403   
                                async move {
19019         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17404  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
19020  17405   
                                    sender.send(()).await.expect("receiver dropped early");
19021  17406   
                                    result
19022  17407   
                                }
19023  17408   
                            })
19024  17409   
                            .build_unchecked();
19025  17410   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19026  17411   
                .await
19027  17412   
                .expect("unable to make an HTTP request");
19028  17413   
            ::pretty_assertions::assert_eq!(
19029  17414   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19030  17415   
                http_response.status()
19031  17416   
            );
19032  17417   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19033  17418   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19034  17419   
                http_response.headers(),
19035  17420   
                expected_headers,
19036  17421   
            ));
19037  17422   
        }
19038  17423   
    }
19039         -
    /// Underflow or overflow should result in SerializationException
19040         -
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case0
       17424  +
    /// Malformed values in headers should be rejected
       17425  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case2
19041  17426   
    #[::tokio::test]
19042         -
    async fn rest_json_header_long_underflow_overflow_case0_malformed_request() {
       17427  +
    #[::tracing_test::traced_test]
       17428  +
    async fn rest_json_header_byte_malformed_value_rejected_case2_malformed_request() {
19043  17429   
        {
19044  17430   
            #[allow(unused_mut)]
19045  17431   
            let mut http_request = http::Request::builder()
19046         -
                .uri("/MalformedLong/1")
       17432  +
                .uri("/MalformedByte/1")
19047  17433   
                .method("POST")
19048         -
                .header("longInHeader", "-184467440737095500000")
       17434  +
                .header("byteInHeader", "2ABC")
19049  17435   
                .body(::aws_smithy_http_server::body::Body::empty())
19050  17436   
                .unwrap();
19051  17437   
            #[allow(unused_mut)]
19052  17438   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19053  17439   
            let config = crate::service::RestJsonConfig::builder().build();
19054  17440   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19055         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17441  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
19056  17442   
                                let sender = sender.clone();
19057  17443   
                                async move {
19058         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17444  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
19059  17445   
                                    sender.send(()).await.expect("receiver dropped early");
19060  17446   
                                    result
19061  17447   
                                }
19062  17448   
                            })
19063  17449   
                            .build_unchecked();
19064  17450   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19065  17451   
                .await
19066  17452   
                .expect("unable to make an HTTP request");
19067  17453   
            ::pretty_assertions::assert_eq!(
19068  17454   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19069  17455   
                http_response.status()
19070  17456   
            );
19071  17457   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19072  17458   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19073  17459   
                http_response.headers(),
19074  17460   
                expected_headers,
19075  17461   
            ));
19076  17462   
        }
19077  17463   
    }
19078         -
    /// Underflow or overflow should result in SerializationException
19079         -
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case1
       17464  +
    /// Malformed values in headers should be rejected
       17465  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case3
19080  17466   
    #[::tokio::test]
19081         -
    async fn rest_json_header_long_underflow_overflow_case1_malformed_request() {
       17467  +
    #[::tracing_test::traced_test]
       17468  +
    async fn rest_json_header_byte_malformed_value_rejected_case3_malformed_request() {
19082  17469   
        {
19083  17470   
            #[allow(unused_mut)]
19084  17471   
            let mut http_request = http::Request::builder()
19085         -
                .uri("/MalformedLong/1")
       17472  +
                .uri("/MalformedByte/1")
19086  17473   
                .method("POST")
19087         -
                .header("longInHeader", "184467440737095500000")
       17474  +
                .header("byteInHeader", "0x42")
19088  17475   
                .body(::aws_smithy_http_server::body::Body::empty())
19089  17476   
                .unwrap();
19090  17477   
            #[allow(unused_mut)]
19091  17478   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19092  17479   
            let config = crate::service::RestJsonConfig::builder().build();
19093  17480   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19094         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17481  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
19095  17482   
                                let sender = sender.clone();
19096  17483   
                                async move {
19097         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17484  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
19098  17485   
                                    sender.send(()).await.expect("receiver dropped early");
19099  17486   
                                    result
19100  17487   
                                }
19101  17488   
                            })
19102  17489   
                            .build_unchecked();
19103  17490   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19104  17491   
                .await
19105  17492   
                .expect("unable to make an HTTP request");
19106  17493   
            ::pretty_assertions::assert_eq!(
19107  17494   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19108  17495   
                http_response.status()
19109  17496   
            );
19110  17497   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19111  17498   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19112  17499   
                http_response.headers(),
19113  17500   
                expected_headers,
19114  17501   
            ));
19115  17502   
        }
19116  17503   
    }
19117         -
    /// Underflow or overflow should result in SerializationException
19118         -
    /// Test ID: RestJsonHeaderLongUnderflowOverflow_case2
       17504  +
    /// Malformed values in headers should be rejected
       17505  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case4
19119  17506   
    #[::tokio::test]
19120         -
    async fn rest_json_header_long_underflow_overflow_case2_malformed_request() {
       17507  +
    #[::tracing_test::traced_test]
       17508  +
    async fn rest_json_header_byte_malformed_value_rejected_case4_malformed_request() {
19121  17509   
        {
19122  17510   
            #[allow(unused_mut)]
19123  17511   
            let mut http_request = http::Request::builder()
19124         -
                .uri("/MalformedLong/1")
       17512  +
                .uri("/MalformedByte/1")
19125  17513   
                .method("POST")
19126         -
                .header("longInHeader", "123000000000000000000000")
       17514  +
                .header("byteInHeader", "Infinity")
19127  17515   
                .body(::aws_smithy_http_server::body::Body::empty())
19128  17516   
                .unwrap();
19129  17517   
            #[allow(unused_mut)]
19130  17518   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19131  17519   
            let config = crate::service::RestJsonConfig::builder().build();
19132  17520   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19133         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17521  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
19134  17522   
                                let sender = sender.clone();
19135  17523   
                                async move {
19136         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17524  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
19137  17525   
                                    sender.send(()).await.expect("receiver dropped early");
19138  17526   
                                    result
19139  17527   
                                }
19140  17528   
                            })
19141  17529   
                            .build_unchecked();
19142  17530   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19143  17531   
                .await
19144  17532   
                .expect("unable to make an HTTP request");
19145  17533   
            ::pretty_assertions::assert_eq!(
19146  17534   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19147  17535   
                http_response.status()
19148  17536   
            );
19149  17537   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19150  17538   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19151  17539   
                http_response.headers(),
19152  17540   
                expected_headers,
19153  17541   
            ));
19154  17542   
        }
19155  17543   
    }
19156         -
    /// Malformed values in the body should be rejected
19157         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case0
       17544  +
    /// Malformed values in headers should be rejected
       17545  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case5
19158  17546   
    #[::tokio::test]
19159         -
    async fn rest_json_body_long_malformed_value_rejected_case0_malformed_request() {
       17547  +
    #[::tracing_test::traced_test]
       17548  +
    async fn rest_json_header_byte_malformed_value_rejected_case5_malformed_request() {
19160  17549   
        {
19161  17550   
            #[allow(unused_mut)]
19162  17551   
            let mut http_request = http::Request::builder()
19163         -
                .uri("/MalformedLong/1")
       17552  +
                .uri("/MalformedByte/1")
19164  17553   
                .method("POST")
19165         -
                .header("content-type", "application/json")
19166         -
                .body(::aws_smithy_http_server::body::Body::from(
19167         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"123\" }".as_bytes()),
19168         -
                ))
       17554  +
                .header("byteInHeader", "-Infinity")
       17555  +
                .body(::aws_smithy_http_server::body::Body::empty())
19169  17556   
                .unwrap();
19170  17557   
            #[allow(unused_mut)]
19171  17558   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19172  17559   
            let config = crate::service::RestJsonConfig::builder().build();
19173  17560   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19174         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17561  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
19175  17562   
                                let sender = sender.clone();
19176  17563   
                                async move {
19177         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17564  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
19178  17565   
                                    sender.send(()).await.expect("receiver dropped early");
19179  17566   
                                    result
19180  17567   
                                }
19181  17568   
                            })
19182  17569   
                            .build_unchecked();
19183  17570   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19184  17571   
                .await
19185  17572   
                .expect("unable to make an HTTP request");
19186  17573   
            ::pretty_assertions::assert_eq!(
19187  17574   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19188  17575   
                http_response.status()
19189  17576   
            );
19190  17577   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19191  17578   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19192  17579   
                http_response.headers(),
19193  17580   
                expected_headers,
19194  17581   
            ));
19195  17582   
        }
19196  17583   
    }
19197         -
    /// Malformed values in the body should be rejected
19198         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case1
       17584  +
    /// Malformed values in headers should be rejected
       17585  +
    /// Test ID: RestJsonHeaderByteMalformedValueRejected_case6
19199  17586   
    #[::tokio::test]
19200         -
    async fn rest_json_body_long_malformed_value_rejected_case1_malformed_request() {
       17587  +
    #[::tracing_test::traced_test]
       17588  +
    async fn rest_json_header_byte_malformed_value_rejected_case6_malformed_request() {
19201  17589   
        {
19202  17590   
            #[allow(unused_mut)]
19203  17591   
            let mut http_request = http::Request::builder()
19204         -
                .uri("/MalformedLong/1")
       17592  +
                .uri("/MalformedByte/1")
19205  17593   
                .method("POST")
19206         -
                .header("content-type", "application/json")
19207         -
                .body(::aws_smithy_http_server::body::Body::from(
19208         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : true }".as_bytes()),
19209         -
                ))
       17594  +
                .header("byteInHeader", "NaN")
       17595  +
                .body(::aws_smithy_http_server::body::Body::empty())
19210  17596   
                .unwrap();
19211  17597   
            #[allow(unused_mut)]
19212  17598   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19213  17599   
            let config = crate::service::RestJsonConfig::builder().build();
19214  17600   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19215         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17601  +
                            .malformed_byte(move |input: crate::input::MalformedByteInput| {
19216  17602   
                                let sender = sender.clone();
19217  17603   
                                async move {
19218         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17604  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedByteOutput, crate::error::MalformedByteError> };
19219  17605   
                                    sender.send(()).await.expect("receiver dropped early");
19220  17606   
                                    result
19221  17607   
                                }
19222  17608   
                            })
19223  17609   
                            .build_unchecked();
19224  17610   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19225  17611   
                .await
19226  17612   
                .expect("unable to make an HTTP request");
19227  17613   
            ::pretty_assertions::assert_eq!(
19228  17614   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19229  17615   
                http_response.status()
19230  17616   
            );
19231  17617   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19232  17618   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19233  17619   
                http_response.headers(),
19234  17620   
                expected_headers,
19235  17621   
            ));
19236  17622   
        }
19237  17623   
    }
19238         -
    /// Malformed values in the body should be rejected
19239         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case2
       17624  +
}
       17625  +
       17626  +
const CONTENT_TYPE_MALFORMEDBLOB: ::mime::Mime = ::mime::APPLICATION_JSON;
       17627  +
::pin_project_lite::pin_project! {
       17628  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       17629  +
    /// [`MalformedBlobInput`](crate::input::MalformedBlobInput) using modelled bindings.
       17630  +
    pub struct MalformedBlobInputFuture {
       17631  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedBlobInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       17632  +
    }
       17633  +
}
       17634  +
       17635  +
impl std::future::Future for MalformedBlobInputFuture {
       17636  +
    type Output = Result<
       17637  +
        crate::input::MalformedBlobInput,
       17638  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       17639  +
    >;
       17640  +
       17641  +
    fn poll(
       17642  +
        self: std::pin::Pin<&mut Self>,
       17643  +
        cx: &mut std::task::Context<'_>,
       17644  +
    ) -> std::task::Poll<Self::Output> {
       17645  +
        let this = self.project();
       17646  +
        this.inner.as_mut().poll(cx)
       17647  +
    }
       17648  +
}
       17649  +
       17650  +
impl<B>
       17651  +
    ::aws_smithy_http_server::request::FromRequest<
       17652  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       17653  +
        B,
       17654  +
    > for crate::input::MalformedBlobInput
       17655  +
where
       17656  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       17657  +
    B: 'static,
       17658  +
       17659  +
    B::Data: Send,
       17660  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       17661  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       17662  +
{
       17663  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       17664  +
    type Future = MalformedBlobInputFuture;
       17665  +
       17666  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       17667  +
        let fut = async move {
       17668  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       17669  +
                request.headers(),
       17670  +
                &CONTENT_TYPE_MALFORMEDBLOB,
       17671  +
            ) {
       17672  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       17673  +
            }
       17674  +
            crate::protocol_serde::shape_malformed_blob::de_malformed_blob_http_request(request)
       17675  +
                .await
       17676  +
                .map_err(Into::into)
       17677  +
        };
       17678  +
        use ::futures_util::future::TryFutureExt;
       17679  +
        let fut = fut.map_err(
       17680  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       17681  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       17682  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       17683  +
                    e,
       17684  +
                )
       17685  +
            },
       17686  +
        );
       17687  +
        MalformedBlobInputFuture {
       17688  +
            inner: Box::pin(fut),
       17689  +
        }
       17690  +
    }
       17691  +
}
       17692  +
impl
       17693  +
    ::aws_smithy_http_server::response::IntoResponse<
       17694  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       17695  +
    > for crate::output::MalformedBlobOutput
       17696  +
{
       17697  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       17698  +
        match crate::protocol_serde::shape_malformed_blob::ser_malformed_blob_http_response(self) {
       17699  +
            Ok(response) => response,
       17700  +
            Err(e) => {
       17701  +
                ::tracing::error!(error = %e, "failed to serialize response");
       17702  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       17703  +
            }
       17704  +
        }
       17705  +
    }
       17706  +
}
       17707  +
       17708  +
#[allow(unreachable_code, unused_variables)]
       17709  +
#[cfg(test)]
       17710  +
mod malformed_blob_test {
       17711  +
       17712  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       17713  +
    /// all, the response should be a 400 SerializationException.
       17714  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case0
19240  17715   
    #[::tokio::test]
19241         -
    async fn rest_json_body_long_malformed_value_rejected_case2_malformed_request() {
       17716  +
    #[::tracing_test::traced_test]
       17717  +
    async fn rest_json_body_malformed_blob_invalid_base64_case0_malformed_request() {
19242  17718   
        {
19243  17719   
            #[allow(unused_mut)]
19244  17720   
            let mut http_request = http::Request::builder()
19245         -
                .uri("/MalformedLong/1")
       17721  +
                .uri("/MalformedBlob")
19246  17722   
                .method("POST")
19247  17723   
                .header("content-type", "application/json")
19248  17724   
                .body(::aws_smithy_http_server::body::Body::from(
19249         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 1.001 }".as_bytes()),
       17725  +
                    ::bytes::Bytes::from_static("{ \"blob\" : blob }".as_bytes()),
19250  17726   
                ))
19251  17727   
                .unwrap();
19252  17728   
            #[allow(unused_mut)]
19253  17729   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19254  17730   
            let config = crate::service::RestJsonConfig::builder().build();
19255  17731   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19256         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17732  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19257  17733   
                                let sender = sender.clone();
19258  17734   
                                async move {
19259         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17735  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19260  17736   
                                    sender.send(()).await.expect("receiver dropped early");
19261  17737   
                                    result
19262  17738   
                                }
19263  17739   
                            })
19264  17740   
                            .build_unchecked();
19265  17741   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19266  17742   
                .await
19267  17743   
                .expect("unable to make an HTTP request");
19268  17744   
            ::pretty_assertions::assert_eq!(
19269  17745   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19270  17746   
                http_response.status()
19271  17747   
            );
19272  17748   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19273  17749   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19274  17750   
                http_response.headers(),
19275  17751   
                expected_headers,
19276  17752   
            ));
19277  17753   
        }
19278  17754   
    }
19279         -
    /// Malformed values in the body should be rejected
19280         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case3
       17755  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       17756  +
    /// all, the response should be a 400 SerializationException.
       17757  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case1
19281  17758   
    #[::tokio::test]
19282         -
    async fn rest_json_body_long_malformed_value_rejected_case3_malformed_request() {
       17759  +
    #[::tracing_test::traced_test]
       17760  +
    async fn rest_json_body_malformed_blob_invalid_base64_case1_malformed_request() {
19283  17761   
        {
19284  17762   
            #[allow(unused_mut)]
19285  17763   
            let mut http_request = http::Request::builder()
19286         -
                .uri("/MalformedLong/1")
       17764  +
                .uri("/MalformedBlob")
19287  17765   
                .method("POST")
19288  17766   
                .header("content-type", "application/json")
19289  17767   
                .body(::aws_smithy_http_server::body::Body::from(
19290         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 2ABC }".as_bytes()),
       17768  +
                    ::bytes::Bytes::from_static("{ \"blob\" : \"xyz\" }".as_bytes()),
19291  17769   
                ))
19292  17770   
                .unwrap();
19293  17771   
            #[allow(unused_mut)]
19294  17772   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19295  17773   
            let config = crate::service::RestJsonConfig::builder().build();
19296  17774   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19297         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17775  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19298  17776   
                                let sender = sender.clone();
19299  17777   
                                async move {
19300         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17778  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19301  17779   
                                    sender.send(()).await.expect("receiver dropped early");
19302  17780   
                                    result
19303  17781   
                                }
19304  17782   
                            })
19305  17783   
                            .build_unchecked();
19306  17784   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19307  17785   
                .await
19308  17786   
                .expect("unable to make an HTTP request");
19309  17787   
            ::pretty_assertions::assert_eq!(
19310  17788   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19311  17789   
                http_response.status()
19312  17790   
            );
19313  17791   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19314  17792   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19315  17793   
                http_response.headers(),
19316  17794   
                expected_headers,
19317  17795   
            ));
19318  17796   
        }
19319  17797   
    }
19320         -
    /// Malformed values in the body should be rejected
19321         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case4
       17798  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       17799  +
    /// all, the response should be a 400 SerializationException.
       17800  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case2
19322  17801   
    #[::tokio::test]
19323         -
    async fn rest_json_body_long_malformed_value_rejected_case4_malformed_request() {
       17802  +
    #[::tracing_test::traced_test]
       17803  +
    async fn rest_json_body_malformed_blob_invalid_base64_case2_malformed_request() {
19324  17804   
        {
19325  17805   
            #[allow(unused_mut)]
19326  17806   
            let mut http_request = http::Request::builder()
19327         -
                .uri("/MalformedLong/1")
       17807  +
                .uri("/MalformedBlob")
19328  17808   
                .method("POST")
19329  17809   
                .header("content-type", "application/json")
19330  17810   
                .body(::aws_smithy_http_server::body::Body::from(
19331         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : 0x42 }".as_bytes()),
       17811  +
                    ::bytes::Bytes::from_static("{ \"blob\" : \"YmxvYg=\" }".as_bytes()),
19332  17812   
                ))
19333  17813   
                .unwrap();
19334  17814   
            #[allow(unused_mut)]
19335  17815   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19336  17816   
            let config = crate::service::RestJsonConfig::builder().build();
19337  17817   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19338         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17818  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19339  17819   
                                let sender = sender.clone();
19340  17820   
                                async move {
19341         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17821  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19342  17822   
                                    sender.send(()).await.expect("receiver dropped early");
19343  17823   
                                    result
19344  17824   
                                }
19345  17825   
                            })
19346  17826   
                            .build_unchecked();
19347  17827   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19348  17828   
                .await
19349  17829   
                .expect("unable to make an HTTP request");
19350  17830   
            ::pretty_assertions::assert_eq!(
19351  17831   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19352  17832   
                http_response.status()
19353  17833   
            );
19354  17834   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19355  17835   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19356  17836   
                http_response.headers(),
19357  17837   
                expected_headers,
19358  17838   
            ));
19359  17839   
        }
19360  17840   
    }
19361         -
    /// Malformed values in the body should be rejected
19362         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case5
       17841  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       17842  +
    /// all, the response should be a 400 SerializationException.
       17843  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case3
19363  17844   
    #[::tokio::test]
19364         -
    async fn rest_json_body_long_malformed_value_rejected_case5_malformed_request() {
       17845  +
    #[::tracing_test::traced_test]
       17846  +
    async fn rest_json_body_malformed_blob_invalid_base64_case3_malformed_request() {
19365  17847   
        {
19366  17848   
            #[allow(unused_mut)]
19367  17849   
            let mut http_request = http::Request::builder()
19368         -
                .uri("/MalformedLong/1")
       17850  +
                .uri("/MalformedBlob")
19369  17851   
                .method("POST")
19370  17852   
                .header("content-type", "application/json")
19371  17853   
                .body(::aws_smithy_http_server::body::Body::from(
19372         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : Infinity }".as_bytes()),
       17854  +
                    ::bytes::Bytes::from_static("{ \"blob\" : [98, 108, 11, 98] }".as_bytes()),
19373  17855   
                ))
19374  17856   
                .unwrap();
19375  17857   
            #[allow(unused_mut)]
19376  17858   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19377  17859   
            let config = crate::service::RestJsonConfig::builder().build();
19378  17860   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19379         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17861  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19380  17862   
                                let sender = sender.clone();
19381  17863   
                                async move {
19382         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17864  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19383  17865   
                                    sender.send(()).await.expect("receiver dropped early");
19384  17866   
                                    result
19385  17867   
                                }
19386  17868   
                            })
19387  17869   
                            .build_unchecked();
19388  17870   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19389  17871   
                .await
19390  17872   
                .expect("unable to make an HTTP request");
19391  17873   
            ::pretty_assertions::assert_eq!(
19392  17874   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19393  17875   
                http_response.status()
19394  17876   
            );
19395  17877   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19396  17878   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19397  17879   
                http_response.headers(),
19398  17880   
                expected_headers,
19399  17881   
            ));
19400  17882   
        }
19401  17883   
    }
19402         -
    /// Malformed values in the body should be rejected
19403         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case6
       17884  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       17885  +
    /// all, the response should be a 400 SerializationException.
       17886  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case4
19404  17887   
    #[::tokio::test]
19405         -
    async fn rest_json_body_long_malformed_value_rejected_case6_malformed_request() {
       17888  +
    #[::tracing_test::traced_test]
       17889  +
    async fn rest_json_body_malformed_blob_invalid_base64_case4_malformed_request() {
19406  17890   
        {
19407  17891   
            #[allow(unused_mut)]
19408  17892   
            let mut http_request = http::Request::builder()
19409         -
                .uri("/MalformedLong/1")
       17893  +
                .uri("/MalformedBlob")
19410  17894   
                .method("POST")
19411  17895   
                .header("content-type", "application/json")
19412  17896   
                .body(::aws_smithy_http_server::body::Body::from(
19413         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"Infinity\" }".as_bytes()),
       17897  +
                    ::bytes::Bytes::from_static(
       17898  +
                        "{ \"blob\" : [\"b\", \"l\",\"o\",\"b\"] }".as_bytes(),
       17899  +
                    ),
19414  17900   
                ))
19415  17901   
                .unwrap();
19416  17902   
            #[allow(unused_mut)]
19417  17903   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19418  17904   
            let config = crate::service::RestJsonConfig::builder().build();
19419  17905   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19420         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17906  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19421  17907   
                                let sender = sender.clone();
19422  17908   
                                async move {
19423         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17909  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19424  17910   
                                    sender.send(()).await.expect("receiver dropped early");
19425  17911   
                                    result
19426  17912   
                                }
19427  17913   
                            })
19428  17914   
                            .build_unchecked();
19429  17915   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19430  17916   
                .await
19431  17917   
                .expect("unable to make an HTTP request");
19432  17918   
            ::pretty_assertions::assert_eq!(
19433  17919   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19434  17920   
                http_response.status()
19435  17921   
            );
19436  17922   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19437  17923   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19438  17924   
                http_response.headers(),
19439  17925   
                expected_headers,
19440  17926   
            ));
19441  17927   
        }
19442  17928   
    }
19443         -
    /// Malformed values in the body should be rejected
19444         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case7
       17929  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       17930  +
    /// all, the response should be a 400 SerializationException.
       17931  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case5
19445  17932   
    #[::tokio::test]
19446         -
    async fn rest_json_body_long_malformed_value_rejected_case7_malformed_request() {
       17933  +
    #[::tracing_test::traced_test]
       17934  +
    async fn rest_json_body_malformed_blob_invalid_base64_case5_malformed_request() {
19447  17935   
        {
19448  17936   
            #[allow(unused_mut)]
19449  17937   
            let mut http_request = http::Request::builder()
19450         -
                .uri("/MalformedLong/1")
       17938  +
                .uri("/MalformedBlob")
19451  17939   
                .method("POST")
19452  17940   
                .header("content-type", "application/json")
19453  17941   
                .body(::aws_smithy_http_server::body::Body::from(
19454         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : -Infinity }".as_bytes()),
       17942  +
                    ::bytes::Bytes::from_static("{ \"blob\" : 981081198 }".as_bytes()),
19455  17943   
                ))
19456  17944   
                .unwrap();
19457  17945   
            #[allow(unused_mut)]
19458  17946   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19459  17947   
            let config = crate::service::RestJsonConfig::builder().build();
19460  17948   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19461         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17949  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19462  17950   
                                let sender = sender.clone();
19463  17951   
                                async move {
19464         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17952  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19465  17953   
                                    sender.send(()).await.expect("receiver dropped early");
19466  17954   
                                    result
19467  17955   
                                }
19468  17956   
                            })
19469  17957   
                            .build_unchecked();
19470  17958   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19471  17959   
                .await
19472  17960   
                .expect("unable to make an HTTP request");
19473  17961   
            ::pretty_assertions::assert_eq!(
19474  17962   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19475  17963   
                http_response.status()
19476  17964   
            );
19477  17965   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19478  17966   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19479  17967   
                http_response.headers(),
19480  17968   
                expected_headers,
19481  17969   
            ));
19482  17970   
        }
19483  17971   
    }
19484         -
    /// Malformed values in the body should be rejected
19485         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case8
       17972  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       17973  +
    /// all, the response should be a 400 SerializationException.
       17974  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case6
19486  17975   
    #[::tokio::test]
19487         -
    async fn rest_json_body_long_malformed_value_rejected_case8_malformed_request() {
       17976  +
    #[::tracing_test::traced_test]
       17977  +
    async fn rest_json_body_malformed_blob_invalid_base64_case6_malformed_request() {
19488  17978   
        {
19489  17979   
            #[allow(unused_mut)]
19490  17980   
            let mut http_request = http::Request::builder()
19491         -
                .uri("/MalformedLong/1")
       17981  +
                .uri("/MalformedBlob")
19492  17982   
                .method("POST")
19493  17983   
                .header("content-type", "application/json")
19494  17984   
                .body(::aws_smithy_http_server::body::Body::from(
19495         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"-Infinity\" }".as_bytes()),
       17985  +
                    ::bytes::Bytes::from_static("{ \"blob\" : true }".as_bytes()),
19496  17986   
                ))
19497  17987   
                .unwrap();
19498  17988   
            #[allow(unused_mut)]
19499  17989   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19500  17990   
            let config = crate::service::RestJsonConfig::builder().build();
19501  17991   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19502         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       17992  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19503  17993   
                                let sender = sender.clone();
19504  17994   
                                async move {
19505         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       17995  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19506  17996   
                                    sender.send(()).await.expect("receiver dropped early");
19507  17997   
                                    result
19508  17998   
                                }
19509  17999   
                            })
19510  18000   
                            .build_unchecked();
19511  18001   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19512  18002   
                .await
19513  18003   
                .expect("unable to make an HTTP request");
19514  18004   
            ::pretty_assertions::assert_eq!(
19515  18005   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19516  18006   
                http_response.status()
19517  18007   
            );
19518  18008   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19519  18009   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19520  18010   
                http_response.headers(),
19521  18011   
                expected_headers,
19522  18012   
            ));
19523  18013   
        }
19524  18014   
    }
19525         -
    /// Malformed values in the body should be rejected
19526         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case9
       18015  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       18016  +
    /// all, the response should be a 400 SerializationException.
       18017  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case7
19527  18018   
    #[::tokio::test]
19528         -
    async fn rest_json_body_long_malformed_value_rejected_case9_malformed_request() {
       18019  +
    #[::tracing_test::traced_test]
       18020  +
    async fn rest_json_body_malformed_blob_invalid_base64_case7_malformed_request() {
19529  18021   
        {
19530  18022   
            #[allow(unused_mut)]
19531  18023   
            let mut http_request = http::Request::builder()
19532         -
                .uri("/MalformedLong/1")
       18024  +
                .uri("/MalformedBlob")
19533  18025   
                .method("POST")
19534  18026   
                .header("content-type", "application/json")
19535  18027   
                .body(::aws_smithy_http_server::body::Body::from(
19536         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : NaN }".as_bytes()),
       18028  +
                    ::bytes::Bytes::from_static("{ \"blob\" : [][] }".as_bytes()),
19537  18029   
                ))
19538  18030   
                .unwrap();
19539  18031   
            #[allow(unused_mut)]
19540  18032   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19541  18033   
            let config = crate::service::RestJsonConfig::builder().build();
19542  18034   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19543         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18035  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19544  18036   
                                let sender = sender.clone();
19545  18037   
                                async move {
19546         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18038  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19547  18039   
                                    sender.send(()).await.expect("receiver dropped early");
19548  18040   
                                    result
19549  18041   
                                }
19550  18042   
                            })
19551  18043   
                            .build_unchecked();
19552  18044   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19553  18045   
                .await
19554  18046   
                .expect("unable to make an HTTP request");
19555  18047   
            ::pretty_assertions::assert_eq!(
19556  18048   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19557  18049   
                http_response.status()
19558  18050   
            );
19559  18051   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19560  18052   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19561  18053   
                http_response.headers(),
19562  18054   
                expected_headers,
19563  18055   
            ));
19564  18056   
        }
19565  18057   
    }
19566         -
    /// Malformed values in the body should be rejected
19567         -
    /// Test ID: RestJsonBodyLongMalformedValueRejected_case10
       18058  +
    /// When a blob member is not properly base64 encoded, or not encoded at
       18059  +
    /// all, the response should be a 400 SerializationException.
       18060  +
    /// Test ID: RestJsonBodyMalformedBlobInvalidBase64_case8
19568  18061   
    #[::tokio::test]
19569         -
    async fn rest_json_body_long_malformed_value_rejected_case10_malformed_request() {
       18062  +
    #[::tracing_test::traced_test]
       18063  +
    async fn rest_json_body_malformed_blob_invalid_base64_case8_malformed_request() {
19570  18064   
        {
19571  18065   
            #[allow(unused_mut)]
19572  18066   
            let mut http_request = http::Request::builder()
19573         -
                .uri("/MalformedLong/1")
       18067  +
                .uri("/MalformedBlob")
19574  18068   
                .method("POST")
19575  18069   
                .header("content-type", "application/json")
19576  18070   
                .body(::aws_smithy_http_server::body::Body::from(
19577         -
                    ::bytes::Bytes::from_static("{ \"longInBody\" : \"NaN\" }".as_bytes()),
       18071  +
                    ::bytes::Bytes::from_static("{ \"blob\" : -_== }".as_bytes()),
19578  18072   
                ))
19579  18073   
                .unwrap();
19580  18074   
            #[allow(unused_mut)]
19581  18075   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19582  18076   
            let config = crate::service::RestJsonConfig::builder().build();
19583  18077   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19584         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18078  +
                            .malformed_blob(move |input: crate::input::MalformedBlobInput| {
19585  18079   
                                let sender = sender.clone();
19586  18080   
                                async move {
19587         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18081  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedBlobOutput };
19588  18082   
                                    sender.send(()).await.expect("receiver dropped early");
19589  18083   
                                    result
19590  18084   
                                }
19591  18085   
                            })
19592  18086   
                            .build_unchecked();
19593  18087   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19594  18088   
                .await
19595  18089   
                .expect("unable to make an HTTP request");
19596  18090   
            ::pretty_assertions::assert_eq!(
19597  18091   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19598  18092   
                http_response.status()
19599  18093   
            );
19600  18094   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19601  18095   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19602  18096   
                http_response.headers(),
19603  18097   
                expected_headers,
19604  18098   
            ));
19605  18099   
        }
19606  18100   
    }
19607         -
    /// Malformed values in the path should be rejected
19608         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case0
       18101  +
}
       18102  +
       18103  +
const CONTENT_TYPE_MALFORMEDMAP: ::mime::Mime = ::mime::APPLICATION_JSON;
       18104  +
::pin_project_lite::pin_project! {
       18105  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       18106  +
    /// [`MalformedMapInput`](crate::input::MalformedMapInput) using modelled bindings.
       18107  +
    pub struct MalformedMapInputFuture {
       18108  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedMapInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       18109  +
    }
       18110  +
}
       18111  +
       18112  +
impl std::future::Future for MalformedMapInputFuture {
       18113  +
    type Output = Result<
       18114  +
        crate::input::MalformedMapInput,
       18115  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       18116  +
    >;
       18117  +
       18118  +
    fn poll(
       18119  +
        self: std::pin::Pin<&mut Self>,
       18120  +
        cx: &mut std::task::Context<'_>,
       18121  +
    ) -> std::task::Poll<Self::Output> {
       18122  +
        let this = self.project();
       18123  +
        this.inner.as_mut().poll(cx)
       18124  +
    }
       18125  +
}
       18126  +
       18127  +
impl<B>
       18128  +
    ::aws_smithy_http_server::request::FromRequest<
       18129  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       18130  +
        B,
       18131  +
    > for crate::input::MalformedMapInput
       18132  +
where
       18133  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       18134  +
    B: 'static,
       18135  +
       18136  +
    B::Data: Send,
       18137  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       18138  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       18139  +
{
       18140  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       18141  +
    type Future = MalformedMapInputFuture;
       18142  +
       18143  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       18144  +
        let fut = async move {
       18145  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       18146  +
                request.headers(),
       18147  +
                &CONTENT_TYPE_MALFORMEDMAP,
       18148  +
            ) {
       18149  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       18150  +
            }
       18151  +
            crate::protocol_serde::shape_malformed_map::de_malformed_map_http_request(request)
       18152  +
                .await
       18153  +
                .map_err(Into::into)
       18154  +
        };
       18155  +
        use ::futures_util::future::TryFutureExt;
       18156  +
        let fut = fut.map_err(
       18157  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       18158  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       18159  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       18160  +
                    e,
       18161  +
                )
       18162  +
            },
       18163  +
        );
       18164  +
        MalformedMapInputFuture {
       18165  +
            inner: Box::pin(fut),
       18166  +
        }
       18167  +
    }
       18168  +
}
       18169  +
impl
       18170  +
    ::aws_smithy_http_server::response::IntoResponse<
       18171  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       18172  +
    > for crate::output::MalformedMapOutput
       18173  +
{
       18174  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       18175  +
        match crate::protocol_serde::shape_malformed_map::ser_malformed_map_http_response(self) {
       18176  +
            Ok(response) => response,
       18177  +
            Err(e) => {
       18178  +
                ::tracing::error!(error = %e, "failed to serialize response");
       18179  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       18180  +
            }
       18181  +
        }
       18182  +
    }
       18183  +
}
       18184  +
       18185  +
#[allow(unreachable_code, unused_variables)]
       18186  +
#[cfg(test)]
       18187  +
mod malformed_map_test {
       18188  +
       18189  +
    /// When a map contains a null key, the response should be a 400
       18190  +
    /// SerializationException.
       18191  +
    /// Test ID: RestJsonBodyMalformedMapNullKey
19609  18192   
    #[::tokio::test]
19610         -
    async fn rest_json_path_long_malformed_value_rejected_case0_malformed_request() {
       18193  +
    #[::tracing_test::traced_test]
       18194  +
    async fn rest_json_body_malformed_map_null_key_malformed_request() {
19611  18195   
        {
19612  18196   
            #[allow(unused_mut)]
19613  18197   
            let mut http_request = http::Request::builder()
19614         -
                .uri("/MalformedLong/true")
       18198  +
                .uri("/MalformedMap")
19615  18199   
                .method("POST")
19616         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18200  +
                .header("content-type", "application/json")
       18201  +
                .body(::aws_smithy_http_server::body::Body::from(
       18202  +
                    ::bytes::Bytes::from_static("{ \"bodyMap\" : { null: \"abc\" }  }".as_bytes()),
       18203  +
                ))
19617  18204   
                .unwrap();
19618  18205   
            #[allow(unused_mut)]
19619  18206   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19620  18207   
            let config = crate::service::RestJsonConfig::builder().build();
19621  18208   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19622         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18209  +
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
19623  18210   
                                let sender = sender.clone();
19624  18211   
                                async move {
19625         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18212  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
19626  18213   
                                    sender.send(()).await.expect("receiver dropped early");
19627  18214   
                                    result
19628  18215   
                                }
19629  18216   
                            })
19630  18217   
                            .build_unchecked();
19631  18218   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19632  18219   
                .await
19633  18220   
                .expect("unable to make an HTTP request");
19634  18221   
            ::pretty_assertions::assert_eq!(
19635  18222   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19636  18223   
                http_response.status()
19637  18224   
            );
19638  18225   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19639  18226   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19640  18227   
                http_response.headers(),
19641  18228   
                expected_headers,
19642  18229   
            ));
19643  18230   
        }
19644  18231   
    }
19645         -
    /// Malformed values in the path should be rejected
19646         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case1
       18232  +
    /// When a dense map contains a null value, the response should be a 400
       18233  +
    /// SerializationException.
       18234  +
    /// Test ID: RestJsonBodyMalformedMapNullValue
19647  18235   
    #[::tokio::test]
19648         -
    async fn rest_json_path_long_malformed_value_rejected_case1_malformed_request() {
       18236  +
    #[::tracing_test::traced_test]
       18237  +
    async fn rest_json_body_malformed_map_null_value_malformed_request() {
19649  18238   
        {
19650  18239   
            #[allow(unused_mut)]
19651  18240   
            let mut http_request = http::Request::builder()
19652         -
                .uri("/MalformedLong/1.001")
       18241  +
                .uri("/MalformedMap")
19653  18242   
                .method("POST")
19654         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18243  +
                .header("content-type", "application/json")
       18244  +
                .body(::aws_smithy_http_server::body::Body::from(
       18245  +
                    ::bytes::Bytes::from_static("{ \"bodyMap\" : { \"abc\": null }  }".as_bytes()),
       18246  +
                ))
19655  18247   
                .unwrap();
19656  18248   
            #[allow(unused_mut)]
19657  18249   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19658  18250   
            let config = crate::service::RestJsonConfig::builder().build();
19659  18251   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19660         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18252  +
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
19661  18253   
                                let sender = sender.clone();
19662  18254   
                                async move {
19663         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18255  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
19664  18256   
                                    sender.send(()).await.expect("receiver dropped early");
19665  18257   
                                    result
19666  18258   
                                }
19667  18259   
                            })
19668  18260   
                            .build_unchecked();
19669  18261   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19670  18262   
                .await
19671  18263   
                .expect("unable to make an HTTP request");
19672  18264   
            ::pretty_assertions::assert_eq!(
19673  18265   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19674  18266   
                http_response.status()
19675  18267   
            );
19676  18268   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19677  18269   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19678  18270   
                http_response.headers(),
19679  18271   
                expected_headers,
19680  18272   
            ));
19681  18273   
        }
19682  18274   
    }
19683         -
    /// Malformed values in the path should be rejected
19684         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case2
       18275  +
}
       18276  +
       18277  +
const CONTENT_TYPE_MALFORMEDLIST: ::mime::Mime = ::mime::APPLICATION_JSON;
       18278  +
::pin_project_lite::pin_project! {
       18279  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       18280  +
    /// [`MalformedListInput`](crate::input::MalformedListInput) using modelled bindings.
       18281  +
    pub struct MalformedListInputFuture {
       18282  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedListInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       18283  +
    }
       18284  +
}
       18285  +
       18286  +
impl std::future::Future for MalformedListInputFuture {
       18287  +
    type Output = Result<
       18288  +
        crate::input::MalformedListInput,
       18289  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       18290  +
    >;
       18291  +
       18292  +
    fn poll(
       18293  +
        self: std::pin::Pin<&mut Self>,
       18294  +
        cx: &mut std::task::Context<'_>,
       18295  +
    ) -> std::task::Poll<Self::Output> {
       18296  +
        let this = self.project();
       18297  +
        this.inner.as_mut().poll(cx)
       18298  +
    }
       18299  +
}
       18300  +
       18301  +
impl<B>
       18302  +
    ::aws_smithy_http_server::request::FromRequest<
       18303  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       18304  +
        B,
       18305  +
    > for crate::input::MalformedListInput
       18306  +
where
       18307  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       18308  +
    B: 'static,
       18309  +
       18310  +
    B::Data: Send,
       18311  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       18312  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       18313  +
{
       18314  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       18315  +
    type Future = MalformedListInputFuture;
       18316  +
       18317  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       18318  +
        let fut = async move {
       18319  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       18320  +
                request.headers(),
       18321  +
                &CONTENT_TYPE_MALFORMEDLIST,
       18322  +
            ) {
       18323  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       18324  +
            }
       18325  +
            crate::protocol_serde::shape_malformed_list::de_malformed_list_http_request(request)
       18326  +
                .await
       18327  +
                .map_err(Into::into)
       18328  +
        };
       18329  +
        use ::futures_util::future::TryFutureExt;
       18330  +
        let fut = fut.map_err(
       18331  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       18332  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       18333  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       18334  +
                    e,
       18335  +
                )
       18336  +
            },
       18337  +
        );
       18338  +
        MalformedListInputFuture {
       18339  +
            inner: Box::pin(fut),
       18340  +
        }
       18341  +
    }
       18342  +
}
       18343  +
impl
       18344  +
    ::aws_smithy_http_server::response::IntoResponse<
       18345  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       18346  +
    > for crate::output::MalformedListOutput
       18347  +
{
       18348  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       18349  +
        match crate::protocol_serde::shape_malformed_list::ser_malformed_list_http_response(self) {
       18350  +
            Ok(response) => response,
       18351  +
            Err(e) => {
       18352  +
                ::tracing::error!(error = %e, "failed to serialize response");
       18353  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       18354  +
            }
       18355  +
        }
       18356  +
    }
       18357  +
}
       18358  +
       18359  +
#[allow(unreachable_code, unused_variables)]
       18360  +
#[cfg(test)]
       18361  +
mod malformed_list_test {
       18362  +
       18363  +
    /// When a dense list contains null, the response should be a 400
       18364  +
    /// SerializationException.
       18365  +
    /// Test ID: RestJsonBodyMalformedListNullItem
19685  18366   
    #[::tokio::test]
19686         -
    async fn rest_json_path_long_malformed_value_rejected_case2_malformed_request() {
       18367  +
    #[::tracing_test::traced_test]
       18368  +
    async fn rest_json_body_malformed_list_null_item_malformed_request() {
19687  18369   
        {
19688  18370   
            #[allow(unused_mut)]
19689  18371   
            let mut http_request = http::Request::builder()
19690         -
                .uri("/MalformedLong/2ABC")
       18372  +
                .uri("/MalformedList")
19691  18373   
                .method("POST")
19692         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18374  +
                .header("content-type", "application/json")
       18375  +
                .body(::aws_smithy_http_server::body::Body::from(
       18376  +
                    ::bytes::Bytes::from_static(
       18377  +
                        "{ \"bodyList\" : [\"a\", null, \"b\", \"c\"] }".as_bytes(),
       18378  +
                    ),
       18379  +
                ))
19693  18380   
                .unwrap();
19694  18381   
            #[allow(unused_mut)]
19695  18382   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19696  18383   
            let config = crate::service::RestJsonConfig::builder().build();
19697  18384   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19698         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18385  +
                            .malformed_list(move |input: crate::input::MalformedListInput| {
19699  18386   
                                let sender = sender.clone();
19700  18387   
                                async move {
19701         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18388  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
19702  18389   
                                    sender.send(()).await.expect("receiver dropped early");
19703  18390   
                                    result
19704  18391   
                                }
19705  18392   
                            })
19706  18393   
                            .build_unchecked();
19707  18394   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19708  18395   
                .await
19709  18396   
                .expect("unable to make an HTTP request");
19710  18397   
            ::pretty_assertions::assert_eq!(
19711  18398   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19712  18399   
                http_response.status()
19713  18400   
            );
19714  18401   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19715  18402   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19716  18403   
                http_response.headers(),
19717  18404   
                expected_headers,
19718  18405   
            ));
19719  18406   
        }
19720  18407   
    }
19721         -
    /// Malformed values in the path should be rejected
19722         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case3
       18408  +
    /// When a list does not have a closing bracket, the response should be
       18409  +
    /// a 400 SerializationException.
       18410  +
    /// Test ID: RestJsonBodyMalformedListUnclosed
19723  18411   
    #[::tokio::test]
19724         -
    async fn rest_json_path_long_malformed_value_rejected_case3_malformed_request() {
       18412  +
    #[::tracing_test::traced_test]
       18413  +
    async fn rest_json_body_malformed_list_unclosed_malformed_request() {
19725  18414   
        {
19726  18415   
            #[allow(unused_mut)]
19727  18416   
            let mut http_request = http::Request::builder()
19728         -
                .uri("/MalformedLong/0x42")
       18417  +
                .uri("/MalformedList")
19729  18418   
                .method("POST")
19730         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18419  +
                .header("content-type", "application/json")
       18420  +
                .body(::aws_smithy_http_server::body::Body::from(
       18421  +
                    ::bytes::Bytes::from_static(
       18422  +
                        "{ \"bodyList\" : [\"a\", \"b\", \"c\" }".as_bytes(),
       18423  +
                    ),
       18424  +
                ))
19731  18425   
                .unwrap();
19732  18426   
            #[allow(unused_mut)]
19733  18427   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19734  18428   
            let config = crate::service::RestJsonConfig::builder().build();
19735  18429   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19736         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18430  +
                            .malformed_list(move |input: crate::input::MalformedListInput| {
19737  18431   
                                let sender = sender.clone();
19738  18432   
                                async move {
19739         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18433  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedListOutput };
19740  18434   
                                    sender.send(()).await.expect("receiver dropped early");
19741  18435   
                                    result
19742  18436   
                                }
19743  18437   
                            })
19744  18438   
                            .build_unchecked();
19745  18439   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19746  18440   
                .await
19747  18441   
                .expect("unable to make an HTTP request");
19748  18442   
            ::pretty_assertions::assert_eq!(
19749  18443   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19750  18444   
                http_response.status()
19751  18445   
            );
19752  18446   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19753  18447   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19754  18448   
                http_response.headers(),
19755  18449   
                expected_headers,
19756  18450   
            ));
19757  18451   
        }
19758  18452   
    }
19759         -
    /// Malformed values in the path should be rejected
19760         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case4
       18453  +
}
       18454  +
       18455  +
const CONTENT_TYPE_MALFORMEDBOOLEAN: ::mime::Mime = ::mime::APPLICATION_JSON;
       18456  +
::pin_project_lite::pin_project! {
       18457  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       18458  +
    /// [`MalformedBooleanInput`](crate::input::MalformedBooleanInput) using modelled bindings.
       18459  +
    pub struct MalformedBooleanInputFuture {
       18460  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedBooleanInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       18461  +
    }
       18462  +
}
       18463  +
       18464  +
impl std::future::Future for MalformedBooleanInputFuture {
       18465  +
    type Output = Result<
       18466  +
        crate::input::MalformedBooleanInput,
       18467  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       18468  +
    >;
       18469  +
       18470  +
    fn poll(
       18471  +
        self: std::pin::Pin<&mut Self>,
       18472  +
        cx: &mut std::task::Context<'_>,
       18473  +
    ) -> std::task::Poll<Self::Output> {
       18474  +
        let this = self.project();
       18475  +
        this.inner.as_mut().poll(cx)
       18476  +
    }
       18477  +
}
       18478  +
       18479  +
impl<B>
       18480  +
    ::aws_smithy_http_server::request::FromRequest<
       18481  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       18482  +
        B,
       18483  +
    > for crate::input::MalformedBooleanInput
       18484  +
where
       18485  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       18486  +
    B: 'static,
       18487  +
       18488  +
    B::Data: Send,
       18489  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       18490  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       18491  +
{
       18492  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       18493  +
    type Future = MalformedBooleanInputFuture;
       18494  +
       18495  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       18496  +
        let fut = async move {
       18497  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       18498  +
                request.headers(),
       18499  +
                &CONTENT_TYPE_MALFORMEDBOOLEAN,
       18500  +
            ) {
       18501  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       18502  +
            }
       18503  +
            crate::protocol_serde::shape_malformed_boolean::de_malformed_boolean_http_request(
       18504  +
                request,
       18505  +
            )
       18506  +
            .await
       18507  +
            .map_err(Into::into)
       18508  +
        };
       18509  +
        use ::futures_util::future::TryFutureExt;
       18510  +
        let fut = fut.map_err(
       18511  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       18512  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       18513  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       18514  +
                    e,
       18515  +
                )
       18516  +
            },
       18517  +
        );
       18518  +
        MalformedBooleanInputFuture {
       18519  +
            inner: Box::pin(fut),
       18520  +
        }
       18521  +
    }
       18522  +
}
       18523  +
impl
       18524  +
    ::aws_smithy_http_server::response::IntoResponse<
       18525  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       18526  +
    > for crate::output::MalformedBooleanOutput
       18527  +
{
       18528  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       18529  +
        match crate::protocol_serde::shape_malformed_boolean::ser_malformed_boolean_http_response(
       18530  +
            self,
       18531  +
        ) {
       18532  +
            Ok(response) => response,
       18533  +
            Err(e) => {
       18534  +
                ::tracing::error!(error = %e, "failed to serialize response");
       18535  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       18536  +
            }
       18537  +
        }
       18538  +
    }
       18539  +
}
       18540  +
impl
       18541  +
    ::aws_smithy_http_server::response::IntoResponse<
       18542  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       18543  +
    > for crate::error::MalformedBooleanError
       18544  +
{
       18545  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       18546  +
        match crate::protocol_serde::shape_malformed_boolean::ser_malformed_boolean_http_error(
       18547  +
            &self,
       18548  +
        ) {
       18549  +
            Ok(mut response) => {
       18550  +
                response.extensions_mut().insert(
       18551  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       18552  +
                );
       18553  +
                response
       18554  +
            }
       18555  +
            Err(e) => {
       18556  +
                ::tracing::error!(error = %e, "failed to serialize response");
       18557  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       18558  +
            }
       18559  +
        }
       18560  +
    }
       18561  +
}
       18562  +
       18563  +
#[allow(unreachable_code, unused_variables)]
       18564  +
#[cfg(test)]
       18565  +
mod malformed_boolean_test {
       18566  +
       18567  +
    /// Attempted string coercion should result in SerializationException
       18568  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case0
19761  18569   
    #[::tokio::test]
19762         -
    async fn rest_json_path_long_malformed_value_rejected_case4_malformed_request() {
       18570  +
    #[::tracing_test::traced_test]
       18571  +
    async fn rest_json_body_boolean_string_coercion_case0_malformed_request() {
19763  18572   
        {
19764  18573   
            #[allow(unused_mut)]
19765  18574   
            let mut http_request = http::Request::builder()
19766         -
                .uri("/MalformedLong/Infinity")
       18575  +
                .uri("/MalformedBoolean/true")
19767  18576   
                .method("POST")
19768         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18577  +
                .header("content-type", "application/json")
       18578  +
                .body(::aws_smithy_http_server::body::Body::from(
       18579  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"true\" }".as_bytes()),
       18580  +
                ))
19769  18581   
                .unwrap();
19770  18582   
            #[allow(unused_mut)]
19771  18583   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19772  18584   
            let config = crate::service::RestJsonConfig::builder().build();
19773  18585   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19774         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18586  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
19775  18587   
                                let sender = sender.clone();
19776  18588   
                                async move {
19777         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18589  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
19778  18590   
                                    sender.send(()).await.expect("receiver dropped early");
19779  18591   
                                    result
19780  18592   
                                }
19781  18593   
                            })
19782  18594   
                            .build_unchecked();
19783  18595   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19784  18596   
                .await
19785  18597   
                .expect("unable to make an HTTP request");
19786  18598   
            ::pretty_assertions::assert_eq!(
19787  18599   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19788  18600   
                http_response.status()
19789  18601   
            );
19790  18602   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19791  18603   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19792  18604   
                http_response.headers(),
19793  18605   
                expected_headers,
19794  18606   
            ));
19795  18607   
        }
19796  18608   
    }
19797         -
    /// Malformed values in the path should be rejected
19798         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case5
       18609  +
    /// Attempted string coercion should result in SerializationException
       18610  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case1
19799  18611   
    #[::tokio::test]
19800         -
    async fn rest_json_path_long_malformed_value_rejected_case5_malformed_request() {
       18612  +
    #[::tracing_test::traced_test]
       18613  +
    async fn rest_json_body_boolean_string_coercion_case1_malformed_request() {
19801  18614   
        {
19802  18615   
            #[allow(unused_mut)]
19803  18616   
            let mut http_request = http::Request::builder()
19804         -
                .uri("/MalformedLong/-Infinity")
       18617  +
                .uri("/MalformedBoolean/true")
19805  18618   
                .method("POST")
19806         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18619  +
                .header("content-type", "application/json")
       18620  +
                .body(::aws_smithy_http_server::body::Body::from(
       18621  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"True\" }".as_bytes()),
       18622  +
                ))
19807  18623   
                .unwrap();
19808  18624   
            #[allow(unused_mut)]
19809  18625   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19810  18626   
            let config = crate::service::RestJsonConfig::builder().build();
19811  18627   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19812         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18628  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
19813  18629   
                                let sender = sender.clone();
19814  18630   
                                async move {
19815         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18631  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
19816  18632   
                                    sender.send(()).await.expect("receiver dropped early");
19817  18633   
                                    result
19818  18634   
                                }
19819  18635   
                            })
19820  18636   
                            .build_unchecked();
19821  18637   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19822  18638   
                .await
19823  18639   
                .expect("unable to make an HTTP request");
19824  18640   
            ::pretty_assertions::assert_eq!(
19825  18641   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19826  18642   
                http_response.status()
19827  18643   
            );
19828  18644   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19829  18645   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19830  18646   
                http_response.headers(),
19831  18647   
                expected_headers,
19832  18648   
            ));
19833  18649   
        }
19834  18650   
    }
19835         -
    /// Malformed values in the path should be rejected
19836         -
    /// Test ID: RestJsonPathLongMalformedValueRejected_case6
       18651  +
    /// Attempted string coercion should result in SerializationException
       18652  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case2
19837  18653   
    #[::tokio::test]
19838         -
    async fn rest_json_path_long_malformed_value_rejected_case6_malformed_request() {
       18654  +
    #[::tracing_test::traced_test]
       18655  +
    async fn rest_json_body_boolean_string_coercion_case2_malformed_request() {
19839  18656   
        {
19840  18657   
            #[allow(unused_mut)]
19841  18658   
            let mut http_request = http::Request::builder()
19842         -
                .uri("/MalformedLong/NaN")
       18659  +
                .uri("/MalformedBoolean/true")
19843  18660   
                .method("POST")
19844         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18661  +
                .header("content-type", "application/json")
       18662  +
                .body(::aws_smithy_http_server::body::Body::from(
       18663  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"TRUE\" }".as_bytes()),
       18664  +
                ))
19845  18665   
                .unwrap();
19846  18666   
            #[allow(unused_mut)]
19847  18667   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19848  18668   
            let config = crate::service::RestJsonConfig::builder().build();
19849  18669   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19850         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18670  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
19851  18671   
                                let sender = sender.clone();
19852  18672   
                                async move {
19853         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18673  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
19854  18674   
                                    sender.send(()).await.expect("receiver dropped early");
19855  18675   
                                    result
19856  18676   
                                }
19857  18677   
                            })
19858  18678   
                            .build_unchecked();
19859  18679   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19860  18680   
                .await
19861  18681   
                .expect("unable to make an HTTP request");
19862  18682   
            ::pretty_assertions::assert_eq!(
19863  18683   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19864  18684   
                http_response.status()
19865  18685   
            );
19866  18686   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19867  18687   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19868  18688   
                http_response.headers(),
19869  18689   
                expected_headers,
19870  18690   
            ));
19871  18691   
        }
19872  18692   
    }
19873         -
    /// Malformed values in query parameters should be rejected
19874         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case0
       18693  +
    /// Attempted string coercion should result in SerializationException
       18694  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case3
19875  18695   
    #[::tokio::test]
19876         -
    async fn rest_json_query_long_malformed_value_rejected_case0_malformed_request() {
       18696  +
    #[::tracing_test::traced_test]
       18697  +
    async fn rest_json_body_boolean_string_coercion_case3_malformed_request() {
19877  18698   
        {
19878  18699   
            #[allow(unused_mut)]
19879  18700   
            let mut http_request = http::Request::builder()
19880         -
                .uri("/MalformedLong/1")
       18701  +
                .uri("/MalformedBoolean/true")
19881  18702   
                .method("POST")
19882         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18703  +
                .header("content-type", "application/json")
       18704  +
                .body(::aws_smithy_http_server::body::Body::from(
       18705  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"y\" }".as_bytes()),
       18706  +
                ))
19883  18707   
                .unwrap();
19884         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=true".parse().unwrap();
19885  18708   
            #[allow(unused_mut)]
19886  18709   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19887  18710   
            let config = crate::service::RestJsonConfig::builder().build();
19888  18711   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19889         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18712  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
19890  18713   
                                let sender = sender.clone();
19891  18714   
                                async move {
19892         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18715  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
19893  18716   
                                    sender.send(()).await.expect("receiver dropped early");
19894  18717   
                                    result
19895  18718   
                                }
19896  18719   
                            })
19897  18720   
                            .build_unchecked();
19898  18721   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19899  18722   
                .await
19900  18723   
                .expect("unable to make an HTTP request");
19901  18724   
            ::pretty_assertions::assert_eq!(
19902  18725   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19903  18726   
                http_response.status()
19904  18727   
            );
19905  18728   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19906  18729   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19907  18730   
                http_response.headers(),
19908  18731   
                expected_headers,
19909  18732   
            ));
19910  18733   
        }
19911  18734   
    }
19912         -
    /// Malformed values in query parameters should be rejected
19913         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case1
       18735  +
    /// Attempted string coercion should result in SerializationException
       18736  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case4
19914  18737   
    #[::tokio::test]
19915         -
    async fn rest_json_query_long_malformed_value_rejected_case1_malformed_request() {
       18738  +
    #[::tracing_test::traced_test]
       18739  +
    async fn rest_json_body_boolean_string_coercion_case4_malformed_request() {
19916  18740   
        {
19917  18741   
            #[allow(unused_mut)]
19918  18742   
            let mut http_request = http::Request::builder()
19919         -
                .uri("/MalformedLong/1")
       18743  +
                .uri("/MalformedBoolean/true")
19920  18744   
                .method("POST")
19921         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18745  +
                .header("content-type", "application/json")
       18746  +
                .body(::aws_smithy_http_server::body::Body::from(
       18747  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Y\" }".as_bytes()),
       18748  +
                ))
19922  18749   
                .unwrap();
19923         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=1.001".parse().unwrap();
19924  18750   
            #[allow(unused_mut)]
19925  18751   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19926  18752   
            let config = crate::service::RestJsonConfig::builder().build();
19927  18753   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19928         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18754  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
19929  18755   
                                let sender = sender.clone();
19930  18756   
                                async move {
19931         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18757  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
19932  18758   
                                    sender.send(()).await.expect("receiver dropped early");
19933  18759   
                                    result
19934  18760   
                                }
19935  18761   
                            })
19936  18762   
                            .build_unchecked();
19937  18763   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19938  18764   
                .await
19939  18765   
                .expect("unable to make an HTTP request");
19940  18766   
            ::pretty_assertions::assert_eq!(
19941  18767   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19942  18768   
                http_response.status()
19943  18769   
            );
19944  18770   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19945  18771   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19946  18772   
                http_response.headers(),
19947  18773   
                expected_headers,
19948  18774   
            ));
19949  18775   
        }
19950  18776   
    }
19951         -
    /// Malformed values in query parameters should be rejected
19952         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case2
       18777  +
    /// Attempted string coercion should result in SerializationException
       18778  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case5
19953  18779   
    #[::tokio::test]
19954         -
    async fn rest_json_query_long_malformed_value_rejected_case2_malformed_request() {
       18780  +
    #[::tracing_test::traced_test]
       18781  +
    async fn rest_json_body_boolean_string_coercion_case5_malformed_request() {
19955  18782   
        {
19956  18783   
            #[allow(unused_mut)]
19957  18784   
            let mut http_request = http::Request::builder()
19958         -
                .uri("/MalformedLong/1")
       18785  +
                .uri("/MalformedBoolean/true")
19959  18786   
                .method("POST")
19960         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18787  +
                .header("content-type", "application/json")
       18788  +
                .body(::aws_smithy_http_server::body::Body::from(
       18789  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"yes\" }".as_bytes()),
       18790  +
                ))
19961  18791   
                .unwrap();
19962         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=2ABC".parse().unwrap();
19963  18792   
            #[allow(unused_mut)]
19964  18793   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
19965  18794   
            let config = crate::service::RestJsonConfig::builder().build();
19966  18795   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
19967         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18796  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
19968  18797   
                                let sender = sender.clone();
19969  18798   
                                async move {
19970         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18799  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
19971  18800   
                                    sender.send(()).await.expect("receiver dropped early");
19972  18801   
                                    result
19973  18802   
                                }
19974  18803   
                            })
19975  18804   
                            .build_unchecked();
19976  18805   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
19977  18806   
                .await
19978  18807   
                .expect("unable to make an HTTP request");
19979  18808   
            ::pretty_assertions::assert_eq!(
19980  18809   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
19981  18810   
                http_response.status()
19982  18811   
            );
19983  18812   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
19984  18813   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
19985  18814   
                http_response.headers(),
19986  18815   
                expected_headers,
19987  18816   
            ));
19988  18817   
        }
19989  18818   
    }
19990         -
    /// Malformed values in query parameters should be rejected
19991         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case3
       18819  +
    /// Attempted string coercion should result in SerializationException
       18820  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case6
19992  18821   
    #[::tokio::test]
19993         -
    async fn rest_json_query_long_malformed_value_rejected_case3_malformed_request() {
       18822  +
    #[::tracing_test::traced_test]
       18823  +
    async fn rest_json_body_boolean_string_coercion_case6_malformed_request() {
19994  18824   
        {
19995  18825   
            #[allow(unused_mut)]
19996  18826   
            let mut http_request = http::Request::builder()
19997         -
                .uri("/MalformedLong/1")
       18827  +
                .uri("/MalformedBoolean/true")
19998  18828   
                .method("POST")
19999         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18829  +
                .header("content-type", "application/json")
       18830  +
                .body(::aws_smithy_http_server::body::Body::from(
       18831  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Yes\" }".as_bytes()),
       18832  +
                ))
20000  18833   
                .unwrap();
20001         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=0x42".parse().unwrap();
20002  18834   
            #[allow(unused_mut)]
20003  18835   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20004  18836   
            let config = crate::service::RestJsonConfig::builder().build();
20005  18837   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20006         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18838  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20007  18839   
                                let sender = sender.clone();
20008  18840   
                                async move {
20009         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18841  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20010  18842   
                                    sender.send(()).await.expect("receiver dropped early");
20011  18843   
                                    result
20012  18844   
                                }
20013  18845   
                            })
20014  18846   
                            .build_unchecked();
20015  18847   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20016  18848   
                .await
20017  18849   
                .expect("unable to make an HTTP request");
20018  18850   
            ::pretty_assertions::assert_eq!(
20019  18851   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20020  18852   
                http_response.status()
20021  18853   
            );
20022  18854   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20023  18855   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20024  18856   
                http_response.headers(),
20025  18857   
                expected_headers,
20026  18858   
            ));
20027  18859   
        }
20028  18860   
    }
20029         -
    /// Malformed values in query parameters should be rejected
20030         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case4
       18861  +
    /// Attempted string coercion should result in SerializationException
       18862  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case7
20031  18863   
    #[::tokio::test]
20032         -
    async fn rest_json_query_long_malformed_value_rejected_case4_malformed_request() {
       18864  +
    #[::tracing_test::traced_test]
       18865  +
    async fn rest_json_body_boolean_string_coercion_case7_malformed_request() {
20033  18866   
        {
20034  18867   
            #[allow(unused_mut)]
20035  18868   
            let mut http_request = http::Request::builder()
20036         -
                .uri("/MalformedLong/1")
       18869  +
                .uri("/MalformedBoolean/true")
20037  18870   
                .method("POST")
20038         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18871  +
                .header("content-type", "application/json")
       18872  +
                .body(::aws_smithy_http_server::body::Body::from(
       18873  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"YES\" }".as_bytes()),
       18874  +
                ))
20039  18875   
                .unwrap();
20040         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=Infinity".parse().unwrap();
20041  18876   
            #[allow(unused_mut)]
20042  18877   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20043  18878   
            let config = crate::service::RestJsonConfig::builder().build();
20044  18879   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20045         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18880  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20046  18881   
                                let sender = sender.clone();
20047  18882   
                                async move {
20048         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18883  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20049  18884   
                                    sender.send(()).await.expect("receiver dropped early");
20050  18885   
                                    result
20051  18886   
                                }
20052  18887   
                            })
20053  18888   
                            .build_unchecked();
20054  18889   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20055  18890   
                .await
20056  18891   
                .expect("unable to make an HTTP request");
20057  18892   
            ::pretty_assertions::assert_eq!(
20058  18893   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20059  18894   
                http_response.status()
20060  18895   
            );
20061  18896   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20062  18897   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20063  18898   
                http_response.headers(),
20064  18899   
                expected_headers,
20065  18900   
            ));
20066  18901   
        }
20067  18902   
    }
20068         -
    /// Malformed values in query parameters should be rejected
20069         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case5
       18903  +
    /// Attempted string coercion should result in SerializationException
       18904  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case8
20070  18905   
    #[::tokio::test]
20071         -
    async fn rest_json_query_long_malformed_value_rejected_case5_malformed_request() {
       18906  +
    #[::tracing_test::traced_test]
       18907  +
    async fn rest_json_body_boolean_string_coercion_case8_malformed_request() {
20072  18908   
        {
20073  18909   
            #[allow(unused_mut)]
20074  18910   
            let mut http_request = http::Request::builder()
20075         -
                .uri("/MalformedLong/1")
       18911  +
                .uri("/MalformedBoolean/true")
20076  18912   
                .method("POST")
20077         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18913  +
                .header("content-type", "application/json")
       18914  +
                .body(::aws_smithy_http_server::body::Body::from(
       18915  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"1\" }".as_bytes()),
       18916  +
                ))
20078  18917   
                .unwrap();
20079         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=-Infinity".parse().unwrap();
20080  18918   
            #[allow(unused_mut)]
20081  18919   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20082  18920   
            let config = crate::service::RestJsonConfig::builder().build();
20083  18921   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20084         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18922  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20085  18923   
                                let sender = sender.clone();
20086  18924   
                                async move {
20087         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18925  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20088  18926   
                                    sender.send(()).await.expect("receiver dropped early");
20089  18927   
                                    result
20090  18928   
                                }
20091  18929   
                            })
20092  18930   
                            .build_unchecked();
20093  18931   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20094  18932   
                .await
20095  18933   
                .expect("unable to make an HTTP request");
20096  18934   
            ::pretty_assertions::assert_eq!(
20097  18935   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20098  18936   
                http_response.status()
20099  18937   
            );
20100  18938   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20101  18939   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20102  18940   
                http_response.headers(),
20103  18941   
                expected_headers,
20104  18942   
            ));
20105  18943   
        }
20106  18944   
    }
20107         -
    /// Malformed values in query parameters should be rejected
20108         -
    /// Test ID: RestJsonQueryLongMalformedValueRejected_case6
       18945  +
    /// Attempted string coercion should result in SerializationException
       18946  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case9
20109  18947   
    #[::tokio::test]
20110         -
    async fn rest_json_query_long_malformed_value_rejected_case6_malformed_request() {
       18948  +
    #[::tracing_test::traced_test]
       18949  +
    async fn rest_json_body_boolean_string_coercion_case9_malformed_request() {
20111  18950   
        {
20112  18951   
            #[allow(unused_mut)]
20113  18952   
            let mut http_request = http::Request::builder()
20114         -
                .uri("/MalformedLong/1")
       18953  +
                .uri("/MalformedBoolean/true")
20115  18954   
                .method("POST")
20116         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18955  +
                .header("content-type", "application/json")
       18956  +
                .body(::aws_smithy_http_server::body::Body::from(
       18957  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"on\" }".as_bytes()),
       18958  +
                ))
20117  18959   
                .unwrap();
20118         -
            *http_request.uri_mut() = "/MalformedLong/1?longInQuery=NaN".parse().unwrap();
20119  18960   
            #[allow(unused_mut)]
20120  18961   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20121  18962   
            let config = crate::service::RestJsonConfig::builder().build();
20122  18963   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20123         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       18964  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20124  18965   
                                let sender = sender.clone();
20125  18966   
                                async move {
20126         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       18967  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20127  18968   
                                    sender.send(()).await.expect("receiver dropped early");
20128  18969   
                                    result
20129  18970   
                                }
20130  18971   
                            })
20131  18972   
                            .build_unchecked();
20132  18973   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20133  18974   
                .await
20134  18975   
                .expect("unable to make an HTTP request");
20135  18976   
            ::pretty_assertions::assert_eq!(
20136  18977   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20137  18978   
                http_response.status()
20138  18979   
            );
20139  18980   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20140  18981   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20141  18982   
                http_response.headers(),
20142  18983   
                expected_headers,
20143  18984   
            ));
20144  18985   
        }
20145  18986   
    }
20146         -
    /// Malformed values in headers should be rejected
20147         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case0
       18987  +
    /// Attempted string coercion should result in SerializationException
       18988  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case10
20148  18989   
    #[::tokio::test]
20149         -
    async fn rest_json_header_long_malformed_value_rejected_case0_malformed_request() {
       18990  +
    #[::tracing_test::traced_test]
       18991  +
    async fn rest_json_body_boolean_string_coercion_case10_malformed_request() {
20150  18992   
        {
20151  18993   
            #[allow(unused_mut)]
20152  18994   
            let mut http_request = http::Request::builder()
20153         -
                .uri("/MalformedLong/1")
       18995  +
                .uri("/MalformedBoolean/true")
20154  18996   
                .method("POST")
20155         -
                .header("longInHeader", "true")
20156         -
                .body(::aws_smithy_http_server::body::Body::empty())
       18997  +
                .header("content-type", "application/json")
       18998  +
                .body(::aws_smithy_http_server::body::Body::from(
       18999  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"On\" }".as_bytes()),
       19000  +
                ))
20157  19001   
                .unwrap();
20158  19002   
            #[allow(unused_mut)]
20159  19003   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20160  19004   
            let config = crate::service::RestJsonConfig::builder().build();
20161  19005   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20162         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       19006  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20163  19007   
                                let sender = sender.clone();
20164  19008   
                                async move {
20165         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       19009  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20166  19010   
                                    sender.send(()).await.expect("receiver dropped early");
20167  19011   
                                    result
20168  19012   
                                }
20169  19013   
                            })
20170  19014   
                            .build_unchecked();
20171  19015   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20172  19016   
                .await
20173  19017   
                .expect("unable to make an HTTP request");
20174  19018   
            ::pretty_assertions::assert_eq!(
20175  19019   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20176  19020   
                http_response.status()
20177  19021   
            );
20178  19022   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20179  19023   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20180  19024   
                http_response.headers(),
20181  19025   
                expected_headers,
20182  19026   
            ));
20183  19027   
        }
20184  19028   
    }
20185         -
    /// Malformed values in headers should be rejected
20186         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case1
       19029  +
    /// Attempted string coercion should result in SerializationException
       19030  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case11
20187  19031   
    #[::tokio::test]
20188         -
    async fn rest_json_header_long_malformed_value_rejected_case1_malformed_request() {
       19032  +
    #[::tracing_test::traced_test]
       19033  +
    async fn rest_json_body_boolean_string_coercion_case11_malformed_request() {
20189  19034   
        {
20190  19035   
            #[allow(unused_mut)]
20191  19036   
            let mut http_request = http::Request::builder()
20192         -
                .uri("/MalformedLong/1")
       19037  +
                .uri("/MalformedBoolean/true")
20193  19038   
                .method("POST")
20194         -
                .header("longInHeader", "1.001")
20195         -
                .body(::aws_smithy_http_server::body::Body::empty())
       19039  +
                .header("content-type", "application/json")
       19040  +
                .body(::aws_smithy_http_server::body::Body::from(
       19041  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"ON\" }".as_bytes()),
       19042  +
                ))
20196  19043   
                .unwrap();
20197  19044   
            #[allow(unused_mut)]
20198  19045   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20199  19046   
            let config = crate::service::RestJsonConfig::builder().build();
20200  19047   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20201         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       19048  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20202  19049   
                                let sender = sender.clone();
20203  19050   
                                async move {
20204         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       19051  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20205  19052   
                                    sender.send(()).await.expect("receiver dropped early");
20206  19053   
                                    result
20207  19054   
                                }
20208  19055   
                            })
20209  19056   
                            .build_unchecked();
20210  19057   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20211  19058   
                .await
20212  19059   
                .expect("unable to make an HTTP request");
20213  19060   
            ::pretty_assertions::assert_eq!(
20214  19061   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20215  19062   
                http_response.status()
20216  19063   
            );
20217  19064   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20218  19065   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20219  19066   
                http_response.headers(),
20220  19067   
                expected_headers,
20221  19068   
            ));
20222  19069   
        }
20223  19070   
    }
20224         -
    /// Malformed values in headers should be rejected
20225         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case2
       19071  +
    /// Attempted string coercion should result in SerializationException
       19072  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case12
20226  19073   
    #[::tokio::test]
20227         -
    async fn rest_json_header_long_malformed_value_rejected_case2_malformed_request() {
       19074  +
    #[::tracing_test::traced_test]
       19075  +
    async fn rest_json_body_boolean_string_coercion_case12_malformed_request() {
20228  19076   
        {
20229  19077   
            #[allow(unused_mut)]
20230  19078   
            let mut http_request = http::Request::builder()
20231         -
                .uri("/MalformedLong/1")
       19079  +
                .uri("/MalformedBoolean/true")
20232  19080   
                .method("POST")
20233         -
                .header("longInHeader", "2ABC")
20234         -
                .body(::aws_smithy_http_server::body::Body::empty())
       19081  +
                .header("content-type", "application/json")
       19082  +
                .body(::aws_smithy_http_server::body::Body::from(
       19083  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"false\" }".as_bytes()),
       19084  +
                ))
20235  19085   
                .unwrap();
20236  19086   
            #[allow(unused_mut)]
20237  19087   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20238  19088   
            let config = crate::service::RestJsonConfig::builder().build();
20239  19089   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20240         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       19090  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20241  19091   
                                let sender = sender.clone();
20242  19092   
                                async move {
20243         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       19093  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20244  19094   
                                    sender.send(()).await.expect("receiver dropped early");
20245  19095   
                                    result
20246  19096   
                                }
20247  19097   
                            })
20248  19098   
                            .build_unchecked();
20249  19099   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20250  19100   
                .await
20251  19101   
                .expect("unable to make an HTTP request");
20252  19102   
            ::pretty_assertions::assert_eq!(
20253  19103   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20254  19104   
                http_response.status()
20255  19105   
            );
20256  19106   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20257  19107   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20258  19108   
                http_response.headers(),
20259  19109   
                expected_headers,
20260  19110   
            ));
20261  19111   
        }
20262  19112   
    }
20263         -
    /// Malformed values in headers should be rejected
20264         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case3
       19113  +
    /// Attempted string coercion should result in SerializationException
       19114  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case13
20265  19115   
    #[::tokio::test]
20266         -
    async fn rest_json_header_long_malformed_value_rejected_case3_malformed_request() {
       19116  +
    #[::tracing_test::traced_test]
       19117  +
    async fn rest_json_body_boolean_string_coercion_case13_malformed_request() {
20267  19118   
        {
20268  19119   
            #[allow(unused_mut)]
20269  19120   
            let mut http_request = http::Request::builder()
20270         -
                .uri("/MalformedLong/1")
       19121  +
                .uri("/MalformedBoolean/true")
20271  19122   
                .method("POST")
20272         -
                .header("longInHeader", "0x42")
20273         -
                .body(::aws_smithy_http_server::body::Body::empty())
       19123  +
                .header("content-type", "application/json")
       19124  +
                .body(::aws_smithy_http_server::body::Body::from(
       19125  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"False\" }".as_bytes()),
       19126  +
                ))
20274  19127   
                .unwrap();
20275  19128   
            #[allow(unused_mut)]
20276  19129   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20277  19130   
            let config = crate::service::RestJsonConfig::builder().build();
20278  19131   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20279         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       19132  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20280  19133   
                                let sender = sender.clone();
20281  19134   
                                async move {
20282         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       19135  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20283  19136   
                                    sender.send(()).await.expect("receiver dropped early");
20284  19137   
                                    result
20285  19138   
                                }
20286  19139   
                            })
20287  19140   
                            .build_unchecked();
20288  19141   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20289  19142   
                .await
20290  19143   
                .expect("unable to make an HTTP request");
20291  19144   
            ::pretty_assertions::assert_eq!(
20292  19145   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20293  19146   
                http_response.status()
20294  19147   
            );
20295  19148   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20296  19149   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20297  19150   
                http_response.headers(),
20298  19151   
                expected_headers,
20299  19152   
            ));
20300  19153   
        }
20301  19154   
    }
20302         -
    /// Malformed values in headers should be rejected
20303         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case4
       19155  +
    /// Attempted string coercion should result in SerializationException
       19156  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case14
20304  19157   
    #[::tokio::test]
20305         -
    async fn rest_json_header_long_malformed_value_rejected_case4_malformed_request() {
       19158  +
    #[::tracing_test::traced_test]
       19159  +
    async fn rest_json_body_boolean_string_coercion_case14_malformed_request() {
20306  19160   
        {
20307  19161   
            #[allow(unused_mut)]
20308  19162   
            let mut http_request = http::Request::builder()
20309         -
                .uri("/MalformedLong/1")
       19163  +
                .uri("/MalformedBoolean/true")
20310  19164   
                .method("POST")
20311         -
                .header("longInHeader", "Infinity")
20312         -
                .body(::aws_smithy_http_server::body::Body::empty())
       19165  +
                .header("content-type", "application/json")
       19166  +
                .body(::aws_smithy_http_server::body::Body::from(
       19167  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"FALSE\" }".as_bytes()),
       19168  +
                ))
20313  19169   
                .unwrap();
20314  19170   
            #[allow(unused_mut)]
20315  19171   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20316  19172   
            let config = crate::service::RestJsonConfig::builder().build();
20317  19173   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20318         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       19174  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20319  19175   
                                let sender = sender.clone();
20320  19176   
                                async move {
20321         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       19177  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20322  19178   
                                    sender.send(()).await.expect("receiver dropped early");
20323  19179   
                                    result
20324  19180   
                                }
20325  19181   
                            })
20326  19182   
                            .build_unchecked();
20327  19183   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20328  19184   
                .await
20329  19185   
                .expect("unable to make an HTTP request");
20330  19186   
            ::pretty_assertions::assert_eq!(
20331  19187   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20332  19188   
                http_response.status()
20333  19189   
            );
20334  19190   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20335  19191   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20336  19192   
                http_response.headers(),
20337  19193   
                expected_headers,
20338  19194   
            ));
20339  19195   
        }
20340  19196   
    }
20341         -
    /// Malformed values in headers should be rejected
20342         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case5
       19197  +
    /// Attempted string coercion should result in SerializationException
       19198  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case15
20343  19199   
    #[::tokio::test]
20344         -
    async fn rest_json_header_long_malformed_value_rejected_case5_malformed_request() {
       19200  +
    #[::tracing_test::traced_test]
       19201  +
    async fn rest_json_body_boolean_string_coercion_case15_malformed_request() {
20345  19202   
        {
20346  19203   
            #[allow(unused_mut)]
20347  19204   
            let mut http_request = http::Request::builder()
20348         -
                .uri("/MalformedLong/1")
       19205  +
                .uri("/MalformedBoolean/true")
20349  19206   
                .method("POST")
20350         -
                .header("longInHeader", "-Infinity")
20351         -
                .body(::aws_smithy_http_server::body::Body::empty())
       19207  +
                .header("content-type", "application/json")
       19208  +
                .body(::aws_smithy_http_server::body::Body::from(
       19209  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"n\" }".as_bytes()),
       19210  +
                ))
20352  19211   
                .unwrap();
20353  19212   
            #[allow(unused_mut)]
20354  19213   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20355  19214   
            let config = crate::service::RestJsonConfig::builder().build();
20356  19215   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20357         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       19216  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20358  19217   
                                let sender = sender.clone();
20359  19218   
                                async move {
20360         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       19219  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20361  19220   
                                    sender.send(()).await.expect("receiver dropped early");
20362  19221   
                                    result
20363  19222   
                                }
20364  19223   
                            })
20365  19224   
                            .build_unchecked();
20366  19225   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20367  19226   
                .await
20368  19227   
                .expect("unable to make an HTTP request");
20369  19228   
            ::pretty_assertions::assert_eq!(
20370  19229   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20371  19230   
                http_response.status()
20372  19231   
            );
20373  19232   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20374  19233   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20375  19234   
                http_response.headers(),
20376  19235   
                expected_headers,
20377  19236   
            ));
20378  19237   
        }
20379  19238   
    }
20380         -
    /// Malformed values in headers should be rejected
20381         -
    /// Test ID: RestJsonHeaderLongMalformedValueRejected_case6
       19239  +
    /// Attempted string coercion should result in SerializationException
       19240  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case16
20382  19241   
    #[::tokio::test]
20383         -
    async fn rest_json_header_long_malformed_value_rejected_case6_malformed_request() {
       19242  +
    #[::tracing_test::traced_test]
       19243  +
    async fn rest_json_body_boolean_string_coercion_case16_malformed_request() {
20384  19244   
        {
20385  19245   
            #[allow(unused_mut)]
20386  19246   
            let mut http_request = http::Request::builder()
20387         -
                .uri("/MalformedLong/1")
       19247  +
                .uri("/MalformedBoolean/true")
20388  19248   
                .method("POST")
20389         -
                .header("longInHeader", "NaN")
20390         -
                .body(::aws_smithy_http_server::body::Body::empty())
       19249  +
                .header("content-type", "application/json")
       19250  +
                .body(::aws_smithy_http_server::body::Body::from(
       19251  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"N\" }".as_bytes()),
       19252  +
                ))
20391  19253   
                .unwrap();
20392  19254   
            #[allow(unused_mut)]
20393  19255   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20394  19256   
            let config = crate::service::RestJsonConfig::builder().build();
20395  19257   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20396         -
                            .malformed_long(move |input: crate::input::MalformedLongInput| {
       19258  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20397  19259   
                                let sender = sender.clone();
20398  19260   
                                async move {
20399         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLongOutput, crate::error::MalformedLongError> };
       19261  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20400  19262   
                                    sender.send(()).await.expect("receiver dropped early");
20401  19263   
                                    result
20402  19264   
                                }
20403  19265   
                            })
20404  19266   
                            .build_unchecked();
20405  19267   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20406  19268   
                .await
20407  19269   
                .expect("unable to make an HTTP request");
20408  19270   
            ::pretty_assertions::assert_eq!(
20409  19271   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20410  19272   
                http_response.status()
20411  19273   
            );
20412  19274   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20413  19275   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20414  19276   
                http_response.headers(),
20415  19277   
                expected_headers,
20416  19278   
            ));
20417  19279   
        }
20418  19280   
    }
20419         -
}
20420         -
#[cfg(test)]
20421         -
#[allow(unreachable_code, unused_variables)]
20422         -
mod server_malformed_map_test {
20423         -
    /// When a map contains a null key, the response should be a 400
20424         -
    /// SerializationException.
20425         -
    /// Test ID: RestJsonBodyMalformedMapNullKey
       19281  +
    /// Attempted string coercion should result in SerializationException
       19282  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case17
20426  19283   
    #[::tokio::test]
20427         -
    async fn rest_json_body_malformed_map_null_key_malformed_request() {
       19284  +
    #[::tracing_test::traced_test]
       19285  +
    async fn rest_json_body_boolean_string_coercion_case17_malformed_request() {
20428  19286   
        {
20429  19287   
            #[allow(unused_mut)]
20430  19288   
            let mut http_request = http::Request::builder()
20431         -
                .uri("/MalformedMap")
       19289  +
                .uri("/MalformedBoolean/true")
20432  19290   
                .method("POST")
20433  19291   
                .header("content-type", "application/json")
20434  19292   
                .body(::aws_smithy_http_server::body::Body::from(
20435         -
                    ::bytes::Bytes::from_static("{ \"bodyMap\" : { null: \"abc\" }  }".as_bytes()),
       19293  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"no\" }".as_bytes()),
20436  19294   
                ))
20437  19295   
                .unwrap();
20438  19296   
            #[allow(unused_mut)]
20439  19297   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20440  19298   
            let config = crate::service::RestJsonConfig::builder().build();
20441  19299   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20442         -
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
       19300  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20443  19301   
                                let sender = sender.clone();
20444  19302   
                                async move {
20445         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
       19303  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20446  19304   
                                    sender.send(()).await.expect("receiver dropped early");
20447  19305   
                                    result
20448  19306   
                                }
20449  19307   
                            })
20450  19308   
                            .build_unchecked();
20451  19309   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20452  19310   
                .await
20453  19311   
                .expect("unable to make an HTTP request");
20454  19312   
            ::pretty_assertions::assert_eq!(
20455  19313   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20456  19314   
                http_response.status()
20457  19315   
            );
20458  19316   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20459  19317   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20460  19318   
                http_response.headers(),
20461  19319   
                expected_headers,
20462  19320   
            ));
20463  19321   
        }
20464  19322   
    }
20465         -
    /// When a dense map contains a null value, the response should be a 400
20466         -
    /// SerializationException.
20467         -
    /// Test ID: RestJsonBodyMalformedMapNullValue
       19323  +
    /// Attempted string coercion should result in SerializationException
       19324  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case18
20468  19325   
    #[::tokio::test]
20469         -
    async fn rest_json_body_malformed_map_null_value_malformed_request() {
       19326  +
    #[::tracing_test::traced_test]
       19327  +
    async fn rest_json_body_boolean_string_coercion_case18_malformed_request() {
20470  19328   
        {
20471  19329   
            #[allow(unused_mut)]
20472  19330   
            let mut http_request = http::Request::builder()
20473         -
                .uri("/MalformedMap")
       19331  +
                .uri("/MalformedBoolean/true")
20474  19332   
                .method("POST")
20475  19333   
                .header("content-type", "application/json")
20476  19334   
                .body(::aws_smithy_http_server::body::Body::from(
20477         -
                    ::bytes::Bytes::from_static("{ \"bodyMap\" : { \"abc\": null }  }".as_bytes()),
       19335  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"No\" }".as_bytes()),
20478  19336   
                ))
20479  19337   
                .unwrap();
20480  19338   
            #[allow(unused_mut)]
20481  19339   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20482  19340   
            let config = crate::service::RestJsonConfig::builder().build();
20483  19341   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20484         -
                            .malformed_map(move |input: crate::input::MalformedMapInput| {
       19342  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20485  19343   
                                let sender = sender.clone();
20486  19344   
                                async move {
20487         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedMapOutput };
       19345  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20488  19346   
                                    sender.send(()).await.expect("receiver dropped early");
20489  19347   
                                    result
20490  19348   
                                }
20491  19349   
                            })
20492  19350   
                            .build_unchecked();
20493  19351   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20494  19352   
                .await
20495  19353   
                .expect("unable to make an HTTP request");
20496  19354   
            ::pretty_assertions::assert_eq!(
20497  19355   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20498  19356   
                http_response.status()
20499  19357   
            );
20500  19358   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20501  19359   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20502  19360   
                http_response.headers(),
20503  19361   
                expected_headers,
20504  19362   
            ));
20505  19363   
        }
20506  19364   
    }
20507         -
}
20508         -
#[cfg(test)]
20509         -
#[allow(unreachable_code, unused_variables)]
20510         -
mod server_malformed_request_body_test {
20511         -
    /// When the request body is not valid JSON, the response should be a 400
20512         -
    /// SerializationException.
20513         -
    /// Test ID: RestJsonInvalidJsonBody_case0
       19365  +
    /// Attempted string coercion should result in SerializationException
       19366  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case19
20514  19367   
    #[::tokio::test]
20515         -
    async fn rest_json_invalid_json_body_case0_malformed_request() {
       19368  +
    #[::tracing_test::traced_test]
       19369  +
    async fn rest_json_body_boolean_string_coercion_case19_malformed_request() {
20516  19370   
        {
20517  19371   
            #[allow(unused_mut)]
20518  19372   
            let mut http_request = http::Request::builder()
20519         -
                .uri("/MalformedRequestBody")
       19373  +
                .uri("/MalformedBoolean/true")
20520  19374   
                .method("POST")
20521  19375   
                .header("content-type", "application/json")
20522  19376   
                .body(::aws_smithy_http_server::body::Body::from(
20523         -
                    ::bytes::Bytes::from_static("{[".as_bytes()),
       19377  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"NO\" }".as_bytes()),
20524  19378   
                ))
20525  19379   
                .unwrap();
20526  19380   
            #[allow(unused_mut)]
20527  19381   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20528  19382   
            let config = crate::service::RestJsonConfig::builder().build();
20529  19383   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20530         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19384  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20531  19385   
                                let sender = sender.clone();
20532  19386   
                                async move {
20533         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19387  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20534  19388   
                                    sender.send(()).await.expect("receiver dropped early");
20535  19389   
                                    result
20536  19390   
                                }
20537  19391   
                            })
20538  19392   
                            .build_unchecked();
20539  19393   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20540  19394   
                .await
20541  19395   
                .expect("unable to make an HTTP request");
20542  19396   
            ::pretty_assertions::assert_eq!(
20543  19397   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20544  19398   
                http_response.status()
20545  19399   
            );
20546  19400   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20547  19401   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20548  19402   
                http_response.headers(),
20549  19403   
                expected_headers,
20550  19404   
            ));
20551  19405   
        }
20552  19406   
    }
20553         -
    /// When the request body is not valid JSON, the response should be a 400
20554         -
    /// SerializationException.
20555         -
    /// Test ID: RestJsonInvalidJsonBody_case1
       19407  +
    /// Attempted string coercion should result in SerializationException
       19408  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case20
20556  19409   
    #[::tokio::test]
20557         -
    async fn rest_json_invalid_json_body_case1_malformed_request() {
       19410  +
    #[::tracing_test::traced_test]
       19411  +
    async fn rest_json_body_boolean_string_coercion_case20_malformed_request() {
20558  19412   
        {
20559  19413   
            #[allow(unused_mut)]
20560  19414   
            let mut http_request = http::Request::builder()
20561         -
                .uri("/MalformedRequestBody")
       19415  +
                .uri("/MalformedBoolean/true")
20562  19416   
                .method("POST")
20563  19417   
                .header("content-type", "application/json")
20564  19418   
                .body(::aws_smithy_http_server::body::Body::from(
20565         -
                    ::bytes::Bytes::from_static("{ \"int\": 10 }abc".as_bytes()),
       19419  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"0\" }".as_bytes()),
20566  19420   
                ))
20567  19421   
                .unwrap();
20568  19422   
            #[allow(unused_mut)]
20569  19423   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20570  19424   
            let config = crate::service::RestJsonConfig::builder().build();
20571  19425   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20572         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19426  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20573  19427   
                                let sender = sender.clone();
20574  19428   
                                async move {
20575         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19429  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20576  19430   
                                    sender.send(()).await.expect("receiver dropped early");
20577  19431   
                                    result
20578  19432   
                                }
20579  19433   
                            })
20580  19434   
                            .build_unchecked();
20581  19435   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20582  19436   
                .await
20583  19437   
                .expect("unable to make an HTTP request");
20584  19438   
            ::pretty_assertions::assert_eq!(
20585  19439   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20586  19440   
                http_response.status()
20587  19441   
            );
20588  19442   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20589  19443   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20590  19444   
                http_response.headers(),
20591  19445   
                expected_headers,
20592  19446   
            ));
20593  19447   
        }
20594  19448   
    }
20595         -
    /// When the request body is not valid JSON, the response should be a 400
20596         -
    /// SerializationException.
20597         -
    /// Test ID: RestJsonInvalidJsonBody_case2
       19449  +
    /// Attempted string coercion should result in SerializationException
       19450  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case21
20598  19451   
    #[::tokio::test]
20599         -
    async fn rest_json_invalid_json_body_case2_malformed_request() {
       19452  +
    #[::tracing_test::traced_test]
       19453  +
    async fn rest_json_body_boolean_string_coercion_case21_malformed_request() {
20600  19454   
        {
20601  19455   
            #[allow(unused_mut)]
20602  19456   
            let mut http_request = http::Request::builder()
20603         -
                .uri("/MalformedRequestBody")
       19457  +
                .uri("/MalformedBoolean/true")
20604  19458   
                .method("POST")
20605  19459   
                .header("content-type", "application/json")
20606  19460   
                .body(::aws_smithy_http_server::body::Body::from(
20607         -
                    ::bytes::Bytes::from_static("abc{ \"int\": 10 }".as_bytes()),
       19461  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"off\" }".as_bytes()),
20608  19462   
                ))
20609  19463   
                .unwrap();
20610  19464   
            #[allow(unused_mut)]
20611  19465   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20612  19466   
            let config = crate::service::RestJsonConfig::builder().build();
20613  19467   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20614         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19468  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20615  19469   
                                let sender = sender.clone();
20616  19470   
                                async move {
20617         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19471  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20618  19472   
                                    sender.send(()).await.expect("receiver dropped early");
20619  19473   
                                    result
20620  19474   
                                }
20621  19475   
                            })
20622  19476   
                            .build_unchecked();
20623  19477   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20624  19478   
                .await
20625  19479   
                .expect("unable to make an HTTP request");
20626  19480   
            ::pretty_assertions::assert_eq!(
20627  19481   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20628  19482   
                http_response.status()
20629  19483   
            );
20630  19484   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20631  19485   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20632  19486   
                http_response.headers(),
20633  19487   
                expected_headers,
20634  19488   
            ));
20635  19489   
        }
20636  19490   
    }
20637         -
    /// When the request body is not valid JSON, the response should be a 400
20638         -
    /// SerializationException.
20639         -
    /// Test ID: RestJsonInvalidJsonBody_case3
       19491  +
    /// Attempted string coercion should result in SerializationException
       19492  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case22
20640  19493   
    #[::tokio::test]
20641         -
    async fn rest_json_invalid_json_body_case3_malformed_request() {
       19494  +
    #[::tracing_test::traced_test]
       19495  +
    async fn rest_json_body_boolean_string_coercion_case22_malformed_request() {
20642  19496   
        {
20643  19497   
            #[allow(unused_mut)]
20644  19498   
            let mut http_request = http::Request::builder()
20645         -
                .uri("/MalformedRequestBody")
       19499  +
                .uri("/MalformedBoolean/true")
20646  19500   
                .method("POST")
20647  19501   
                .header("content-type", "application/json")
20648  19502   
                .body(::aws_smithy_http_server::body::Body::from(
20649         -
                    ::bytes::Bytes::from_static(
20650         -
                        "{\n    \"int\": 10 // the integer should be 10\n}".as_bytes(),
20651         -
                    ),
       19503  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"Off\" }".as_bytes()),
20652  19504   
                ))
20653  19505   
                .unwrap();
20654  19506   
            #[allow(unused_mut)]
20655  19507   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20656  19508   
            let config = crate::service::RestJsonConfig::builder().build();
20657  19509   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20658         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19510  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20659  19511   
                                let sender = sender.clone();
20660  19512   
                                async move {
20661         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19513  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20662  19514   
                                    sender.send(()).await.expect("receiver dropped early");
20663  19515   
                                    result
20664  19516   
                                }
20665  19517   
                            })
20666  19518   
                            .build_unchecked();
20667  19519   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20668  19520   
                .await
20669  19521   
                .expect("unable to make an HTTP request");
20670  19522   
            ::pretty_assertions::assert_eq!(
20671  19523   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20672  19524   
                http_response.status()
20673  19525   
            );
20674  19526   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20675  19527   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20676  19528   
                http_response.headers(),
20677  19529   
                expected_headers,
20678  19530   
            ));
20679  19531   
        }
20680  19532   
    }
20681         -
    /// When the request body is not valid JSON, the response should be a 400
20682         -
    /// SerializationException.
20683         -
    /// Test ID: RestJsonInvalidJsonBody_case4
       19533  +
    /// Attempted string coercion should result in SerializationException
       19534  +
    /// Test ID: RestJsonBodyBooleanStringCoercion_case23
20684  19535   
    #[::tokio::test]
20685         -
    async fn rest_json_invalid_json_body_case4_malformed_request() {
       19536  +
    #[::tracing_test::traced_test]
       19537  +
    async fn rest_json_body_boolean_string_coercion_case23_malformed_request() {
20686  19538   
        {
20687  19539   
            #[allow(unused_mut)]
20688  19540   
            let mut http_request = http::Request::builder()
20689         -
                .uri("/MalformedRequestBody")
       19541  +
                .uri("/MalformedBoolean/true")
20690  19542   
                .method("POST")
20691  19543   
                .header("content-type", "application/json")
20692  19544   
                .body(::aws_smithy_http_server::body::Body::from(
20693         -
                    ::bytes::Bytes::from_static(
20694         -
                        "{\n    \"int\": 10 /* the integer should be 10 */\n}".as_bytes(),
20695         -
                    ),
       19545  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : \"OFF\" }".as_bytes()),
20696  19546   
                ))
20697  19547   
                .unwrap();
20698  19548   
            #[allow(unused_mut)]
20699  19549   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20700  19550   
            let config = crate::service::RestJsonConfig::builder().build();
20701  19551   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20702         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19552  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20703  19553   
                                let sender = sender.clone();
20704  19554   
                                async move {
20705         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19555  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20706  19556   
                                    sender.send(()).await.expect("receiver dropped early");
20707  19557   
                                    result
20708  19558   
                                }
20709  19559   
                            })
20710  19560   
                            .build_unchecked();
20711  19561   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20712  19562   
                .await
20713  19563   
                .expect("unable to make an HTTP request");
20714  19564   
            ::pretty_assertions::assert_eq!(
20715  19565   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20716  19566   
                http_response.status()
20717  19567   
            );
20718  19568   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20719  19569   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20720  19570   
                http_response.headers(),
20721  19571   
                expected_headers,
20722  19572   
            ));
20723  19573   
        }
20724  19574   
    }
20725         -
    /// When the request body is not valid JSON, the response should be a 400
20726         -
    /// SerializationException.
20727         -
    /// Test ID: RestJsonInvalidJsonBody_case5
       19575  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19576  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case0
20728  19577   
    #[::tokio::test]
20729         -
    async fn rest_json_invalid_json_body_case5_malformed_request() {
       19578  +
    #[::tracing_test::traced_test]
       19579  +
    async fn rest_json_body_boolean_bad_literal_case0_malformed_request() {
20730  19580   
        {
20731  19581   
            #[allow(unused_mut)]
20732  19582   
            let mut http_request = http::Request::builder()
20733         -
                .uri("/MalformedRequestBody")
       19583  +
                .uri("/MalformedBoolean/true")
20734  19584   
                .method("POST")
20735  19585   
                .header("content-type", "application/json")
20736  19586   
                .body(::aws_smithy_http_server::body::Body::from(
20737         -
                    ::bytes::Bytes::from_static("{\"int\" :\\u{000c}10}".as_bytes()),
       19587  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : True }".as_bytes()),
20738  19588   
                ))
20739  19589   
                .unwrap();
20740  19590   
            #[allow(unused_mut)]
20741  19591   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20742  19592   
            let config = crate::service::RestJsonConfig::builder().build();
20743  19593   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20744         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19594  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20745  19595   
                                let sender = sender.clone();
20746  19596   
                                async move {
20747         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19597  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20748  19598   
                                    sender.send(()).await.expect("receiver dropped early");
20749  19599   
                                    result
20750  19600   
                                }
20751  19601   
                            })
20752  19602   
                            .build_unchecked();
20753  19603   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20754  19604   
                .await
20755  19605   
                .expect("unable to make an HTTP request");
20756  19606   
            ::pretty_assertions::assert_eq!(
20757  19607   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20758  19608   
                http_response.status()
20759  19609   
            );
20760  19610   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20761  19611   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20762  19612   
                http_response.headers(),
20763  19613   
                expected_headers,
20764  19614   
            ));
20765  19615   
        }
20766  19616   
    }
20767         -
    /// When the request body is not valid JSON, the response should be a 400
20768         -
    /// SerializationException.
20769         -
    /// Test ID: RestJsonInvalidJsonBody_case6
       19617  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19618  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case1
20770  19619   
    #[::tokio::test]
20771         -
    async fn rest_json_invalid_json_body_case6_malformed_request() {
       19620  +
    #[::tracing_test::traced_test]
       19621  +
    async fn rest_json_body_boolean_bad_literal_case1_malformed_request() {
20772  19622   
        {
20773  19623   
            #[allow(unused_mut)]
20774  19624   
            let mut http_request = http::Request::builder()
20775         -
                .uri("/MalformedRequestBody")
       19625  +
                .uri("/MalformedBoolean/true")
20776  19626   
                .method("POST")
20777  19627   
                .header("content-type", "application/json")
20778  19628   
                .body(::aws_smithy_http_server::body::Body::from(
20779         -
                    ::bytes::Bytes::from_static("{'int': 10}".as_bytes()),
       19629  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : TRUE }".as_bytes()),
20780  19630   
                ))
20781  19631   
                .unwrap();
20782  19632   
            #[allow(unused_mut)]
20783  19633   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20784  19634   
            let config = crate::service::RestJsonConfig::builder().build();
20785  19635   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20786         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19636  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20787  19637   
                                let sender = sender.clone();
20788  19638   
                                async move {
20789         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19639  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20790  19640   
                                    sender.send(()).await.expect("receiver dropped early");
20791  19641   
                                    result
20792  19642   
                                }
20793  19643   
                            })
20794  19644   
                            .build_unchecked();
20795  19645   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20796  19646   
                .await
20797  19647   
                .expect("unable to make an HTTP request");
20798  19648   
            ::pretty_assertions::assert_eq!(
20799  19649   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20800  19650   
                http_response.status()
20801  19651   
            );
20802  19652   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20803  19653   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20804  19654   
                http_response.headers(),
20805  19655   
                expected_headers,
20806  19656   
            ));
20807  19657   
        }
20808  19658   
    }
20809         -
    /// When the request body is not valid JSON, the response should be a 400
20810         -
    /// SerializationException.
20811         -
    /// Test ID: RestJsonInvalidJsonBody_case7
       19659  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19660  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case2
20812  19661   
    #[::tokio::test]
20813         -
    async fn rest_json_invalid_json_body_case7_malformed_request() {
       19662  +
    #[::tracing_test::traced_test]
       19663  +
    async fn rest_json_body_boolean_bad_literal_case2_malformed_request() {
20814  19664   
        {
20815  19665   
            #[allow(unused_mut)]
20816  19666   
            let mut http_request = http::Request::builder()
20817         -
                .uri("/MalformedRequestBody")
       19667  +
                .uri("/MalformedBoolean/true")
20818  19668   
                .method("POST")
20819  19669   
                .header("content-type", "application/json")
20820  19670   
                .body(::aws_smithy_http_server::body::Body::from(
20821         -
                    ::bytes::Bytes::from_static("{\"int\": 10,}".as_bytes()),
       19671  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : y }".as_bytes()),
20822  19672   
                ))
20823  19673   
                .unwrap();
20824  19674   
            #[allow(unused_mut)]
20825  19675   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20826  19676   
            let config = crate::service::RestJsonConfig::builder().build();
20827  19677   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20828         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19678  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20829  19679   
                                let sender = sender.clone();
20830  19680   
                                async move {
20831         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19681  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20832  19682   
                                    sender.send(()).await.expect("receiver dropped early");
20833  19683   
                                    result
20834  19684   
                                }
20835  19685   
                            })
20836  19686   
                            .build_unchecked();
20837  19687   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20838  19688   
                .await
20839  19689   
                .expect("unable to make an HTTP request");
20840  19690   
            ::pretty_assertions::assert_eq!(
20841  19691   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20842  19692   
                http_response.status()
20843  19693   
            );
20844  19694   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20845  19695   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20846  19696   
                http_response.headers(),
20847  19697   
                expected_headers,
20848  19698   
            ));
20849  19699   
        }
20850  19700   
    }
20851         -
    /// When the request body is technically valid, but cannot map to a Smithy structure,
20852         -
    /// the response should be a 400 SerializationException.
20853         -
    /// Test ID: RestJsonTechnicallyValidJsonBody_case0
       19701  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19702  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case3
20854  19703   
    #[::tokio::test]
20855         -
    async fn rest_json_technically_valid_json_body_case0_malformed_request() {
       19704  +
    #[::tracing_test::traced_test]
       19705  +
    async fn rest_json_body_boolean_bad_literal_case3_malformed_request() {
20856  19706   
        {
20857  19707   
            #[allow(unused_mut)]
20858  19708   
            let mut http_request = http::Request::builder()
20859         -
                .uri("/MalformedRequestBody")
       19709  +
                .uri("/MalformedBoolean/true")
20860  19710   
                .method("POST")
20861  19711   
                .header("content-type", "application/json")
20862  19712   
                .body(::aws_smithy_http_server::body::Body::from(
20863         -
                    ::bytes::Bytes::from_static("[{ \"int\": 10}]".as_bytes()),
       19713  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Y }".as_bytes()),
20864  19714   
                ))
20865  19715   
                .unwrap();
20866  19716   
            #[allow(unused_mut)]
20867  19717   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20868  19718   
            let config = crate::service::RestJsonConfig::builder().build();
20869  19719   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20870         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19720  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20871  19721   
                                let sender = sender.clone();
20872  19722   
                                async move {
20873         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19723  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20874  19724   
                                    sender.send(()).await.expect("receiver dropped early");
20875  19725   
                                    result
20876  19726   
                                }
20877  19727   
                            })
20878  19728   
                            .build_unchecked();
20879  19729   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20880  19730   
                .await
20881  19731   
                .expect("unable to make an HTTP request");
20882  19732   
            ::pretty_assertions::assert_eq!(
20883  19733   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20884  19734   
                http_response.status()
20885  19735   
            );
20886  19736   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20887  19737   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20888  19738   
                http_response.headers(),
20889  19739   
                expected_headers,
20890  19740   
            ));
20891  19741   
        }
20892  19742   
    }
20893         -
    /// When the request body is technically valid, but cannot map to a Smithy structure,
20894         -
    /// the response should be a 400 SerializationException.
20895         -
    /// Test ID: RestJsonTechnicallyValidJsonBody_case1
       19743  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19744  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case4
20896  19745   
    #[::tokio::test]
20897         -
    async fn rest_json_technically_valid_json_body_case1_malformed_request() {
       19746  +
    #[::tracing_test::traced_test]
       19747  +
    async fn rest_json_body_boolean_bad_literal_case4_malformed_request() {
20898  19748   
        {
20899  19749   
            #[allow(unused_mut)]
20900  19750   
            let mut http_request = http::Request::builder()
20901         -
                .uri("/MalformedRequestBody")
       19751  +
                .uri("/MalformedBoolean/true")
20902  19752   
                .method("POST")
20903  19753   
                .header("content-type", "application/json")
20904  19754   
                .body(::aws_smithy_http_server::body::Body::from(
20905         -
                    ::bytes::Bytes::from_static("10".as_bytes()),
       19755  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : yes }".as_bytes()),
20906  19756   
                ))
20907  19757   
                .unwrap();
20908  19758   
            #[allow(unused_mut)]
20909  19759   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20910  19760   
            let config = crate::service::RestJsonConfig::builder().build();
20911  19761   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20912         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19762  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20913  19763   
                                let sender = sender.clone();
20914  19764   
                                async move {
20915         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19765  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20916  19766   
                                    sender.send(()).await.expect("receiver dropped early");
20917  19767   
                                    result
20918  19768   
                                }
20919  19769   
                            })
20920  19770   
                            .build_unchecked();
20921  19771   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20922  19772   
                .await
20923  19773   
                .expect("unable to make an HTTP request");
20924  19774   
            ::pretty_assertions::assert_eq!(
20925  19775   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20926  19776   
                http_response.status()
20927  19777   
            );
20928  19778   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20929  19779   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20930  19780   
                http_response.headers(),
20931  19781   
                expected_headers,
20932  19782   
            ));
20933  19783   
        }
20934  19784   
    }
20935         -
    /// When the request body is technically valid, but cannot map to a Smithy structure,
20936         -
    /// the response should be a 400 SerializationException.
20937         -
    /// Test ID: RestJsonTechnicallyValidJsonBody_case2
       19785  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19786  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case5
20938  19787   
    #[::tokio::test]
20939         -
    async fn rest_json_technically_valid_json_body_case2_malformed_request() {
       19788  +
    #[::tracing_test::traced_test]
       19789  +
    async fn rest_json_body_boolean_bad_literal_case5_malformed_request() {
20940  19790   
        {
20941  19791   
            #[allow(unused_mut)]
20942  19792   
            let mut http_request = http::Request::builder()
20943         -
                .uri("/MalformedRequestBody")
       19793  +
                .uri("/MalformedBoolean/true")
20944  19794   
                .method("POST")
20945  19795   
                .header("content-type", "application/json")
20946  19796   
                .body(::aws_smithy_http_server::body::Body::from(
20947         -
                    ::bytes::Bytes::from_static("null".as_bytes()),
       19797  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Yes }".as_bytes()),
20948  19798   
                ))
20949  19799   
                .unwrap();
20950  19800   
            #[allow(unused_mut)]
20951  19801   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20952  19802   
            let config = crate::service::RestJsonConfig::builder().build();
20953  19803   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20954         -
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
       19804  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
20955  19805   
                                let sender = sender.clone();
20956  19806   
                                async move {
20957         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
       19807  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
20958  19808   
                                    sender.send(()).await.expect("receiver dropped early");
20959  19809   
                                    result
20960  19810   
                                }
20961  19811   
                            })
20962  19812   
                            .build_unchecked();
20963  19813   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
20964  19814   
                .await
20965  19815   
                .expect("unable to make an HTTP request");
20966  19816   
            ::pretty_assertions::assert_eq!(
20967  19817   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
20968  19818   
                http_response.status()
20969  19819   
            );
20970  19820   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
20971  19821   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
20972  19822   
                http_response.headers(),
20973  19823   
                expected_headers,
20974  19824   
            ));
20975  19825   
        }
20976  19826   
    }
20977         -
}
20978         -
#[cfg(test)]
20979         -
#[allow(unreachable_code, unused_variables)]
20980         -
mod server_malformed_short_test {
20981         -
    /// Underflow or overflow should result in SerializationException
20982         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case0
       19827  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19828  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case6
20983  19829   
    #[::tokio::test]
20984         -
    async fn rest_json_body_short_underflow_overflow_case0_malformed_request() {
       19830  +
    #[::tracing_test::traced_test]
       19831  +
    async fn rest_json_body_boolean_bad_literal_case6_malformed_request() {
20985  19832   
        {
20986  19833   
            #[allow(unused_mut)]
20987  19834   
            let mut http_request = http::Request::builder()
20988         -
                .uri("/MalformedShort/1")
       19835  +
                .uri("/MalformedBoolean/true")
20989  19836   
                .method("POST")
20990  19837   
                .header("content-type", "application/json")
20991  19838   
                .body(::aws_smithy_http_server::body::Body::from(
20992         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 40000 }".as_bytes()),
       19839  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : YES }".as_bytes()),
20993  19840   
                ))
20994  19841   
                .unwrap();
20995  19842   
            #[allow(unused_mut)]
20996  19843   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
20997  19844   
            let config = crate::service::RestJsonConfig::builder().build();
20998  19845   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
20999         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       19846  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21000  19847   
                                let sender = sender.clone();
21001  19848   
                                async move {
21002         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       19849  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21003  19850   
                                    sender.send(()).await.expect("receiver dropped early");
21004  19851   
                                    result
21005  19852   
                                }
21006  19853   
                            })
21007  19854   
                            .build_unchecked();
21008  19855   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21009  19856   
                .await
21010  19857   
                .expect("unable to make an HTTP request");
21011  19858   
            ::pretty_assertions::assert_eq!(
21012  19859   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21013  19860   
                http_response.status()
21014  19861   
            );
21015  19862   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21016  19863   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21017  19864   
                http_response.headers(),
21018  19865   
                expected_headers,
21019  19866   
            ));
21020  19867   
        }
21021  19868   
    }
21022         -
    /// Underflow or overflow should result in SerializationException
21023         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case1
       19869  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19870  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case7
21024  19871   
    #[::tokio::test]
21025         -
    async fn rest_json_body_short_underflow_overflow_case1_malformed_request() {
       19872  +
    #[::tracing_test::traced_test]
       19873  +
    async fn rest_json_body_boolean_bad_literal_case7_malformed_request() {
21026  19874   
        {
21027  19875   
            #[allow(unused_mut)]
21028  19876   
            let mut http_request = http::Request::builder()
21029         -
                .uri("/MalformedShort/1")
       19877  +
                .uri("/MalformedBoolean/true")
21030  19878   
                .method("POST")
21031  19879   
                .header("content-type", "application/json")
21032  19880   
                .body(::aws_smithy_http_server::body::Body::from(
21033         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : -40000 }".as_bytes()),
       19881  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : 1 }".as_bytes()),
21034  19882   
                ))
21035  19883   
                .unwrap();
21036  19884   
            #[allow(unused_mut)]
21037  19885   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21038  19886   
            let config = crate::service::RestJsonConfig::builder().build();
21039  19887   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21040         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       19888  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21041  19889   
                                let sender = sender.clone();
21042  19890   
                                async move {
21043         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       19891  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21044  19892   
                                    sender.send(()).await.expect("receiver dropped early");
21045  19893   
                                    result
21046  19894   
                                }
21047  19895   
                            })
21048  19896   
                            .build_unchecked();
21049  19897   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21050  19898   
                .await
21051  19899   
                .expect("unable to make an HTTP request");
21052  19900   
            ::pretty_assertions::assert_eq!(
21053  19901   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21054  19902   
                http_response.status()
21055  19903   
            );
21056  19904   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21057  19905   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21058  19906   
                http_response.headers(),
21059  19907   
                expected_headers,
21060  19908   
            ));
21061  19909   
        }
21062  19910   
    }
21063         -
    /// Underflow or overflow should result in SerializationException
21064         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case2
       19911  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19912  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case8
21065  19913   
    #[::tokio::test]
21066         -
    async fn rest_json_body_short_underflow_overflow_case2_malformed_request() {
       19914  +
    #[::tracing_test::traced_test]
       19915  +
    async fn rest_json_body_boolean_bad_literal_case8_malformed_request() {
21067  19916   
        {
21068  19917   
            #[allow(unused_mut)]
21069  19918   
            let mut http_request = http::Request::builder()
21070         -
                .uri("/MalformedShort/1")
       19919  +
                .uri("/MalformedBoolean/true")
21071  19920   
                .method("POST")
21072  19921   
                .header("content-type", "application/json")
21073  19922   
                .body(::aws_smithy_http_server::body::Body::from(
21074         -
                    ::bytes::Bytes::from_static(
21075         -
                        "{ \"shortInBody\" : -9223372000000000000 }".as_bytes(),
21076         -
                    ),
       19923  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : on }".as_bytes()),
21077  19924   
                ))
21078  19925   
                .unwrap();
21079  19926   
            #[allow(unused_mut)]
21080  19927   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21081  19928   
            let config = crate::service::RestJsonConfig::builder().build();
21082  19929   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21083         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       19930  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21084  19931   
                                let sender = sender.clone();
21085  19932   
                                async move {
21086         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       19933  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21087  19934   
                                    sender.send(()).await.expect("receiver dropped early");
21088  19935   
                                    result
21089  19936   
                                }
21090  19937   
                            })
21091  19938   
                            .build_unchecked();
21092  19939   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21093  19940   
                .await
21094  19941   
                .expect("unable to make an HTTP request");
21095  19942   
            ::pretty_assertions::assert_eq!(
21096  19943   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21097  19944   
                http_response.status()
21098  19945   
            );
21099  19946   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21100  19947   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21101  19948   
                http_response.headers(),
21102  19949   
                expected_headers,
21103  19950   
            ));
21104  19951   
        }
21105  19952   
    }
21106         -
    /// Underflow or overflow should result in SerializationException
21107         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case3
       19953  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19954  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case9
21108  19955   
    #[::tokio::test]
21109         -
    async fn rest_json_body_short_underflow_overflow_case3_malformed_request() {
       19956  +
    #[::tracing_test::traced_test]
       19957  +
    async fn rest_json_body_boolean_bad_literal_case9_malformed_request() {
21110  19958   
        {
21111  19959   
            #[allow(unused_mut)]
21112  19960   
            let mut http_request = http::Request::builder()
21113         -
                .uri("/MalformedShort/1")
       19961  +
                .uri("/MalformedBoolean/true")
21114  19962   
                .method("POST")
21115  19963   
                .header("content-type", "application/json")
21116  19964   
                .body(::aws_smithy_http_server::body::Body::from(
21117         -
                    ::bytes::Bytes::from_static(
21118         -
                        "{ \"shortInBody\" : 9223372000000000000 }".as_bytes(),
21119         -
                    ),
       19965  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : On }".as_bytes()),
21120  19966   
                ))
21121  19967   
                .unwrap();
21122  19968   
            #[allow(unused_mut)]
21123  19969   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21124  19970   
            let config = crate::service::RestJsonConfig::builder().build();
21125  19971   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21126         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       19972  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21127  19973   
                                let sender = sender.clone();
21128  19974   
                                async move {
21129         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       19975  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21130  19976   
                                    sender.send(()).await.expect("receiver dropped early");
21131  19977   
                                    result
21132  19978   
                                }
21133  19979   
                            })
21134  19980   
                            .build_unchecked();
21135  19981   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21136  19982   
                .await
21137  19983   
                .expect("unable to make an HTTP request");
21138  19984   
            ::pretty_assertions::assert_eq!(
21139  19985   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21140  19986   
                http_response.status()
21141  19987   
            );
21142  19988   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21143  19989   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21144  19990   
                http_response.headers(),
21145  19991   
                expected_headers,
21146  19992   
            ));
21147  19993   
        }
21148  19994   
    }
21149         -
    /// Underflow or overflow should result in SerializationException
21150         -
    /// Test ID: RestJsonBodyShortUnderflowOverflow_case4
       19995  +
    /// YAML-style alternate boolean literals should result in SerializationException
       19996  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case10
21151  19997   
    #[::tokio::test]
21152         -
    async fn rest_json_body_short_underflow_overflow_case4_malformed_request() {
       19998  +
    #[::tracing_test::traced_test]
       19999  +
    async fn rest_json_body_boolean_bad_literal_case10_malformed_request() {
21153  20000   
        {
21154  20001   
            #[allow(unused_mut)]
21155  20002   
            let mut http_request = http::Request::builder()
21156         -
                .uri("/MalformedShort/1")
       20003  +
                .uri("/MalformedBoolean/true")
21157  20004   
                .method("POST")
21158  20005   
                .header("content-type", "application/json")
21159  20006   
                .body(::aws_smithy_http_server::body::Body::from(
21160         -
                    ::bytes::Bytes::from_static(
21161         -
                        "{ \"shortInBody\" : 123000000000000000000000 }".as_bytes(),
21162         -
                    ),
       20007  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : ON }".as_bytes()),
21163  20008   
                ))
21164  20009   
                .unwrap();
21165  20010   
            #[allow(unused_mut)]
21166  20011   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21167  20012   
            let config = crate::service::RestJsonConfig::builder().build();
21168  20013   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21169         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20014  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21170  20015   
                                let sender = sender.clone();
21171  20016   
                                async move {
21172         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20017  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21173  20018   
                                    sender.send(()).await.expect("receiver dropped early");
21174  20019   
                                    result
21175  20020   
                                }
21176  20021   
                            })
21177  20022   
                            .build_unchecked();
21178  20023   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21179  20024   
                .await
21180  20025   
                .expect("unable to make an HTTP request");
21181  20026   
            ::pretty_assertions::assert_eq!(
21182  20027   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21183  20028   
                http_response.status()
21184  20029   
            );
21185  20030   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21186  20031   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21187  20032   
                http_response.headers(),
21188  20033   
                expected_headers,
21189  20034   
            ));
21190  20035   
        }
21191  20036   
    }
21192         -
    /// Underflow or overflow should result in SerializationException
21193         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case0
       20037  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20038  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case11
21194  20039   
    #[::tokio::test]
21195         -
    async fn rest_json_path_short_underflow_overflow_case0_malformed_request() {
       20040  +
    #[::tracing_test::traced_test]
       20041  +
    async fn rest_json_body_boolean_bad_literal_case11_malformed_request() {
21196  20042   
        {
21197  20043   
            #[allow(unused_mut)]
21198  20044   
            let mut http_request = http::Request::builder()
21199         -
                .uri("/MalformedShort/40000")
       20045  +
                .uri("/MalformedBoolean/true")
21200  20046   
                .method("POST")
21201         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20047  +
                .header("content-type", "application/json")
       20048  +
                .body(::aws_smithy_http_server::body::Body::from(
       20049  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : False }".as_bytes()),
       20050  +
                ))
21202  20051   
                .unwrap();
21203  20052   
            #[allow(unused_mut)]
21204  20053   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21205  20054   
            let config = crate::service::RestJsonConfig::builder().build();
21206  20055   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21207         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20056  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21208  20057   
                                let sender = sender.clone();
21209  20058   
                                async move {
21210         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20059  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21211  20060   
                                    sender.send(()).await.expect("receiver dropped early");
21212  20061   
                                    result
21213  20062   
                                }
21214  20063   
                            })
21215  20064   
                            .build_unchecked();
21216  20065   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21217  20066   
                .await
21218  20067   
                .expect("unable to make an HTTP request");
21219  20068   
            ::pretty_assertions::assert_eq!(
21220  20069   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21221  20070   
                http_response.status()
21222  20071   
            );
21223  20072   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21224  20073   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21225  20074   
                http_response.headers(),
21226  20075   
                expected_headers,
21227  20076   
            ));
21228  20077   
        }
21229  20078   
    }
21230         -
    /// Underflow or overflow should result in SerializationException
21231         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case1
       20079  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20080  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case12
21232  20081   
    #[::tokio::test]
21233         -
    async fn rest_json_path_short_underflow_overflow_case1_malformed_request() {
       20082  +
    #[::tracing_test::traced_test]
       20083  +
    async fn rest_json_body_boolean_bad_literal_case12_malformed_request() {
21234  20084   
        {
21235  20085   
            #[allow(unused_mut)]
21236  20086   
            let mut http_request = http::Request::builder()
21237         -
                .uri("/MalformedShort/-40000")
       20087  +
                .uri("/MalformedBoolean/true")
21238  20088   
                .method("POST")
21239         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20089  +
                .header("content-type", "application/json")
       20090  +
                .body(::aws_smithy_http_server::body::Body::from(
       20091  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : FALSE }".as_bytes()),
       20092  +
                ))
21240  20093   
                .unwrap();
21241  20094   
            #[allow(unused_mut)]
21242  20095   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21243  20096   
            let config = crate::service::RestJsonConfig::builder().build();
21244  20097   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21245         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20098  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21246  20099   
                                let sender = sender.clone();
21247  20100   
                                async move {
21248         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20101  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21249  20102   
                                    sender.send(()).await.expect("receiver dropped early");
21250  20103   
                                    result
21251  20104   
                                }
21252  20105   
                            })
21253  20106   
                            .build_unchecked();
21254  20107   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21255  20108   
                .await
21256  20109   
                .expect("unable to make an HTTP request");
21257  20110   
            ::pretty_assertions::assert_eq!(
21258  20111   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21259  20112   
                http_response.status()
21260  20113   
            );
21261  20114   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21262  20115   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21263  20116   
                http_response.headers(),
21264  20117   
                expected_headers,
21265  20118   
            ));
21266  20119   
        }
21267  20120   
    }
21268         -
    /// Underflow or overflow should result in SerializationException
21269         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case2
       20121  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20122  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case13
21270  20123   
    #[::tokio::test]
21271         -
    async fn rest_json_path_short_underflow_overflow_case2_malformed_request() {
       20124  +
    #[::tracing_test::traced_test]
       20125  +
    async fn rest_json_body_boolean_bad_literal_case13_malformed_request() {
21272  20126   
        {
21273  20127   
            #[allow(unused_mut)]
21274  20128   
            let mut http_request = http::Request::builder()
21275         -
                .uri("/MalformedShort/-9223372000000000000")
       20129  +
                .uri("/MalformedBoolean/true")
21276  20130   
                .method("POST")
21277         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20131  +
                .header("content-type", "application/json")
       20132  +
                .body(::aws_smithy_http_server::body::Body::from(
       20133  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : n }".as_bytes()),
       20134  +
                ))
21278  20135   
                .unwrap();
21279  20136   
            #[allow(unused_mut)]
21280  20137   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21281  20138   
            let config = crate::service::RestJsonConfig::builder().build();
21282  20139   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21283         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20140  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21284  20141   
                                let sender = sender.clone();
21285  20142   
                                async move {
21286         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20143  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21287  20144   
                                    sender.send(()).await.expect("receiver dropped early");
21288  20145   
                                    result
21289  20146   
                                }
21290  20147   
                            })
21291  20148   
                            .build_unchecked();
21292  20149   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21293  20150   
                .await
21294  20151   
                .expect("unable to make an HTTP request");
21295  20152   
            ::pretty_assertions::assert_eq!(
21296  20153   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21297  20154   
                http_response.status()
21298  20155   
            );
21299  20156   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21300  20157   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21301  20158   
                http_response.headers(),
21302  20159   
                expected_headers,
21303  20160   
            ));
21304  20161   
        }
21305  20162   
    }
21306         -
    /// Underflow or overflow should result in SerializationException
21307         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case3
       20163  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20164  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case14
21308  20165   
    #[::tokio::test]
21309         -
    async fn rest_json_path_short_underflow_overflow_case3_malformed_request() {
       20166  +
    #[::tracing_test::traced_test]
       20167  +
    async fn rest_json_body_boolean_bad_literal_case14_malformed_request() {
21310  20168   
        {
21311  20169   
            #[allow(unused_mut)]
21312  20170   
            let mut http_request = http::Request::builder()
21313         -
                .uri("/MalformedShort/9223372000000000000")
       20171  +
                .uri("/MalformedBoolean/true")
21314  20172   
                .method("POST")
21315         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20173  +
                .header("content-type", "application/json")
       20174  +
                .body(::aws_smithy_http_server::body::Body::from(
       20175  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : N }".as_bytes()),
       20176  +
                ))
21316  20177   
                .unwrap();
21317  20178   
            #[allow(unused_mut)]
21318  20179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21319  20180   
            let config = crate::service::RestJsonConfig::builder().build();
21320  20181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21321         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20182  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21322  20183   
                                let sender = sender.clone();
21323  20184   
                                async move {
21324         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20185  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21325  20186   
                                    sender.send(()).await.expect("receiver dropped early");
21326  20187   
                                    result
21327  20188   
                                }
21328  20189   
                            })
21329  20190   
                            .build_unchecked();
21330  20191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21331  20192   
                .await
21332  20193   
                .expect("unable to make an HTTP request");
21333  20194   
            ::pretty_assertions::assert_eq!(
21334  20195   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21335  20196   
                http_response.status()
21336  20197   
            );
21337  20198   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21338  20199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21339  20200   
                http_response.headers(),
21340  20201   
                expected_headers,
21341  20202   
            ));
21342  20203   
        }
21343  20204   
    }
21344         -
    /// Underflow or overflow should result in SerializationException
21345         -
    /// Test ID: RestJsonPathShortUnderflowOverflow_case4
       20205  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20206  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case15
21346  20207   
    #[::tokio::test]
21347         -
    async fn rest_json_path_short_underflow_overflow_case4_malformed_request() {
       20208  +
    #[::tracing_test::traced_test]
       20209  +
    async fn rest_json_body_boolean_bad_literal_case15_malformed_request() {
21348  20210   
        {
21349  20211   
            #[allow(unused_mut)]
21350  20212   
            let mut http_request = http::Request::builder()
21351         -
                .uri("/MalformedShort/123000000000000000000000")
       20213  +
                .uri("/MalformedBoolean/true")
21352  20214   
                .method("POST")
21353         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20215  +
                .header("content-type", "application/json")
       20216  +
                .body(::aws_smithy_http_server::body::Body::from(
       20217  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : no }".as_bytes()),
       20218  +
                ))
21354  20219   
                .unwrap();
21355  20220   
            #[allow(unused_mut)]
21356  20221   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21357  20222   
            let config = crate::service::RestJsonConfig::builder().build();
21358  20223   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21359         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20224  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21360  20225   
                                let sender = sender.clone();
21361  20226   
                                async move {
21362         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20227  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21363  20228   
                                    sender.send(()).await.expect("receiver dropped early");
21364  20229   
                                    result
21365  20230   
                                }
21366  20231   
                            })
21367  20232   
                            .build_unchecked();
21368  20233   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21369  20234   
                .await
21370  20235   
                .expect("unable to make an HTTP request");
21371  20236   
            ::pretty_assertions::assert_eq!(
21372  20237   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21373  20238   
                http_response.status()
21374  20239   
            );
21375  20240   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21376  20241   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21377  20242   
                http_response.headers(),
21378  20243   
                expected_headers,
21379  20244   
            ));
21380  20245   
        }
21381  20246   
    }
21382         -
    /// Underflow or overflow should result in SerializationException
21383         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case0
       20247  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20248  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case16
21384  20249   
    #[::tokio::test]
21385         -
    async fn rest_json_query_short_underflow_overflow_case0_malformed_request() {
       20250  +
    #[::tracing_test::traced_test]
       20251  +
    async fn rest_json_body_boolean_bad_literal_case16_malformed_request() {
21386  20252   
        {
21387  20253   
            #[allow(unused_mut)]
21388  20254   
            let mut http_request = http::Request::builder()
21389         -
                .uri("/MalformedShort/1")
       20255  +
                .uri("/MalformedBoolean/true")
21390  20256   
                .method("POST")
21391         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20257  +
                .header("content-type", "application/json")
       20258  +
                .body(::aws_smithy_http_server::body::Body::from(
       20259  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : No }".as_bytes()),
       20260  +
                ))
21392  20261   
                .unwrap();
21393         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=40000".parse().unwrap();
21394  20262   
            #[allow(unused_mut)]
21395  20263   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21396  20264   
            let config = crate::service::RestJsonConfig::builder().build();
21397  20265   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21398         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20266  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21399  20267   
                                let sender = sender.clone();
21400  20268   
                                async move {
21401         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20269  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21402  20270   
                                    sender.send(()).await.expect("receiver dropped early");
21403  20271   
                                    result
21404  20272   
                                }
21405  20273   
                            })
21406  20274   
                            .build_unchecked();
21407  20275   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21408  20276   
                .await
21409  20277   
                .expect("unable to make an HTTP request");
21410  20278   
            ::pretty_assertions::assert_eq!(
21411  20279   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21412  20280   
                http_response.status()
21413  20281   
            );
21414  20282   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21415  20283   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21416  20284   
                http_response.headers(),
21417  20285   
                expected_headers,
21418  20286   
            ));
21419  20287   
        }
21420  20288   
    }
21421         -
    /// Underflow or overflow should result in SerializationException
21422         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case1
       20289  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20290  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case17
21423  20291   
    #[::tokio::test]
21424         -
    async fn rest_json_query_short_underflow_overflow_case1_malformed_request() {
       20292  +
    #[::tracing_test::traced_test]
       20293  +
    async fn rest_json_body_boolean_bad_literal_case17_malformed_request() {
21425  20294   
        {
21426  20295   
            #[allow(unused_mut)]
21427  20296   
            let mut http_request = http::Request::builder()
21428         -
                .uri("/MalformedShort/1")
       20297  +
                .uri("/MalformedBoolean/true")
21429  20298   
                .method("POST")
21430         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20299  +
                .header("content-type", "application/json")
       20300  +
                .body(::aws_smithy_http_server::body::Body::from(
       20301  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : NO }".as_bytes()),
       20302  +
                ))
21431  20303   
                .unwrap();
21432         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-40000".parse().unwrap();
21433  20304   
            #[allow(unused_mut)]
21434  20305   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21435  20306   
            let config = crate::service::RestJsonConfig::builder().build();
21436  20307   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21437         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20308  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21438  20309   
                                let sender = sender.clone();
21439  20310   
                                async move {
21440         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20311  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21441  20312   
                                    sender.send(()).await.expect("receiver dropped early");
21442  20313   
                                    result
21443  20314   
                                }
21444  20315   
                            })
21445  20316   
                            .build_unchecked();
21446  20317   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21447  20318   
                .await
21448  20319   
                .expect("unable to make an HTTP request");
21449  20320   
            ::pretty_assertions::assert_eq!(
21450  20321   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21451  20322   
                http_response.status()
21452  20323   
            );
21453  20324   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21454  20325   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21455  20326   
                http_response.headers(),
21456  20327   
                expected_headers,
21457  20328   
            ));
21458  20329   
        }
21459  20330   
    }
21460         -
    /// Underflow or overflow should result in SerializationException
21461         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case2
       20331  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20332  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case18
21462  20333   
    #[::tokio::test]
21463         -
    async fn rest_json_query_short_underflow_overflow_case2_malformed_request() {
       20334  +
    #[::tracing_test::traced_test]
       20335  +
    async fn rest_json_body_boolean_bad_literal_case18_malformed_request() {
21464  20336   
        {
21465  20337   
            #[allow(unused_mut)]
21466  20338   
            let mut http_request = http::Request::builder()
21467         -
                .uri("/MalformedShort/1")
       20339  +
                .uri("/MalformedBoolean/true")
21468  20340   
                .method("POST")
21469         -
                .body(::aws_smithy_http_server::body::Body::empty())
21470         -
                .unwrap();
21471         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-9223372000000000000"
21472         -
                .parse()
       20341  +
                .header("content-type", "application/json")
       20342  +
                .body(::aws_smithy_http_server::body::Body::from(
       20343  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : 0 }".as_bytes()),
       20344  +
                ))
21473  20345   
                .unwrap();
21474  20346   
            #[allow(unused_mut)]
21475  20347   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21476  20348   
            let config = crate::service::RestJsonConfig::builder().build();
21477  20349   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21478         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20350  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21479  20351   
                                let sender = sender.clone();
21480  20352   
                                async move {
21481         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20353  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21482  20354   
                                    sender.send(()).await.expect("receiver dropped early");
21483  20355   
                                    result
21484  20356   
                                }
21485  20357   
                            })
21486  20358   
                            .build_unchecked();
21487  20359   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21488  20360   
                .await
21489  20361   
                .expect("unable to make an HTTP request");
21490  20362   
            ::pretty_assertions::assert_eq!(
21491  20363   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21492  20364   
                http_response.status()
21493  20365   
            );
21494  20366   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21495  20367   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21496  20368   
                http_response.headers(),
21497  20369   
                expected_headers,
21498  20370   
            ));
21499  20371   
        }
21500  20372   
    }
21501         -
    /// Underflow or overflow should result in SerializationException
21502         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case3
       20373  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20374  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case19
21503  20375   
    #[::tokio::test]
21504         -
    async fn rest_json_query_short_underflow_overflow_case3_malformed_request() {
       20376  +
    #[::tracing_test::traced_test]
       20377  +
    async fn rest_json_body_boolean_bad_literal_case19_malformed_request() {
21505  20378   
        {
21506  20379   
            #[allow(unused_mut)]
21507  20380   
            let mut http_request = http::Request::builder()
21508         -
                .uri("/MalformedShort/1")
       20381  +
                .uri("/MalformedBoolean/true")
21509  20382   
                .method("POST")
21510         -
                .body(::aws_smithy_http_server::body::Body::empty())
21511         -
                .unwrap();
21512         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=9223372000000000000"
21513         -
                .parse()
       20383  +
                .header("content-type", "application/json")
       20384  +
                .body(::aws_smithy_http_server::body::Body::from(
       20385  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : off }".as_bytes()),
       20386  +
                ))
21514  20387   
                .unwrap();
21515  20388   
            #[allow(unused_mut)]
21516  20389   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21517  20390   
            let config = crate::service::RestJsonConfig::builder().build();
21518  20391   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21519         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20392  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21520  20393   
                                let sender = sender.clone();
21521  20394   
                                async move {
21522         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20395  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21523  20396   
                                    sender.send(()).await.expect("receiver dropped early");
21524  20397   
                                    result
21525  20398   
                                }
21526  20399   
                            })
21527  20400   
                            .build_unchecked();
21528  20401   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21529  20402   
                .await
21530  20403   
                .expect("unable to make an HTTP request");
21531  20404   
            ::pretty_assertions::assert_eq!(
21532  20405   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21533  20406   
                http_response.status()
21534  20407   
            );
21535  20408   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21536  20409   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21537  20410   
                http_response.headers(),
21538  20411   
                expected_headers,
21539  20412   
            ));
21540  20413   
        }
21541  20414   
    }
21542         -
    /// Underflow or overflow should result in SerializationException
21543         -
    /// Test ID: RestJsonQueryShortUnderflowOverflow_case4
       20415  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20416  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case20
21544  20417   
    #[::tokio::test]
21545         -
    async fn rest_json_query_short_underflow_overflow_case4_malformed_request() {
       20418  +
    #[::tracing_test::traced_test]
       20419  +
    async fn rest_json_body_boolean_bad_literal_case20_malformed_request() {
21546  20420   
        {
21547  20421   
            #[allow(unused_mut)]
21548  20422   
            let mut http_request = http::Request::builder()
21549         -
                .uri("/MalformedShort/1")
       20423  +
                .uri("/MalformedBoolean/true")
21550  20424   
                .method("POST")
21551         -
                .body(::aws_smithy_http_server::body::Body::empty())
21552         -
                .unwrap();
21553         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=123000000000000000000000"
21554         -
                .parse()
       20425  +
                .header("content-type", "application/json")
       20426  +
                .body(::aws_smithy_http_server::body::Body::from(
       20427  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : Off }".as_bytes()),
       20428  +
                ))
21555  20429   
                .unwrap();
21556  20430   
            #[allow(unused_mut)]
21557  20431   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21558  20432   
            let config = crate::service::RestJsonConfig::builder().build();
21559  20433   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21560         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20434  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21561  20435   
                                let sender = sender.clone();
21562  20436   
                                async move {
21563         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20437  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21564  20438   
                                    sender.send(()).await.expect("receiver dropped early");
21565  20439   
                                    result
21566  20440   
                                }
21567  20441   
                            })
21568  20442   
                            .build_unchecked();
21569  20443   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21570  20444   
                .await
21571  20445   
                .expect("unable to make an HTTP request");
21572  20446   
            ::pretty_assertions::assert_eq!(
21573  20447   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21574  20448   
                http_response.status()
21575  20449   
            );
21576  20450   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21577  20451   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21578  20452   
                http_response.headers(),
21579  20453   
                expected_headers,
21580  20454   
            ));
21581  20455   
        }
21582  20456   
    }
21583         -
    /// Underflow or overflow should result in SerializationException
21584         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case0
       20457  +
    /// YAML-style alternate boolean literals should result in SerializationException
       20458  +
    /// Test ID: RestJsonBodyBooleanBadLiteral_case21
21585  20459   
    #[::tokio::test]
21586         -
    async fn rest_json_header_short_underflow_overflow_case0_malformed_request() {
       20460  +
    #[::tracing_test::traced_test]
       20461  +
    async fn rest_json_body_boolean_bad_literal_case21_malformed_request() {
21587  20462   
        {
21588  20463   
            #[allow(unused_mut)]
21589  20464   
            let mut http_request = http::Request::builder()
21590         -
                .uri("/MalformedShort/1")
       20465  +
                .uri("/MalformedBoolean/true")
21591  20466   
                .method("POST")
21592         -
                .header("shortInHeader", "40000")
21593         -
                .body(::aws_smithy_http_server::body::Body::empty())
       20467  +
                .header("content-type", "application/json")
       20468  +
                .body(::aws_smithy_http_server::body::Body::from(
       20469  +
                    ::bytes::Bytes::from_static("{ \"booleanInBody\" : OFF }".as_bytes()),
       20470  +
                ))
21594  20471   
                .unwrap();
21595  20472   
            #[allow(unused_mut)]
21596  20473   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21597  20474   
            let config = crate::service::RestJsonConfig::builder().build();
21598  20475   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21599         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20476  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21600  20477   
                                let sender = sender.clone();
21601  20478   
                                async move {
21602         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20479  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21603  20480   
                                    sender.send(()).await.expect("receiver dropped early");
21604  20481   
                                    result
21605  20482   
                                }
21606  20483   
                            })
21607  20484   
                            .build_unchecked();
21608  20485   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21609  20486   
                .await
21610  20487   
                .expect("unable to make an HTTP request");
21611  20488   
            ::pretty_assertions::assert_eq!(
21612  20489   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21613  20490   
                http_response.status()
21614  20491   
            );
21615  20492   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21616  20493   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21617  20494   
                http_response.headers(),
21618  20495   
                expected_headers,
21619  20496   
            ));
21620  20497   
        }
21621  20498   
    }
21622         -
    /// Underflow or overflow should result in SerializationException
21623         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case1
       20499  +
    /// Attempted string coercion should result in SerializationException
       20500  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case0
21624  20501   
    #[::tokio::test]
21625         -
    async fn rest_json_header_short_underflow_overflow_case1_malformed_request() {
       20502  +
    #[::tracing_test::traced_test]
       20503  +
    async fn rest_json_path_boolean_string_coercion_case0_malformed_request() {
21626  20504   
        {
21627  20505   
            #[allow(unused_mut)]
21628  20506   
            let mut http_request = http::Request::builder()
21629         -
                .uri("/MalformedShort/1")
       20507  +
                .uri("/MalformedBoolean/True")
21630  20508   
                .method("POST")
21631         -
                .header("shortInHeader", "-40000")
21632  20509   
                .body(::aws_smithy_http_server::body::Body::empty())
21633  20510   
                .unwrap();
21634  20511   
            #[allow(unused_mut)]
21635  20512   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21636  20513   
            let config = crate::service::RestJsonConfig::builder().build();
21637  20514   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21638         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20515  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21639  20516   
                                let sender = sender.clone();
21640  20517   
                                async move {
21641         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20518  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21642  20519   
                                    sender.send(()).await.expect("receiver dropped early");
21643  20520   
                                    result
21644  20521   
                                }
21645  20522   
                            })
21646  20523   
                            .build_unchecked();
21647  20524   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21648  20525   
                .await
21649  20526   
                .expect("unable to make an HTTP request");
21650  20527   
            ::pretty_assertions::assert_eq!(
21651  20528   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21652  20529   
                http_response.status()
21653  20530   
            );
21654  20531   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21655  20532   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21656  20533   
                http_response.headers(),
21657  20534   
                expected_headers,
21658  20535   
            ));
21659  20536   
        }
21660  20537   
    }
21661         -
    /// Underflow or overflow should result in SerializationException
21662         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case2
       20538  +
    /// Attempted string coercion should result in SerializationException
       20539  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case1
21663  20540   
    #[::tokio::test]
21664         -
    async fn rest_json_header_short_underflow_overflow_case2_malformed_request() {
       20541  +
    #[::tracing_test::traced_test]
       20542  +
    async fn rest_json_path_boolean_string_coercion_case1_malformed_request() {
21665  20543   
        {
21666  20544   
            #[allow(unused_mut)]
21667  20545   
            let mut http_request = http::Request::builder()
21668         -
                .uri("/MalformedShort/1")
       20546  +
                .uri("/MalformedBoolean/TRUE")
21669  20547   
                .method("POST")
21670         -
                .header("shortInHeader", "-9223372000000000000")
21671  20548   
                .body(::aws_smithy_http_server::body::Body::empty())
21672  20549   
                .unwrap();
21673  20550   
            #[allow(unused_mut)]
21674  20551   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21675  20552   
            let config = crate::service::RestJsonConfig::builder().build();
21676  20553   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21677         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20554  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21678  20555   
                                let sender = sender.clone();
21679  20556   
                                async move {
21680         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20557  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21681  20558   
                                    sender.send(()).await.expect("receiver dropped early");
21682  20559   
                                    result
21683  20560   
                                }
21684  20561   
                            })
21685  20562   
                            .build_unchecked();
21686  20563   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21687  20564   
                .await
21688  20565   
                .expect("unable to make an HTTP request");
21689  20566   
            ::pretty_assertions::assert_eq!(
21690  20567   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21691  20568   
                http_response.status()
21692  20569   
            );
21693  20570   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21694  20571   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21695  20572   
                http_response.headers(),
21696  20573   
                expected_headers,
21697  20574   
            ));
21698  20575   
        }
21699  20576   
    }
21700         -
    /// Underflow or overflow should result in SerializationException
21701         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case3
       20577  +
    /// Attempted string coercion should result in SerializationException
       20578  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case2
21702  20579   
    #[::tokio::test]
21703         -
    async fn rest_json_header_short_underflow_overflow_case3_malformed_request() {
       20580  +
    #[::tracing_test::traced_test]
       20581  +
    async fn rest_json_path_boolean_string_coercion_case2_malformed_request() {
21704  20582   
        {
21705  20583   
            #[allow(unused_mut)]
21706  20584   
            let mut http_request = http::Request::builder()
21707         -
                .uri("/MalformedShort/1")
       20585  +
                .uri("/MalformedBoolean/y")
21708  20586   
                .method("POST")
21709         -
                .header("shortInHeader", "9223372000000000000")
21710  20587   
                .body(::aws_smithy_http_server::body::Body::empty())
21711  20588   
                .unwrap();
21712  20589   
            #[allow(unused_mut)]
21713  20590   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21714  20591   
            let config = crate::service::RestJsonConfig::builder().build();
21715  20592   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21716         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20593  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21717  20594   
                                let sender = sender.clone();
21718  20595   
                                async move {
21719         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20596  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21720  20597   
                                    sender.send(()).await.expect("receiver dropped early");
21721  20598   
                                    result
21722  20599   
                                }
21723  20600   
                            })
21724  20601   
                            .build_unchecked();
21725  20602   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21726  20603   
                .await
21727  20604   
                .expect("unable to make an HTTP request");
21728  20605   
            ::pretty_assertions::assert_eq!(
21729  20606   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21730  20607   
                http_response.status()
21731  20608   
            );
21732  20609   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21733  20610   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21734  20611   
                http_response.headers(),
21735  20612   
                expected_headers,
21736  20613   
            ));
21737  20614   
        }
21738  20615   
    }
21739         -
    /// Underflow or overflow should result in SerializationException
21740         -
    /// Test ID: RestJsonHeaderShortUnderflowOverflow_case4
       20616  +
    /// Attempted string coercion should result in SerializationException
       20617  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case3
21741  20618   
    #[::tokio::test]
21742         -
    async fn rest_json_header_short_underflow_overflow_case4_malformed_request() {
       20619  +
    #[::tracing_test::traced_test]
       20620  +
    async fn rest_json_path_boolean_string_coercion_case3_malformed_request() {
21743  20621   
        {
21744  20622   
            #[allow(unused_mut)]
21745  20623   
            let mut http_request = http::Request::builder()
21746         -
                .uri("/MalformedShort/1")
       20624  +
                .uri("/MalformedBoolean/Y")
21747  20625   
                .method("POST")
21748         -
                .header("shortInHeader", "123000000000000000000000")
21749  20626   
                .body(::aws_smithy_http_server::body::Body::empty())
21750  20627   
                .unwrap();
21751  20628   
            #[allow(unused_mut)]
21752  20629   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21753  20630   
            let config = crate::service::RestJsonConfig::builder().build();
21754  20631   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21755         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20632  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21756  20633   
                                let sender = sender.clone();
21757  20634   
                                async move {
21758         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20635  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21759  20636   
                                    sender.send(()).await.expect("receiver dropped early");
21760  20637   
                                    result
21761  20638   
                                }
21762  20639   
                            })
21763  20640   
                            .build_unchecked();
21764  20641   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21765  20642   
                .await
21766  20643   
                .expect("unable to make an HTTP request");
21767  20644   
            ::pretty_assertions::assert_eq!(
21768  20645   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21769  20646   
                http_response.status()
21770  20647   
            );
21771  20648   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21772  20649   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21773  20650   
                http_response.headers(),
21774  20651   
                expected_headers,
21775  20652   
            ));
21776  20653   
        }
21777  20654   
    }
21778         -
    /// Malformed values in the body should be rejected
21779         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case0
       20655  +
    /// Attempted string coercion should result in SerializationException
       20656  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case4
21780  20657   
    #[::tokio::test]
21781         -
    async fn rest_json_body_short_malformed_value_rejected_case0_malformed_request() {
       20658  +
    #[::tracing_test::traced_test]
       20659  +
    async fn rest_json_path_boolean_string_coercion_case4_malformed_request() {
21782  20660   
        {
21783  20661   
            #[allow(unused_mut)]
21784  20662   
            let mut http_request = http::Request::builder()
21785         -
                .uri("/MalformedShort/1")
       20663  +
                .uri("/MalformedBoolean/yes")
21786  20664   
                .method("POST")
21787         -
                .header("content-type", "application/json")
21788         -
                .body(::aws_smithy_http_server::body::Body::from(
21789         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"123\" }".as_bytes()),
21790         -
                ))
       20665  +
                .body(::aws_smithy_http_server::body::Body::empty())
21791  20666   
                .unwrap();
21792  20667   
            #[allow(unused_mut)]
21793  20668   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21794  20669   
            let config = crate::service::RestJsonConfig::builder().build();
21795  20670   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21796         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20671  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21797  20672   
                                let sender = sender.clone();
21798  20673   
                                async move {
21799         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20674  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21800  20675   
                                    sender.send(()).await.expect("receiver dropped early");
21801  20676   
                                    result
21802  20677   
                                }
21803  20678   
                            })
21804  20679   
                            .build_unchecked();
21805  20680   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21806  20681   
                .await
21807  20682   
                .expect("unable to make an HTTP request");
21808  20683   
            ::pretty_assertions::assert_eq!(
21809  20684   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21810  20685   
                http_response.status()
21811  20686   
            );
21812  20687   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21813  20688   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21814  20689   
                http_response.headers(),
21815  20690   
                expected_headers,
21816  20691   
            ));
21817  20692   
        }
21818  20693   
    }
21819         -
    /// Malformed values in the body should be rejected
21820         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case1
       20694  +
    /// Attempted string coercion should result in SerializationException
       20695  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case5
21821  20696   
    #[::tokio::test]
21822         -
    async fn rest_json_body_short_malformed_value_rejected_case1_malformed_request() {
       20697  +
    #[::tracing_test::traced_test]
       20698  +
    async fn rest_json_path_boolean_string_coercion_case5_malformed_request() {
21823  20699   
        {
21824  20700   
            #[allow(unused_mut)]
21825  20701   
            let mut http_request = http::Request::builder()
21826         -
                .uri("/MalformedShort/1")
       20702  +
                .uri("/MalformedBoolean/Yes")
21827  20703   
                .method("POST")
21828         -
                .header("content-type", "application/json")
21829         -
                .body(::aws_smithy_http_server::body::Body::from(
21830         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : true }".as_bytes()),
21831         -
                ))
       20704  +
                .body(::aws_smithy_http_server::body::Body::empty())
21832  20705   
                .unwrap();
21833  20706   
            #[allow(unused_mut)]
21834  20707   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21835  20708   
            let config = crate::service::RestJsonConfig::builder().build();
21836  20709   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21837         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20710  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21838  20711   
                                let sender = sender.clone();
21839  20712   
                                async move {
21840         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20713  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21841  20714   
                                    sender.send(()).await.expect("receiver dropped early");
21842  20715   
                                    result
21843  20716   
                                }
21844  20717   
                            })
21845  20718   
                            .build_unchecked();
21846  20719   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21847  20720   
                .await
21848  20721   
                .expect("unable to make an HTTP request");
21849  20722   
            ::pretty_assertions::assert_eq!(
21850  20723   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21851  20724   
                http_response.status()
21852  20725   
            );
21853  20726   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21854  20727   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21855  20728   
                http_response.headers(),
21856  20729   
                expected_headers,
21857  20730   
            ));
21858  20731   
        }
21859  20732   
    }
21860         -
    /// Malformed values in the body should be rejected
21861         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case2
       20733  +
    /// Attempted string coercion should result in SerializationException
       20734  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case6
21862  20735   
    #[::tokio::test]
21863         -
    async fn rest_json_body_short_malformed_value_rejected_case2_malformed_request() {
       20736  +
    #[::tracing_test::traced_test]
       20737  +
    async fn rest_json_path_boolean_string_coercion_case6_malformed_request() {
21864  20738   
        {
21865  20739   
            #[allow(unused_mut)]
21866  20740   
            let mut http_request = http::Request::builder()
21867         -
                .uri("/MalformedShort/1")
       20741  +
                .uri("/MalformedBoolean/YES")
21868  20742   
                .method("POST")
21869         -
                .header("content-type", "application/json")
21870         -
                .body(::aws_smithy_http_server::body::Body::from(
21871         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 1.001 }".as_bytes()),
21872         -
                ))
       20743  +
                .body(::aws_smithy_http_server::body::Body::empty())
21873  20744   
                .unwrap();
21874  20745   
            #[allow(unused_mut)]
21875  20746   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21876  20747   
            let config = crate::service::RestJsonConfig::builder().build();
21877  20748   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21878         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20749  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21879  20750   
                                let sender = sender.clone();
21880  20751   
                                async move {
21881         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20752  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21882  20753   
                                    sender.send(()).await.expect("receiver dropped early");
21883  20754   
                                    result
21884  20755   
                                }
21885  20756   
                            })
21886  20757   
                            .build_unchecked();
21887  20758   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21888  20759   
                .await
21889  20760   
                .expect("unable to make an HTTP request");
21890  20761   
            ::pretty_assertions::assert_eq!(
21891  20762   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21892  20763   
                http_response.status()
21893  20764   
            );
21894  20765   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21895  20766   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21896  20767   
                http_response.headers(),
21897  20768   
                expected_headers,
21898  20769   
            ));
21899  20770   
        }
21900  20771   
    }
21901         -
    /// Malformed values in the body should be rejected
21902         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case3
       20772  +
    /// Attempted string coercion should result in SerializationException
       20773  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case7
21903  20774   
    #[::tokio::test]
21904         -
    async fn rest_json_body_short_malformed_value_rejected_case3_malformed_request() {
       20775  +
    #[::tracing_test::traced_test]
       20776  +
    async fn rest_json_path_boolean_string_coercion_case7_malformed_request() {
21905  20777   
        {
21906  20778   
            #[allow(unused_mut)]
21907  20779   
            let mut http_request = http::Request::builder()
21908         -
                .uri("/MalformedShort/1")
       20780  +
                .uri("/MalformedBoolean/1")
21909  20781   
                .method("POST")
21910         -
                .header("content-type", "application/json")
21911         -
                .body(::aws_smithy_http_server::body::Body::from(
21912         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 2ABC }".as_bytes()),
21913         -
                ))
       20782  +
                .body(::aws_smithy_http_server::body::Body::empty())
21914  20783   
                .unwrap();
21915  20784   
            #[allow(unused_mut)]
21916  20785   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21917  20786   
            let config = crate::service::RestJsonConfig::builder().build();
21918  20787   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21919         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20788  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21920  20789   
                                let sender = sender.clone();
21921  20790   
                                async move {
21922         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20791  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21923  20792   
                                    sender.send(()).await.expect("receiver dropped early");
21924  20793   
                                    result
21925  20794   
                                }
21926  20795   
                            })
21927  20796   
                            .build_unchecked();
21928  20797   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21929  20798   
                .await
21930  20799   
                .expect("unable to make an HTTP request");
21931  20800   
            ::pretty_assertions::assert_eq!(
21932  20801   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21933  20802   
                http_response.status()
21934  20803   
            );
21935  20804   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21936  20805   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21937  20806   
                http_response.headers(),
21938  20807   
                expected_headers,
21939  20808   
            ));
21940  20809   
        }
21941  20810   
    }
21942         -
    /// Malformed values in the body should be rejected
21943         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case4
       20811  +
    /// Attempted string coercion should result in SerializationException
       20812  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case8
21944  20813   
    #[::tokio::test]
21945         -
    async fn rest_json_body_short_malformed_value_rejected_case4_malformed_request() {
       20814  +
    #[::tracing_test::traced_test]
       20815  +
    async fn rest_json_path_boolean_string_coercion_case8_malformed_request() {
21946  20816   
        {
21947  20817   
            #[allow(unused_mut)]
21948  20818   
            let mut http_request = http::Request::builder()
21949         -
                .uri("/MalformedShort/1")
       20819  +
                .uri("/MalformedBoolean/on")
21950  20820   
                .method("POST")
21951         -
                .header("content-type", "application/json")
21952         -
                .body(::aws_smithy_http_server::body::Body::from(
21953         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : 0x42 }".as_bytes()),
21954         -
                ))
       20821  +
                .body(::aws_smithy_http_server::body::Body::empty())
21955  20822   
                .unwrap();
21956  20823   
            #[allow(unused_mut)]
21957  20824   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21958  20825   
            let config = crate::service::RestJsonConfig::builder().build();
21959  20826   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
21960         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20827  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
21961  20828   
                                let sender = sender.clone();
21962  20829   
                                async move {
21963         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20830  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
21964  20831   
                                    sender.send(()).await.expect("receiver dropped early");
21965  20832   
                                    result
21966  20833   
                                }
21967  20834   
                            })
21968  20835   
                            .build_unchecked();
21969  20836   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
21970  20837   
                .await
21971  20838   
                .expect("unable to make an HTTP request");
21972  20839   
            ::pretty_assertions::assert_eq!(
21973  20840   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
21974  20841   
                http_response.status()
21975  20842   
            );
21976  20843   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
21977  20844   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
21978  20845   
                http_response.headers(),
21979  20846   
                expected_headers,
21980  20847   
            ));
21981  20848   
        }
21982  20849   
    }
21983         -
    /// Malformed values in the body should be rejected
21984         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case5
       20850  +
    /// Attempted string coercion should result in SerializationException
       20851  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case9
21985  20852   
    #[::tokio::test]
21986         -
    async fn rest_json_body_short_malformed_value_rejected_case5_malformed_request() {
       20853  +
    #[::tracing_test::traced_test]
       20854  +
    async fn rest_json_path_boolean_string_coercion_case9_malformed_request() {
21987  20855   
        {
21988  20856   
            #[allow(unused_mut)]
21989  20857   
            let mut http_request = http::Request::builder()
21990         -
                .uri("/MalformedShort/1")
       20858  +
                .uri("/MalformedBoolean/On")
21991  20859   
                .method("POST")
21992         -
                .header("content-type", "application/json")
21993         -
                .body(::aws_smithy_http_server::body::Body::from(
21994         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : Infinity }".as_bytes()),
21995         -
                ))
       20860  +
                .body(::aws_smithy_http_server::body::Body::empty())
21996  20861   
                .unwrap();
21997  20862   
            #[allow(unused_mut)]
21998  20863   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
21999  20864   
            let config = crate::service::RestJsonConfig::builder().build();
22000  20865   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22001         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20866  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22002  20867   
                                let sender = sender.clone();
22003  20868   
                                async move {
22004         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20869  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22005  20870   
                                    sender.send(()).await.expect("receiver dropped early");
22006  20871   
                                    result
22007  20872   
                                }
22008  20873   
                            })
22009  20874   
                            .build_unchecked();
22010  20875   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22011  20876   
                .await
22012  20877   
                .expect("unable to make an HTTP request");
22013  20878   
            ::pretty_assertions::assert_eq!(
22014  20879   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22015  20880   
                http_response.status()
22016  20881   
            );
22017  20882   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22018  20883   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22019  20884   
                http_response.headers(),
22020  20885   
                expected_headers,
22021  20886   
            ));
22022  20887   
        }
22023  20888   
    }
22024         -
    /// Malformed values in the body should be rejected
22025         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case6
       20889  +
    /// Attempted string coercion should result in SerializationException
       20890  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case10
22026  20891   
    #[::tokio::test]
22027         -
    async fn rest_json_body_short_malformed_value_rejected_case6_malformed_request() {
       20892  +
    #[::tracing_test::traced_test]
       20893  +
    async fn rest_json_path_boolean_string_coercion_case10_malformed_request() {
22028  20894   
        {
22029  20895   
            #[allow(unused_mut)]
22030  20896   
            let mut http_request = http::Request::builder()
22031         -
                .uri("/MalformedShort/1")
       20897  +
                .uri("/MalformedBoolean/ON")
22032  20898   
                .method("POST")
22033         -
                .header("content-type", "application/json")
22034         -
                .body(::aws_smithy_http_server::body::Body::from(
22035         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"Infinity\" }".as_bytes()),
22036         -
                ))
       20899  +
                .body(::aws_smithy_http_server::body::Body::empty())
22037  20900   
                .unwrap();
22038  20901   
            #[allow(unused_mut)]
22039  20902   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22040  20903   
            let config = crate::service::RestJsonConfig::builder().build();
22041  20904   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22042         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20905  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22043  20906   
                                let sender = sender.clone();
22044  20907   
                                async move {
22045         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20908  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22046  20909   
                                    sender.send(()).await.expect("receiver dropped early");
22047  20910   
                                    result
22048  20911   
                                }
22049  20912   
                            })
22050  20913   
                            .build_unchecked();
22051  20914   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22052  20915   
                .await
22053  20916   
                .expect("unable to make an HTTP request");
22054  20917   
            ::pretty_assertions::assert_eq!(
22055  20918   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22056  20919   
                http_response.status()
22057  20920   
            );
22058  20921   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22059  20922   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22060  20923   
                http_response.headers(),
22061  20924   
                expected_headers,
22062  20925   
            ));
22063  20926   
        }
22064  20927   
    }
22065         -
    /// Malformed values in the body should be rejected
22066         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case7
       20928  +
    /// Attempted string coercion should result in SerializationException
       20929  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case11
22067  20930   
    #[::tokio::test]
22068         -
    async fn rest_json_body_short_malformed_value_rejected_case7_malformed_request() {
       20931  +
    #[::tracing_test::traced_test]
       20932  +
    async fn rest_json_path_boolean_string_coercion_case11_malformed_request() {
22069  20933   
        {
22070  20934   
            #[allow(unused_mut)]
22071  20935   
            let mut http_request = http::Request::builder()
22072         -
                .uri("/MalformedShort/1")
       20936  +
                .uri("/MalformedBoolean/False")
22073  20937   
                .method("POST")
22074         -
                .header("content-type", "application/json")
22075         -
                .body(::aws_smithy_http_server::body::Body::from(
22076         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : -Infinity }".as_bytes()),
22077         -
                ))
       20938  +
                .body(::aws_smithy_http_server::body::Body::empty())
22078  20939   
                .unwrap();
22079  20940   
            #[allow(unused_mut)]
22080  20941   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22081  20942   
            let config = crate::service::RestJsonConfig::builder().build();
22082  20943   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22083         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20944  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22084  20945   
                                let sender = sender.clone();
22085  20946   
                                async move {
22086         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20947  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22087  20948   
                                    sender.send(()).await.expect("receiver dropped early");
22088  20949   
                                    result
22089  20950   
                                }
22090  20951   
                            })
22091  20952   
                            .build_unchecked();
22092  20953   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22093  20954   
                .await
22094  20955   
                .expect("unable to make an HTTP request");
22095  20956   
            ::pretty_assertions::assert_eq!(
22096  20957   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22097  20958   
                http_response.status()
22098  20959   
            );
22099  20960   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22100  20961   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22101  20962   
                http_response.headers(),
22102  20963   
                expected_headers,
22103  20964   
            ));
22104  20965   
        }
22105  20966   
    }
22106         -
    /// Malformed values in the body should be rejected
22107         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case8
       20967  +
    /// Attempted string coercion should result in SerializationException
       20968  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case12
22108  20969   
    #[::tokio::test]
22109         -
    async fn rest_json_body_short_malformed_value_rejected_case8_malformed_request() {
       20970  +
    #[::tracing_test::traced_test]
       20971  +
    async fn rest_json_path_boolean_string_coercion_case12_malformed_request() {
22110  20972   
        {
22111  20973   
            #[allow(unused_mut)]
22112  20974   
            let mut http_request = http::Request::builder()
22113         -
                .uri("/MalformedShort/1")
       20975  +
                .uri("/MalformedBoolean/FALSE")
22114  20976   
                .method("POST")
22115         -
                .header("content-type", "application/json")
22116         -
                .body(::aws_smithy_http_server::body::Body::from(
22117         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"-Infinity\" }".as_bytes()),
22118         -
                ))
       20977  +
                .body(::aws_smithy_http_server::body::Body::empty())
22119  20978   
                .unwrap();
22120  20979   
            #[allow(unused_mut)]
22121  20980   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22122  20981   
            let config = crate::service::RestJsonConfig::builder().build();
22123  20982   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22124         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       20983  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22125  20984   
                                let sender = sender.clone();
22126  20985   
                                async move {
22127         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       20986  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22128  20987   
                                    sender.send(()).await.expect("receiver dropped early");
22129  20988   
                                    result
22130  20989   
                                }
22131  20990   
                            })
22132  20991   
                            .build_unchecked();
22133  20992   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22134  20993   
                .await
22135  20994   
                .expect("unable to make an HTTP request");
22136  20995   
            ::pretty_assertions::assert_eq!(
22137  20996   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22138  20997   
                http_response.status()
22139  20998   
            );
22140  20999   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22141  21000   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22142  21001   
                http_response.headers(),
22143  21002   
                expected_headers,
22144  21003   
            ));
22145  21004   
        }
22146  21005   
    }
22147         -
    /// Malformed values in the body should be rejected
22148         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case9
       21006  +
    /// Attempted string coercion should result in SerializationException
       21007  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case13
22149  21008   
    #[::tokio::test]
22150         -
    async fn rest_json_body_short_malformed_value_rejected_case9_malformed_request() {
       21009  +
    #[::tracing_test::traced_test]
       21010  +
    async fn rest_json_path_boolean_string_coercion_case13_malformed_request() {
22151  21011   
        {
22152  21012   
            #[allow(unused_mut)]
22153  21013   
            let mut http_request = http::Request::builder()
22154         -
                .uri("/MalformedShort/1")
       21014  +
                .uri("/MalformedBoolean/n")
22155  21015   
                .method("POST")
22156         -
                .header("content-type", "application/json")
22157         -
                .body(::aws_smithy_http_server::body::Body::from(
22158         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : NaN }".as_bytes()),
22159         -
                ))
       21016  +
                .body(::aws_smithy_http_server::body::Body::empty())
22160  21017   
                .unwrap();
22161  21018   
            #[allow(unused_mut)]
22162  21019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22163  21020   
            let config = crate::service::RestJsonConfig::builder().build();
22164  21021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22165         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21022  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22166  21023   
                                let sender = sender.clone();
22167  21024   
                                async move {
22168         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21025  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22169  21026   
                                    sender.send(()).await.expect("receiver dropped early");
22170  21027   
                                    result
22171  21028   
                                }
22172  21029   
                            })
22173  21030   
                            .build_unchecked();
22174  21031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22175  21032   
                .await
22176  21033   
                .expect("unable to make an HTTP request");
22177  21034   
            ::pretty_assertions::assert_eq!(
22178  21035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22179  21036   
                http_response.status()
22180  21037   
            );
22181  21038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22182  21039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22183  21040   
                http_response.headers(),
22184  21041   
                expected_headers,
22185  21042   
            ));
22186  21043   
        }
22187  21044   
    }
22188         -
    /// Malformed values in the body should be rejected
22189         -
    /// Test ID: RestJsonBodyShortMalformedValueRejected_case10
       21045  +
    /// Attempted string coercion should result in SerializationException
       21046  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case14
22190  21047   
    #[::tokio::test]
22191         -
    async fn rest_json_body_short_malformed_value_rejected_case10_malformed_request() {
       21048  +
    #[::tracing_test::traced_test]
       21049  +
    async fn rest_json_path_boolean_string_coercion_case14_malformed_request() {
22192  21050   
        {
22193  21051   
            #[allow(unused_mut)]
22194  21052   
            let mut http_request = http::Request::builder()
22195         -
                .uri("/MalformedShort/1")
       21053  +
                .uri("/MalformedBoolean/N")
22196  21054   
                .method("POST")
22197         -
                .header("content-type", "application/json")
22198         -
                .body(::aws_smithy_http_server::body::Body::from(
22199         -
                    ::bytes::Bytes::from_static("{ \"shortInBody\" : \"NaN\" }".as_bytes()),
22200         -
                ))
       21055  +
                .body(::aws_smithy_http_server::body::Body::empty())
22201  21056   
                .unwrap();
22202  21057   
            #[allow(unused_mut)]
22203  21058   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22204  21059   
            let config = crate::service::RestJsonConfig::builder().build();
22205  21060   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22206         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21061  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22207  21062   
                                let sender = sender.clone();
22208  21063   
                                async move {
22209         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21064  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22210  21065   
                                    sender.send(()).await.expect("receiver dropped early");
22211  21066   
                                    result
22212  21067   
                                }
22213  21068   
                            })
22214  21069   
                            .build_unchecked();
22215  21070   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22216  21071   
                .await
22217  21072   
                .expect("unable to make an HTTP request");
22218  21073   
            ::pretty_assertions::assert_eq!(
22219  21074   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22220  21075   
                http_response.status()
22221  21076   
            );
22222  21077   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22223  21078   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22224  21079   
                http_response.headers(),
22225  21080   
                expected_headers,
22226  21081   
            ));
22227  21082   
        }
22228  21083   
    }
22229         -
    /// Malformed values in the path should be rejected
22230         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case0
       21084  +
    /// Attempted string coercion should result in SerializationException
       21085  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case15
22231  21086   
    #[::tokio::test]
22232         -
    async fn rest_json_path_short_malformed_value_rejected_case0_malformed_request() {
       21087  +
    #[::tracing_test::traced_test]
       21088  +
    async fn rest_json_path_boolean_string_coercion_case15_malformed_request() {
22233  21089   
        {
22234  21090   
            #[allow(unused_mut)]
22235  21091   
            let mut http_request = http::Request::builder()
22236         -
                .uri("/MalformedShort/true")
       21092  +
                .uri("/MalformedBoolean/no")
22237  21093   
                .method("POST")
22238  21094   
                .body(::aws_smithy_http_server::body::Body::empty())
22239  21095   
                .unwrap();
22240  21096   
            #[allow(unused_mut)]
22241  21097   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22242  21098   
            let config = crate::service::RestJsonConfig::builder().build();
22243  21099   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22244         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21100  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22245  21101   
                                let sender = sender.clone();
22246  21102   
                                async move {
22247         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21103  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22248  21104   
                                    sender.send(()).await.expect("receiver dropped early");
22249  21105   
                                    result
22250  21106   
                                }
22251  21107   
                            })
22252  21108   
                            .build_unchecked();
22253  21109   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22254  21110   
                .await
22255  21111   
                .expect("unable to make an HTTP request");
22256  21112   
            ::pretty_assertions::assert_eq!(
22257  21113   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22258  21114   
                http_response.status()
22259  21115   
            );
22260  21116   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22261  21117   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22262  21118   
                http_response.headers(),
22263  21119   
                expected_headers,
22264  21120   
            ));
22265  21121   
        }
22266  21122   
    }
22267         -
    /// Malformed values in the path should be rejected
22268         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case1
       21123  +
    /// Attempted string coercion should result in SerializationException
       21124  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case16
22269  21125   
    #[::tokio::test]
22270         -
    async fn rest_json_path_short_malformed_value_rejected_case1_malformed_request() {
       21126  +
    #[::tracing_test::traced_test]
       21127  +
    async fn rest_json_path_boolean_string_coercion_case16_malformed_request() {
22271  21128   
        {
22272  21129   
            #[allow(unused_mut)]
22273  21130   
            let mut http_request = http::Request::builder()
22274         -
                .uri("/MalformedShort/1.001")
       21131  +
                .uri("/MalformedBoolean/No")
22275  21132   
                .method("POST")
22276  21133   
                .body(::aws_smithy_http_server::body::Body::empty())
22277  21134   
                .unwrap();
22278  21135   
            #[allow(unused_mut)]
22279  21136   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22280  21137   
            let config = crate::service::RestJsonConfig::builder().build();
22281  21138   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22282         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21139  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22283  21140   
                                let sender = sender.clone();
22284  21141   
                                async move {
22285         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21142  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22286  21143   
                                    sender.send(()).await.expect("receiver dropped early");
22287  21144   
                                    result
22288  21145   
                                }
22289  21146   
                            })
22290  21147   
                            .build_unchecked();
22291  21148   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22292  21149   
                .await
22293  21150   
                .expect("unable to make an HTTP request");
22294  21151   
            ::pretty_assertions::assert_eq!(
22295  21152   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22296  21153   
                http_response.status()
22297  21154   
            );
22298  21155   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22299  21156   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22300  21157   
                http_response.headers(),
22301  21158   
                expected_headers,
22302  21159   
            ));
22303  21160   
        }
22304  21161   
    }
22305         -
    /// Malformed values in the path should be rejected
22306         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case2
       21162  +
    /// Attempted string coercion should result in SerializationException
       21163  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case17
22307  21164   
    #[::tokio::test]
22308         -
    async fn rest_json_path_short_malformed_value_rejected_case2_malformed_request() {
       21165  +
    #[::tracing_test::traced_test]
       21166  +
    async fn rest_json_path_boolean_string_coercion_case17_malformed_request() {
22309  21167   
        {
22310  21168   
            #[allow(unused_mut)]
22311  21169   
            let mut http_request = http::Request::builder()
22312         -
                .uri("/MalformedShort/2ABC")
       21170  +
                .uri("/MalformedBoolean/NO")
22313  21171   
                .method("POST")
22314  21172   
                .body(::aws_smithy_http_server::body::Body::empty())
22315  21173   
                .unwrap();
22316  21174   
            #[allow(unused_mut)]
22317  21175   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22318  21176   
            let config = crate::service::RestJsonConfig::builder().build();
22319  21177   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22320         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21178  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22321  21179   
                                let sender = sender.clone();
22322  21180   
                                async move {
22323         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21181  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22324  21182   
                                    sender.send(()).await.expect("receiver dropped early");
22325  21183   
                                    result
22326  21184   
                                }
22327  21185   
                            })
22328  21186   
                            .build_unchecked();
22329  21187   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22330  21188   
                .await
22331  21189   
                .expect("unable to make an HTTP request");
22332  21190   
            ::pretty_assertions::assert_eq!(
22333  21191   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22334  21192   
                http_response.status()
22335  21193   
            );
22336  21194   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22337  21195   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22338  21196   
                http_response.headers(),
22339  21197   
                expected_headers,
22340  21198   
            ));
22341  21199   
        }
22342  21200   
    }
22343         -
    /// Malformed values in the path should be rejected
22344         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case3
       21201  +
    /// Attempted string coercion should result in SerializationException
       21202  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case18
22345  21203   
    #[::tokio::test]
22346         -
    async fn rest_json_path_short_malformed_value_rejected_case3_malformed_request() {
       21204  +
    #[::tracing_test::traced_test]
       21205  +
    async fn rest_json_path_boolean_string_coercion_case18_malformed_request() {
22347  21206   
        {
22348  21207   
            #[allow(unused_mut)]
22349  21208   
            let mut http_request = http::Request::builder()
22350         -
                .uri("/MalformedShort/0x42")
       21209  +
                .uri("/MalformedBoolean/0")
22351  21210   
                .method("POST")
22352  21211   
                .body(::aws_smithy_http_server::body::Body::empty())
22353  21212   
                .unwrap();
22354  21213   
            #[allow(unused_mut)]
22355  21214   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22356  21215   
            let config = crate::service::RestJsonConfig::builder().build();
22357  21216   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22358         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21217  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22359  21218   
                                let sender = sender.clone();
22360  21219   
                                async move {
22361         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21220  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22362  21221   
                                    sender.send(()).await.expect("receiver dropped early");
22363  21222   
                                    result
22364  21223   
                                }
22365  21224   
                            })
22366  21225   
                            .build_unchecked();
22367  21226   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22368  21227   
                .await
22369  21228   
                .expect("unable to make an HTTP request");
22370  21229   
            ::pretty_assertions::assert_eq!(
22371  21230   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22372  21231   
                http_response.status()
22373  21232   
            );
22374  21233   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22375  21234   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22376  21235   
                http_response.headers(),
22377  21236   
                expected_headers,
22378  21237   
            ));
22379  21238   
        }
22380  21239   
    }
22381         -
    /// Malformed values in the path should be rejected
22382         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case4
       21240  +
    /// Attempted string coercion should result in SerializationException
       21241  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case19
22383  21242   
    #[::tokio::test]
22384         -
    async fn rest_json_path_short_malformed_value_rejected_case4_malformed_request() {
       21243  +
    #[::tracing_test::traced_test]
       21244  +
    async fn rest_json_path_boolean_string_coercion_case19_malformed_request() {
22385  21245   
        {
22386  21246   
            #[allow(unused_mut)]
22387  21247   
            let mut http_request = http::Request::builder()
22388         -
                .uri("/MalformedShort/Infinity")
       21248  +
                .uri("/MalformedBoolean/off")
22389  21249   
                .method("POST")
22390  21250   
                .body(::aws_smithy_http_server::body::Body::empty())
22391  21251   
                .unwrap();
22392  21252   
            #[allow(unused_mut)]
22393  21253   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22394  21254   
            let config = crate::service::RestJsonConfig::builder().build();
22395  21255   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22396         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21256  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22397  21257   
                                let sender = sender.clone();
22398  21258   
                                async move {
22399         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21259  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22400  21260   
                                    sender.send(()).await.expect("receiver dropped early");
22401  21261   
                                    result
22402  21262   
                                }
22403  21263   
                            })
22404  21264   
                            .build_unchecked();
22405  21265   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22406  21266   
                .await
22407  21267   
                .expect("unable to make an HTTP request");
22408  21268   
            ::pretty_assertions::assert_eq!(
22409  21269   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22410  21270   
                http_response.status()
22411  21271   
            );
22412  21272   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22413  21273   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22414  21274   
                http_response.headers(),
22415  21275   
                expected_headers,
22416  21276   
            ));
22417  21277   
        }
22418  21278   
    }
22419         -
    /// Malformed values in the path should be rejected
22420         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case5
       21279  +
    /// Attempted string coercion should result in SerializationException
       21280  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case20
22421  21281   
    #[::tokio::test]
22422         -
    async fn rest_json_path_short_malformed_value_rejected_case5_malformed_request() {
       21282  +
    #[::tracing_test::traced_test]
       21283  +
    async fn rest_json_path_boolean_string_coercion_case20_malformed_request() {
22423  21284   
        {
22424  21285   
            #[allow(unused_mut)]
22425  21286   
            let mut http_request = http::Request::builder()
22426         -
                .uri("/MalformedShort/-Infinity")
       21287  +
                .uri("/MalformedBoolean/Off")
22427  21288   
                .method("POST")
22428  21289   
                .body(::aws_smithy_http_server::body::Body::empty())
22429  21290   
                .unwrap();
22430  21291   
            #[allow(unused_mut)]
22431  21292   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22432  21293   
            let config = crate::service::RestJsonConfig::builder().build();
22433  21294   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22434         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21295  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22435  21296   
                                let sender = sender.clone();
22436  21297   
                                async move {
22437         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21298  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22438  21299   
                                    sender.send(()).await.expect("receiver dropped early");
22439  21300   
                                    result
22440  21301   
                                }
22441  21302   
                            })
22442  21303   
                            .build_unchecked();
22443  21304   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22444  21305   
                .await
22445  21306   
                .expect("unable to make an HTTP request");
22446  21307   
            ::pretty_assertions::assert_eq!(
22447  21308   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22448  21309   
                http_response.status()
22449  21310   
            );
22450  21311   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22451  21312   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22452  21313   
                http_response.headers(),
22453  21314   
                expected_headers,
22454  21315   
            ));
22455  21316   
        }
22456  21317   
    }
22457         -
    /// Malformed values in the path should be rejected
22458         -
    /// Test ID: RestJsonPathShortMalformedValueRejected_case6
       21318  +
    /// Attempted string coercion should result in SerializationException
       21319  +
    /// Test ID: RestJsonPathBooleanStringCoercion_case21
22459  21320   
    #[::tokio::test]
22460         -
    async fn rest_json_path_short_malformed_value_rejected_case6_malformed_request() {
       21321  +
    #[::tracing_test::traced_test]
       21322  +
    async fn rest_json_path_boolean_string_coercion_case21_malformed_request() {
22461  21323   
        {
22462  21324   
            #[allow(unused_mut)]
22463  21325   
            let mut http_request = http::Request::builder()
22464         -
                .uri("/MalformedShort/NaN")
       21326  +
                .uri("/MalformedBoolean/OFF")
22465  21327   
                .method("POST")
22466  21328   
                .body(::aws_smithy_http_server::body::Body::empty())
22467  21329   
                .unwrap();
22468  21330   
            #[allow(unused_mut)]
22469  21331   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22470  21332   
            let config = crate::service::RestJsonConfig::builder().build();
22471  21333   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22472         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21334  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22473  21335   
                                let sender = sender.clone();
22474  21336   
                                async move {
22475         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21337  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22476  21338   
                                    sender.send(()).await.expect("receiver dropped early");
22477  21339   
                                    result
22478  21340   
                                }
22479  21341   
                            })
22480  21342   
                            .build_unchecked();
22481  21343   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22482  21344   
                .await
22483  21345   
                .expect("unable to make an HTTP request");
22484  21346   
            ::pretty_assertions::assert_eq!(
22485  21347   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22486  21348   
                http_response.status()
22487  21349   
            );
22488  21350   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22489  21351   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22490  21352   
                http_response.headers(),
22491  21353   
                expected_headers,
22492  21354   
            ));
22493  21355   
        }
22494  21356   
    }
22495         -
    /// Malformed values in query parameters should be rejected
22496         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case0
       21357  +
    /// Attempted string coercion should result in SerializationException
       21358  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case0
22497  21359   
    #[::tokio::test]
22498         -
    async fn rest_json_query_short_malformed_value_rejected_case0_malformed_request() {
       21360  +
    #[::tracing_test::traced_test]
       21361  +
    async fn rest_json_query_boolean_string_coercion_case0_malformed_request() {
22499  21362   
        {
22500  21363   
            #[allow(unused_mut)]
22501  21364   
            let mut http_request = http::Request::builder()
22502         -
                .uri("/MalformedShort/1")
       21365  +
                .uri("/MalformedBoolean/true")
22503  21366   
                .method("POST")
22504  21367   
                .body(::aws_smithy_http_server::body::Body::empty())
22505  21368   
                .unwrap();
22506         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=true".parse().unwrap();
       21369  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=True"
       21370  +
                .parse()
       21371  +
                .unwrap();
22507  21372   
            #[allow(unused_mut)]
22508  21373   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22509  21374   
            let config = crate::service::RestJsonConfig::builder().build();
22510  21375   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22511         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21376  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22512  21377   
                                let sender = sender.clone();
22513  21378   
                                async move {
22514         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21379  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22515  21380   
                                    sender.send(()).await.expect("receiver dropped early");
22516  21381   
                                    result
22517  21382   
                                }
22518  21383   
                            })
22519  21384   
                            .build_unchecked();
22520  21385   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22521  21386   
                .await
22522  21387   
                .expect("unable to make an HTTP request");
22523  21388   
            ::pretty_assertions::assert_eq!(
22524  21389   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22525  21390   
                http_response.status()
22526  21391   
            );
22527  21392   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22528  21393   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22529  21394   
                http_response.headers(),
22530  21395   
                expected_headers,
22531  21396   
            ));
22532  21397   
        }
22533  21398   
    }
22534         -
    /// Malformed values in query parameters should be rejected
22535         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case1
       21399  +
    /// Attempted string coercion should result in SerializationException
       21400  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case1
22536  21401   
    #[::tokio::test]
22537         -
    async fn rest_json_query_short_malformed_value_rejected_case1_malformed_request() {
       21402  +
    #[::tracing_test::traced_test]
       21403  +
    async fn rest_json_query_boolean_string_coercion_case1_malformed_request() {
22538  21404   
        {
22539  21405   
            #[allow(unused_mut)]
22540  21406   
            let mut http_request = http::Request::builder()
22541         -
                .uri("/MalformedShort/1")
       21407  +
                .uri("/MalformedBoolean/true")
22542  21408   
                .method("POST")
22543  21409   
                .body(::aws_smithy_http_server::body::Body::empty())
22544  21410   
                .unwrap();
22545         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=1.001".parse().unwrap();
       21411  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=TRUE"
       21412  +
                .parse()
       21413  +
                .unwrap();
22546  21414   
            #[allow(unused_mut)]
22547  21415   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22548  21416   
            let config = crate::service::RestJsonConfig::builder().build();
22549  21417   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22550         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21418  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22551  21419   
                                let sender = sender.clone();
22552  21420   
                                async move {
22553         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21421  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22554  21422   
                                    sender.send(()).await.expect("receiver dropped early");
22555  21423   
                                    result
22556  21424   
                                }
22557  21425   
                            })
22558  21426   
                            .build_unchecked();
22559  21427   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22560  21428   
                .await
22561  21429   
                .expect("unable to make an HTTP request");
22562  21430   
            ::pretty_assertions::assert_eq!(
22563  21431   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22564  21432   
                http_response.status()
22565  21433   
            );
22566  21434   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22567  21435   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22568  21436   
                http_response.headers(),
22569  21437   
                expected_headers,
22570  21438   
            ));
22571  21439   
        }
22572  21440   
    }
22573         -
    /// Malformed values in query parameters should be rejected
22574         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case2
       21441  +
    /// Attempted string coercion should result in SerializationException
       21442  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case2
22575  21443   
    #[::tokio::test]
22576         -
    async fn rest_json_query_short_malformed_value_rejected_case2_malformed_request() {
       21444  +
    #[::tracing_test::traced_test]
       21445  +
    async fn rest_json_query_boolean_string_coercion_case2_malformed_request() {
22577  21446   
        {
22578  21447   
            #[allow(unused_mut)]
22579  21448   
            let mut http_request = http::Request::builder()
22580         -
                .uri("/MalformedShort/1")
       21449  +
                .uri("/MalformedBoolean/true")
22581  21450   
                .method("POST")
22582  21451   
                .body(::aws_smithy_http_server::body::Body::empty())
22583  21452   
                .unwrap();
22584         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=2ABC".parse().unwrap();
       21453  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=y".parse().unwrap();
22585  21454   
            #[allow(unused_mut)]
22586  21455   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22587  21456   
            let config = crate::service::RestJsonConfig::builder().build();
22588  21457   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22589         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21458  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22590  21459   
                                let sender = sender.clone();
22591  21460   
                                async move {
22592         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21461  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22593  21462   
                                    sender.send(()).await.expect("receiver dropped early");
22594  21463   
                                    result
22595  21464   
                                }
22596  21465   
                            })
22597  21466   
                            .build_unchecked();
22598  21467   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22599  21468   
                .await
22600  21469   
                .expect("unable to make an HTTP request");
22601  21470   
            ::pretty_assertions::assert_eq!(
22602  21471   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22603  21472   
                http_response.status()
22604  21473   
            );
22605  21474   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22606  21475   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22607  21476   
                http_response.headers(),
22608  21477   
                expected_headers,
22609  21478   
            ));
22610  21479   
        }
22611  21480   
    }
22612         -
    /// Malformed values in query parameters should be rejected
22613         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case3
       21481  +
    /// Attempted string coercion should result in SerializationException
       21482  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case3
22614  21483   
    #[::tokio::test]
22615         -
    async fn rest_json_query_short_malformed_value_rejected_case3_malformed_request() {
       21484  +
    #[::tracing_test::traced_test]
       21485  +
    async fn rest_json_query_boolean_string_coercion_case3_malformed_request() {
22616  21486   
        {
22617  21487   
            #[allow(unused_mut)]
22618  21488   
            let mut http_request = http::Request::builder()
22619         -
                .uri("/MalformedShort/1")
       21489  +
                .uri("/MalformedBoolean/true")
22620  21490   
                .method("POST")
22621  21491   
                .body(::aws_smithy_http_server::body::Body::empty())
22622  21492   
                .unwrap();
22623         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=0x42".parse().unwrap();
       21493  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Y".parse().unwrap();
22624  21494   
            #[allow(unused_mut)]
22625  21495   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22626  21496   
            let config = crate::service::RestJsonConfig::builder().build();
22627  21497   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22628         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21498  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22629  21499   
                                let sender = sender.clone();
22630  21500   
                                async move {
22631         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21501  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22632  21502   
                                    sender.send(()).await.expect("receiver dropped early");
22633  21503   
                                    result
22634  21504   
                                }
22635  21505   
                            })
22636  21506   
                            .build_unchecked();
22637  21507   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22638  21508   
                .await
22639  21509   
                .expect("unable to make an HTTP request");
22640  21510   
            ::pretty_assertions::assert_eq!(
22641  21511   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22642  21512   
                http_response.status()
22643  21513   
            );
22644  21514   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22645  21515   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22646  21516   
                http_response.headers(),
22647  21517   
                expected_headers,
22648  21518   
            ));
22649  21519   
        }
22650  21520   
    }
22651         -
    /// Malformed values in query parameters should be rejected
22652         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case4
       21521  +
    /// Attempted string coercion should result in SerializationException
       21522  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case4
22653  21523   
    #[::tokio::test]
22654         -
    async fn rest_json_query_short_malformed_value_rejected_case4_malformed_request() {
       21524  +
    #[::tracing_test::traced_test]
       21525  +
    async fn rest_json_query_boolean_string_coercion_case4_malformed_request() {
22655  21526   
        {
22656  21527   
            #[allow(unused_mut)]
22657  21528   
            let mut http_request = http::Request::builder()
22658         -
                .uri("/MalformedShort/1")
       21529  +
                .uri("/MalformedBoolean/true")
22659  21530   
                .method("POST")
22660  21531   
                .body(::aws_smithy_http_server::body::Body::empty())
22661  21532   
                .unwrap();
22662         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=Infinity".parse().unwrap();
       21533  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=yes".parse().unwrap();
22663  21534   
            #[allow(unused_mut)]
22664  21535   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22665  21536   
            let config = crate::service::RestJsonConfig::builder().build();
22666  21537   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22667         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21538  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22668  21539   
                                let sender = sender.clone();
22669  21540   
                                async move {
22670         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21541  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22671  21542   
                                    sender.send(()).await.expect("receiver dropped early");
22672  21543   
                                    result
22673  21544   
                                }
22674  21545   
                            })
22675  21546   
                            .build_unchecked();
22676  21547   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22677  21548   
                .await
22678  21549   
                .expect("unable to make an HTTP request");
22679  21550   
            ::pretty_assertions::assert_eq!(
22680  21551   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22681  21552   
                http_response.status()
22682  21553   
            );
22683  21554   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22684  21555   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22685  21556   
                http_response.headers(),
22686  21557   
                expected_headers,
22687  21558   
            ));
22688  21559   
        }
22689  21560   
    }
22690         -
    /// Malformed values in query parameters should be rejected
22691         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case5
       21561  +
    /// Attempted string coercion should result in SerializationException
       21562  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case5
22692  21563   
    #[::tokio::test]
22693         -
    async fn rest_json_query_short_malformed_value_rejected_case5_malformed_request() {
       21564  +
    #[::tracing_test::traced_test]
       21565  +
    async fn rest_json_query_boolean_string_coercion_case5_malformed_request() {
22694  21566   
        {
22695  21567   
            #[allow(unused_mut)]
22696  21568   
            let mut http_request = http::Request::builder()
22697         -
                .uri("/MalformedShort/1")
       21569  +
                .uri("/MalformedBoolean/true")
22698  21570   
                .method("POST")
22699  21571   
                .body(::aws_smithy_http_server::body::Body::empty())
22700  21572   
                .unwrap();
22701         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=-Infinity".parse().unwrap();
       21573  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Yes".parse().unwrap();
22702  21574   
            #[allow(unused_mut)]
22703  21575   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22704  21576   
            let config = crate::service::RestJsonConfig::builder().build();
22705  21577   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22706         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21578  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22707  21579   
                                let sender = sender.clone();
22708  21580   
                                async move {
22709         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21581  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22710  21582   
                                    sender.send(()).await.expect("receiver dropped early");
22711  21583   
                                    result
22712  21584   
                                }
22713  21585   
                            })
22714  21586   
                            .build_unchecked();
22715  21587   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22716  21588   
                .await
22717  21589   
                .expect("unable to make an HTTP request");
22718  21590   
            ::pretty_assertions::assert_eq!(
22719  21591   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22720  21592   
                http_response.status()
22721  21593   
            );
22722  21594   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22723  21595   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22724  21596   
                http_response.headers(),
22725  21597   
                expected_headers,
22726  21598   
            ));
22727  21599   
        }
22728  21600   
    }
22729         -
    /// Malformed values in query parameters should be rejected
22730         -
    /// Test ID: RestJsonQueryShortMalformedValueRejected_case6
       21601  +
    /// Attempted string coercion should result in SerializationException
       21602  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case6
22731  21603   
    #[::tokio::test]
22732         -
    async fn rest_json_query_short_malformed_value_rejected_case6_malformed_request() {
       21604  +
    #[::tracing_test::traced_test]
       21605  +
    async fn rest_json_query_boolean_string_coercion_case6_malformed_request() {
22733  21606   
        {
22734  21607   
            #[allow(unused_mut)]
22735  21608   
            let mut http_request = http::Request::builder()
22736         -
                .uri("/MalformedShort/1")
       21609  +
                .uri("/MalformedBoolean/true")
22737  21610   
                .method("POST")
22738  21611   
                .body(::aws_smithy_http_server::body::Body::empty())
22739  21612   
                .unwrap();
22740         -
            *http_request.uri_mut() = "/MalformedShort/1?shortInQuery=NaN".parse().unwrap();
       21613  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=YES".parse().unwrap();
22741  21614   
            #[allow(unused_mut)]
22742  21615   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22743  21616   
            let config = crate::service::RestJsonConfig::builder().build();
22744  21617   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22745         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21618  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22746  21619   
                                let sender = sender.clone();
22747  21620   
                                async move {
22748         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21621  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22749  21622   
                                    sender.send(()).await.expect("receiver dropped early");
22750  21623   
                                    result
22751  21624   
                                }
22752  21625   
                            })
22753  21626   
                            .build_unchecked();
22754  21627   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22755  21628   
                .await
22756  21629   
                .expect("unable to make an HTTP request");
22757  21630   
            ::pretty_assertions::assert_eq!(
22758  21631   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22759  21632   
                http_response.status()
22760  21633   
            );
22761  21634   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22762  21635   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22763  21636   
                http_response.headers(),
22764  21637   
                expected_headers,
22765  21638   
            ));
22766  21639   
        }
22767  21640   
    }
22768         -
    /// Malformed values in headers should be rejected
22769         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case0
       21641  +
    /// Attempted string coercion should result in SerializationException
       21642  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case7
22770  21643   
    #[::tokio::test]
22771         -
    async fn rest_json_header_short_malformed_value_rejected_case0_malformed_request() {
       21644  +
    #[::tracing_test::traced_test]
       21645  +
    async fn rest_json_query_boolean_string_coercion_case7_malformed_request() {
22772  21646   
        {
22773  21647   
            #[allow(unused_mut)]
22774  21648   
            let mut http_request = http::Request::builder()
22775         -
                .uri("/MalformedShort/1")
       21649  +
                .uri("/MalformedBoolean/true")
22776  21650   
                .method("POST")
22777         -
                .header("shortInHeader", "true")
22778  21651   
                .body(::aws_smithy_http_server::body::Body::empty())
22779  21652   
                .unwrap();
       21653  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=1".parse().unwrap();
22780  21654   
            #[allow(unused_mut)]
22781  21655   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22782  21656   
            let config = crate::service::RestJsonConfig::builder().build();
22783  21657   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22784         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21658  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22785  21659   
                                let sender = sender.clone();
22786  21660   
                                async move {
22787         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21661  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22788  21662   
                                    sender.send(()).await.expect("receiver dropped early");
22789  21663   
                                    result
22790  21664   
                                }
22791  21665   
                            })
22792  21666   
                            .build_unchecked();
22793  21667   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22794  21668   
                .await
22795  21669   
                .expect("unable to make an HTTP request");
22796  21670   
            ::pretty_assertions::assert_eq!(
22797  21671   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22798  21672   
                http_response.status()
22799  21673   
            );
22800  21674   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22801  21675   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22802  21676   
                http_response.headers(),
22803  21677   
                expected_headers,
22804  21678   
            ));
22805  21679   
        }
22806  21680   
    }
22807         -
    /// Malformed values in headers should be rejected
22808         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case1
       21681  +
    /// Attempted string coercion should result in SerializationException
       21682  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case8
22809  21683   
    #[::tokio::test]
22810         -
    async fn rest_json_header_short_malformed_value_rejected_case1_malformed_request() {
       21684  +
    #[::tracing_test::traced_test]
       21685  +
    async fn rest_json_query_boolean_string_coercion_case8_malformed_request() {
22811  21686   
        {
22812  21687   
            #[allow(unused_mut)]
22813  21688   
            let mut http_request = http::Request::builder()
22814         -
                .uri("/MalformedShort/1")
       21689  +
                .uri("/MalformedBoolean/true")
22815  21690   
                .method("POST")
22816         -
                .header("shortInHeader", "1.001")
22817  21691   
                .body(::aws_smithy_http_server::body::Body::empty())
22818  21692   
                .unwrap();
       21693  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=on".parse().unwrap();
22819  21694   
            #[allow(unused_mut)]
22820  21695   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22821  21696   
            let config = crate::service::RestJsonConfig::builder().build();
22822  21697   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22823         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21698  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22824  21699   
                                let sender = sender.clone();
22825  21700   
                                async move {
22826         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21701  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22827  21702   
                                    sender.send(()).await.expect("receiver dropped early");
22828  21703   
                                    result
22829  21704   
                                }
22830  21705   
                            })
22831  21706   
                            .build_unchecked();
22832  21707   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22833  21708   
                .await
22834  21709   
                .expect("unable to make an HTTP request");
22835  21710   
            ::pretty_assertions::assert_eq!(
22836  21711   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22837  21712   
                http_response.status()
22838  21713   
            );
22839  21714   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22840  21715   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22841  21716   
                http_response.headers(),
22842  21717   
                expected_headers,
22843  21718   
            ));
22844  21719   
        }
22845  21720   
    }
22846         -
    /// Malformed values in headers should be rejected
22847         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case2
       21721  +
    /// Attempted string coercion should result in SerializationException
       21722  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case9
22848  21723   
    #[::tokio::test]
22849         -
    async fn rest_json_header_short_malformed_value_rejected_case2_malformed_request() {
       21724  +
    #[::tracing_test::traced_test]
       21725  +
    async fn rest_json_query_boolean_string_coercion_case9_malformed_request() {
22850  21726   
        {
22851  21727   
            #[allow(unused_mut)]
22852  21728   
            let mut http_request = http::Request::builder()
22853         -
                .uri("/MalformedShort/1")
       21729  +
                .uri("/MalformedBoolean/true")
22854  21730   
                .method("POST")
22855         -
                .header("shortInHeader", "2ABC")
22856  21731   
                .body(::aws_smithy_http_server::body::Body::empty())
22857  21732   
                .unwrap();
       21733  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=On".parse().unwrap();
22858  21734   
            #[allow(unused_mut)]
22859  21735   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22860  21736   
            let config = crate::service::RestJsonConfig::builder().build();
22861  21737   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22862         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21738  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22863  21739   
                                let sender = sender.clone();
22864  21740   
                                async move {
22865         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21741  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22866  21742   
                                    sender.send(()).await.expect("receiver dropped early");
22867  21743   
                                    result
22868  21744   
                                }
22869  21745   
                            })
22870  21746   
                            .build_unchecked();
22871  21747   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22872  21748   
                .await
22873  21749   
                .expect("unable to make an HTTP request");
22874  21750   
            ::pretty_assertions::assert_eq!(
22875  21751   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22876  21752   
                http_response.status()
22877  21753   
            );
22878  21754   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22879  21755   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22880  21756   
                http_response.headers(),
22881  21757   
                expected_headers,
22882  21758   
            ));
22883  21759   
        }
22884  21760   
    }
22885         -
    /// Malformed values in headers should be rejected
22886         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case3
       21761  +
    /// Attempted string coercion should result in SerializationException
       21762  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case10
22887  21763   
    #[::tokio::test]
22888         -
    async fn rest_json_header_short_malformed_value_rejected_case3_malformed_request() {
       21764  +
    #[::tracing_test::traced_test]
       21765  +
    async fn rest_json_query_boolean_string_coercion_case10_malformed_request() {
22889  21766   
        {
22890  21767   
            #[allow(unused_mut)]
22891  21768   
            let mut http_request = http::Request::builder()
22892         -
                .uri("/MalformedShort/1")
       21769  +
                .uri("/MalformedBoolean/true")
22893  21770   
                .method("POST")
22894         -
                .header("shortInHeader", "0x42")
22895  21771   
                .body(::aws_smithy_http_server::body::Body::empty())
22896  21772   
                .unwrap();
       21773  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=ON".parse().unwrap();
22897  21774   
            #[allow(unused_mut)]
22898  21775   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22899  21776   
            let config = crate::service::RestJsonConfig::builder().build();
22900  21777   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22901         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21778  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22902  21779   
                                let sender = sender.clone();
22903  21780   
                                async move {
22904         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21781  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22905  21782   
                                    sender.send(()).await.expect("receiver dropped early");
22906  21783   
                                    result
22907  21784   
                                }
22908  21785   
                            })
22909  21786   
                            .build_unchecked();
22910  21787   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22911  21788   
                .await
22912  21789   
                .expect("unable to make an HTTP request");
22913  21790   
            ::pretty_assertions::assert_eq!(
22914  21791   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22915  21792   
                http_response.status()
22916  21793   
            );
22917  21794   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22918  21795   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22919  21796   
                http_response.headers(),
22920  21797   
                expected_headers,
22921  21798   
            ));
22922  21799   
        }
22923  21800   
    }
22924         -
    /// Malformed values in headers should be rejected
22925         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case4
       21801  +
    /// Attempted string coercion should result in SerializationException
       21802  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case11
22926  21803   
    #[::tokio::test]
22927         -
    async fn rest_json_header_short_malformed_value_rejected_case4_malformed_request() {
       21804  +
    #[::tracing_test::traced_test]
       21805  +
    async fn rest_json_query_boolean_string_coercion_case11_malformed_request() {
22928  21806   
        {
22929  21807   
            #[allow(unused_mut)]
22930  21808   
            let mut http_request = http::Request::builder()
22931         -
                .uri("/MalformedShort/1")
       21809  +
                .uri("/MalformedBoolean/true")
22932  21810   
                .method("POST")
22933         -
                .header("shortInHeader", "Infinity")
22934  21811   
                .body(::aws_smithy_http_server::body::Body::empty())
22935  21812   
                .unwrap();
22936         -
            #[allow(unused_mut)]
22937         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       21813  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=False"
       21814  +
                .parse()
       21815  +
                .unwrap();
       21816  +
            #[allow(unused_mut)]
       21817  +
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22938  21818   
            let config = crate::service::RestJsonConfig::builder().build();
22939  21819   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22940         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21820  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22941  21821   
                                let sender = sender.clone();
22942  21822   
                                async move {
22943         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21823  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22944  21824   
                                    sender.send(()).await.expect("receiver dropped early");
22945  21825   
                                    result
22946  21826   
                                }
22947  21827   
                            })
22948  21828   
                            .build_unchecked();
22949  21829   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22950  21830   
                .await
22951  21831   
                .expect("unable to make an HTTP request");
22952  21832   
            ::pretty_assertions::assert_eq!(
22953  21833   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22954  21834   
                http_response.status()
22955  21835   
            );
22956  21836   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22957  21837   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22958  21838   
                http_response.headers(),
22959  21839   
                expected_headers,
22960  21840   
            ));
22961  21841   
        }
22962  21842   
    }
22963         -
    /// Malformed values in headers should be rejected
22964         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case5
       21843  +
    /// Attempted string coercion should result in SerializationException
       21844  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case12
22965  21845   
    #[::tokio::test]
22966         -
    async fn rest_json_header_short_malformed_value_rejected_case5_malformed_request() {
       21846  +
    #[::tracing_test::traced_test]
       21847  +
    async fn rest_json_query_boolean_string_coercion_case12_malformed_request() {
22967  21848   
        {
22968  21849   
            #[allow(unused_mut)]
22969  21850   
            let mut http_request = http::Request::builder()
22970         -
                .uri("/MalformedShort/1")
       21851  +
                .uri("/MalformedBoolean/true")
22971  21852   
                .method("POST")
22972         -
                .header("shortInHeader", "-Infinity")
22973  21853   
                .body(::aws_smithy_http_server::body::Body::empty())
22974  21854   
                .unwrap();
       21855  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=FALSE"
       21856  +
                .parse()
       21857  +
                .unwrap();
22975  21858   
            #[allow(unused_mut)]
22976  21859   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
22977  21860   
            let config = crate::service::RestJsonConfig::builder().build();
22978  21861   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
22979         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21862  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
22980  21863   
                                let sender = sender.clone();
22981  21864   
                                async move {
22982         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21865  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
22983  21866   
                                    sender.send(()).await.expect("receiver dropped early");
22984  21867   
                                    result
22985  21868   
                                }
22986  21869   
                            })
22987  21870   
                            .build_unchecked();
22988  21871   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
22989  21872   
                .await
22990  21873   
                .expect("unable to make an HTTP request");
22991  21874   
            ::pretty_assertions::assert_eq!(
22992  21875   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
22993  21876   
                http_response.status()
22994  21877   
            );
22995  21878   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
22996  21879   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
22997  21880   
                http_response.headers(),
22998  21881   
                expected_headers,
22999  21882   
            ));
23000  21883   
        }
23001  21884   
    }
23002         -
    /// Malformed values in headers should be rejected
23003         -
    /// Test ID: RestJsonHeaderShortMalformedValueRejected_case6
       21885  +
    /// Attempted string coercion should result in SerializationException
       21886  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case13
23004  21887   
    #[::tokio::test]
23005         -
    async fn rest_json_header_short_malformed_value_rejected_case6_malformed_request() {
       21888  +
    #[::tracing_test::traced_test]
       21889  +
    async fn rest_json_query_boolean_string_coercion_case13_malformed_request() {
23006  21890   
        {
23007  21891   
            #[allow(unused_mut)]
23008  21892   
            let mut http_request = http::Request::builder()
23009         -
                .uri("/MalformedShort/1")
       21893  +
                .uri("/MalformedBoolean/true")
23010  21894   
                .method("POST")
23011         -
                .header("shortInHeader", "NaN")
23012  21895   
                .body(::aws_smithy_http_server::body::Body::empty())
23013  21896   
                .unwrap();
       21897  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=n".parse().unwrap();
23014  21898   
            #[allow(unused_mut)]
23015  21899   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23016  21900   
            let config = crate::service::RestJsonConfig::builder().build();
23017  21901   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23018         -
                            .malformed_short(move |input: crate::input::MalformedShortInput| {
       21902  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23019  21903   
                                let sender = sender.clone();
23020  21904   
                                async move {
23021         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedShortOutput, crate::error::MalformedShortError> };
       21905  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23022  21906   
                                    sender.send(()).await.expect("receiver dropped early");
23023  21907   
                                    result
23024  21908   
                                }
23025  21909   
                            })
23026  21910   
                            .build_unchecked();
23027  21911   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23028  21912   
                .await
23029  21913   
                .expect("unable to make an HTTP request");
23030  21914   
            ::pretty_assertions::assert_eq!(
23031  21915   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23032  21916   
                http_response.status()
23033  21917   
            );
23034  21918   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23035  21919   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23036  21920   
                http_response.headers(),
23037  21921   
                expected_headers,
23038  21922   
            ));
23039  21923   
        }
23040  21924   
    }
23041         -
}
23042         -
#[cfg(test)]
23043         -
#[allow(unreachable_code, unused_variables)]
23044         -
mod server_malformed_string_test {
23045         -
    /// When string with the mediaType trait is bound to a header, its value
23046         -
    /// must be base64 encoded. The server should reject values that aren't
23047         -
    /// valid base64 out of hand.
23048         -
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case0
       21925  +
    /// Attempted string coercion should result in SerializationException
       21926  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case14
23049  21927   
    #[::tokio::test]
23050         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case0_malformed_request() {
       21928  +
    #[::tracing_test::traced_test]
       21929  +
    async fn rest_json_query_boolean_string_coercion_case14_malformed_request() {
23051  21930   
        {
23052  21931   
            #[allow(unused_mut)]
23053  21932   
            let mut http_request = http::Request::builder()
23054         -
                .uri("/MalformedString")
       21933  +
                .uri("/MalformedBoolean/true")
23055  21934   
                .method("POST")
23056         -
                .header("content-type", "application/json")
23057         -
                .header("amz-media-typed-header", "xyz")
23058  21935   
                .body(::aws_smithy_http_server::body::Body::empty())
23059  21936   
                .unwrap();
       21937  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=N".parse().unwrap();
23060  21938   
            #[allow(unused_mut)]
23061  21939   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23062  21940   
            let config = crate::service::RestJsonConfig::builder().build();
23063  21941   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23064         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       21942  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23065  21943   
                                let sender = sender.clone();
23066  21944   
                                async move {
23067         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       21945  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23068  21946   
                                    sender.send(()).await.expect("receiver dropped early");
23069  21947   
                                    result
23070  21948   
                                }
23071  21949   
                            })
23072  21950   
                            .build_unchecked();
23073  21951   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23074  21952   
                .await
23075  21953   
                .expect("unable to make an HTTP request");
23076  21954   
            ::pretty_assertions::assert_eq!(
23077  21955   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23078  21956   
                http_response.status()
23079  21957   
            );
23080  21958   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23081  21959   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23082  21960   
                http_response.headers(),
23083  21961   
                expected_headers,
23084  21962   
            ));
23085  21963   
        }
23086  21964   
    }
23087         -
    /// When string with the mediaType trait is bound to a header, its value
23088         -
    /// must be base64 encoded. The server should reject values that aren't
23089         -
    /// valid base64 out of hand.
23090         -
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case1
       21965  +
    /// Attempted string coercion should result in SerializationException
       21966  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case15
23091  21967   
    #[::tokio::test]
23092         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case1_malformed_request() {
       21968  +
    #[::tracing_test::traced_test]
       21969  +
    async fn rest_json_query_boolean_string_coercion_case15_malformed_request() {
23093  21970   
        {
23094  21971   
            #[allow(unused_mut)]
23095  21972   
            let mut http_request = http::Request::builder()
23096         -
                .uri("/MalformedString")
       21973  +
                .uri("/MalformedBoolean/true")
23097  21974   
                .method("POST")
23098         -
                .header("content-type", "application/json")
23099         -
                .header("amz-media-typed-header", "YmxvYg=")
23100  21975   
                .body(::aws_smithy_http_server::body::Body::empty())
23101  21976   
                .unwrap();
       21977  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=no".parse().unwrap();
23102  21978   
            #[allow(unused_mut)]
23103  21979   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23104  21980   
            let config = crate::service::RestJsonConfig::builder().build();
23105  21981   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23106         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       21982  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23107  21983   
                                let sender = sender.clone();
23108  21984   
                                async move {
23109         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       21985  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23110  21986   
                                    sender.send(()).await.expect("receiver dropped early");
23111  21987   
                                    result
23112  21988   
                                }
23113  21989   
                            })
23114  21990   
                            .build_unchecked();
23115  21991   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23116  21992   
                .await
23117  21993   
                .expect("unable to make an HTTP request");
23118  21994   
            ::pretty_assertions::assert_eq!(
23119  21995   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23120  21996   
                http_response.status()
23121  21997   
            );
23122  21998   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23123  21999   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23124  22000   
                http_response.headers(),
23125  22001   
                expected_headers,
23126  22002   
            ));
23127  22003   
        }
23128  22004   
    }
23129         -
    /// When string with the mediaType trait is bound to a header, its value
23130         -
    /// must be base64 encoded. The server should reject values that aren't
23131         -
    /// valid base64 out of hand.
23132         -
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case2
       22005  +
    /// Attempted string coercion should result in SerializationException
       22006  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case16
23133  22007   
    #[::tokio::test]
23134         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case2_malformed_request() {
       22008  +
    #[::tracing_test::traced_test]
       22009  +
    async fn rest_json_query_boolean_string_coercion_case16_malformed_request() {
23135  22010   
        {
23136  22011   
            #[allow(unused_mut)]
23137  22012   
            let mut http_request = http::Request::builder()
23138         -
                .uri("/MalformedString")
       22013  +
                .uri("/MalformedBoolean/true")
23139  22014   
                .method("POST")
23140         -
                .header("content-type", "application/json")
23141         -
                .header("amz-media-typed-header", "[][]")
23142  22015   
                .body(::aws_smithy_http_server::body::Body::empty())
23143  22016   
                .unwrap();
       22017  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=No".parse().unwrap();
23144  22018   
            #[allow(unused_mut)]
23145  22019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23146  22020   
            let config = crate::service::RestJsonConfig::builder().build();
23147  22021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23148         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       22022  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23149  22023   
                                let sender = sender.clone();
23150  22024   
                                async move {
23151         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       22025  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23152  22026   
                                    sender.send(()).await.expect("receiver dropped early");
23153  22027   
                                    result
23154  22028   
                                }
23155  22029   
                            })
23156  22030   
                            .build_unchecked();
23157  22031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23158  22032   
                .await
23159  22033   
                .expect("unable to make an HTTP request");
23160  22034   
            ::pretty_assertions::assert_eq!(
23161  22035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23162  22036   
                http_response.status()
23163  22037   
            );
23164  22038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23165  22039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23166  22040   
                http_response.headers(),
23167  22041   
                expected_headers,
23168  22042   
            ));
23169  22043   
        }
23170  22044   
    }
23171         -
    /// When string with the mediaType trait is bound to a header, its value
23172         -
    /// must be base64 encoded. The server should reject values that aren't
23173         -
    /// valid base64 out of hand.
23174         -
    /// Test ID: RestJsonHeaderMalformedStringInvalidBase64MediaType_case3
       22045  +
    /// Attempted string coercion should result in SerializationException
       22046  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case17
23175  22047   
    #[::tokio::test]
23176         -
    async fn rest_json_header_malformed_string_invalid_base64_media_type_case3_malformed_request() {
       22048  +
    #[::tracing_test::traced_test]
       22049  +
    async fn rest_json_query_boolean_string_coercion_case17_malformed_request() {
23177  22050   
        {
23178  22051   
            #[allow(unused_mut)]
23179  22052   
            let mut http_request = http::Request::builder()
23180         -
                .uri("/MalformedString")
       22053  +
                .uri("/MalformedBoolean/true")
23181  22054   
                .method("POST")
23182         -
                .header("content-type", "application/json")
23183         -
                .header("amz-media-typed-header", "-_==")
23184  22055   
                .body(::aws_smithy_http_server::body::Body::empty())
23185  22056   
                .unwrap();
       22057  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=NO".parse().unwrap();
23186  22058   
            #[allow(unused_mut)]
23187  22059   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23188  22060   
            let config = crate::service::RestJsonConfig::builder().build();
23189  22061   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23190         -
                            .malformed_string(move |input: crate::input::MalformedStringInput| {
       22062  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23191  22063   
                                let sender = sender.clone();
23192  22064   
                                async move {
23193         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedStringOutput };
       22065  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23194  22066   
                                    sender.send(()).await.expect("receiver dropped early");
23195  22067   
                                    result
23196  22068   
                                }
23197  22069   
                            })
23198  22070   
                            .build_unchecked();
23199  22071   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23200  22072   
                .await
23201  22073   
                .expect("unable to make an HTTP request");
23202  22074   
            ::pretty_assertions::assert_eq!(
23203  22075   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23204  22076   
                http_response.status()
23205  22077   
            );
23206  22078   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23207  22079   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23208  22080   
                http_response.headers(),
23209  22081   
                expected_headers,
23210  22082   
            ));
23211  22083   
        }
23212  22084   
    }
23213         -
}
23214         -
#[cfg(test)]
23215         -
#[allow(unreachable_code, unused_variables)]
23216         -
mod server_malformed_timestamp_body_date_time_test {
23217         -
    /// When the format is date-time, IMF-fixdate timestamps are rejected with a
23218         -
    /// 400 SerializationException
23219         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsHttpDate_case0
       22085  +
    /// Attempted string coercion should result in SerializationException
       22086  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case18
23220  22087   
    #[::tokio::test]
23221         -
    async fn rest_json_body_timestamp_date_time_rejects_http_date_case0_malformed_request() {
       22088  +
    #[::tracing_test::traced_test]
       22089  +
    async fn rest_json_query_boolean_string_coercion_case18_malformed_request() {
23222  22090   
        {
23223  22091   
            #[allow(unused_mut)]
23224  22092   
            let mut http_request = http::Request::builder()
23225         -
                .uri("/MalformedTimestampBodyDateTime")
       22093  +
                .uri("/MalformedBoolean/true")
23226  22094   
                .method("POST")
23227         -
                .header("content-type", "application/json")
23228         -
                .body(::aws_smithy_http_server::body::Body::from(
23229         -
                    ::bytes::Bytes::from_static(
23230         -
                        "{ \"timestamp\": \"Tue, 29 Apr 2014 18:30:38 GMT\" }".as_bytes(),
23231         -
                    ),
23232         -
                ))
       22095  +
                .body(::aws_smithy_http_server::body::Body::empty())
23233  22096   
                .unwrap();
       22097  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=0".parse().unwrap();
23234  22098   
            #[allow(unused_mut)]
23235  22099   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23236  22100   
            let config = crate::service::RestJsonConfig::builder().build();
23237  22101   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23238         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22102  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23239  22103   
                                let sender = sender.clone();
23240  22104   
                                async move {
23241         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22105  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23242  22106   
                                    sender.send(()).await.expect("receiver dropped early");
23243  22107   
                                    result
23244  22108   
                                }
23245  22109   
                            })
23246  22110   
                            .build_unchecked();
23247  22111   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23248  22112   
                .await
23249  22113   
                .expect("unable to make an HTTP request");
23250  22114   
            ::pretty_assertions::assert_eq!(
23251  22115   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23252  22116   
                http_response.status()
23253  22117   
            );
23254  22118   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23255  22119   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23256  22120   
                http_response.headers(),
23257  22121   
                expected_headers,
23258  22122   
            ));
23259  22123   
        }
23260  22124   
    }
23261         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
23262         -
    /// 400 SerializationException
23263         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case0
       22125  +
    /// Attempted string coercion should result in SerializationException
       22126  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case19
23264  22127   
    #[::tokio::test]
23265         -
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
       22128  +
    #[::tracing_test::traced_test]
       22129  +
    async fn rest_json_query_boolean_string_coercion_case19_malformed_request() {
23266  22130   
        {
23267  22131   
            #[allow(unused_mut)]
23268  22132   
            let mut http_request = http::Request::builder()
23269         -
                .uri("/MalformedTimestampBodyDateTime")
       22133  +
                .uri("/MalformedBoolean/true")
23270  22134   
                .method("POST")
23271         -
                .header("content-type", "application/json")
23272         -
                .body(::aws_smithy_http_server::body::Body::from(
23273         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
23274         -
                ))
       22135  +
                .body(::aws_smithy_http_server::body::Body::empty())
23275  22136   
                .unwrap();
       22137  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=off".parse().unwrap();
23276  22138   
            #[allow(unused_mut)]
23277  22139   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23278  22140   
            let config = crate::service::RestJsonConfig::builder().build();
23279  22141   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23280         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22142  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23281  22143   
                                let sender = sender.clone();
23282  22144   
                                async move {
23283         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22145  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23284  22146   
                                    sender.send(()).await.expect("receiver dropped early");
23285  22147   
                                    result
23286  22148   
                                }
23287  22149   
                            })
23288  22150   
                            .build_unchecked();
23289  22151   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23290  22152   
                .await
23291  22153   
                .expect("unable to make an HTTP request");
23292  22154   
            ::pretty_assertions::assert_eq!(
23293  22155   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23294  22156   
                http_response.status()
23295  22157   
            );
23296  22158   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23297  22159   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23298  22160   
                http_response.headers(),
23299  22161   
                expected_headers,
23300  22162   
            ));
23301  22163   
        }
23302  22164   
    }
23303         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
23304         -
    /// 400 SerializationException
23305         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case1
       22165  +
    /// Attempted string coercion should result in SerializationException
       22166  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case20
23306  22167   
    #[::tokio::test]
23307         -
    async fn rest_json_body_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
       22168  +
    #[::tracing_test::traced_test]
       22169  +
    async fn rest_json_query_boolean_string_coercion_case20_malformed_request() {
23308  22170   
        {
23309  22171   
            #[allow(unused_mut)]
23310  22172   
            let mut http_request = http::Request::builder()
23311         -
                .uri("/MalformedTimestampBodyDateTime")
       22173  +
                .uri("/MalformedBoolean/true")
23312  22174   
                .method("POST")
23313         -
                .header("content-type", "application/json")
23314         -
                .body(::aws_smithy_http_server::body::Body::from(
23315         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
23316         -
                ))
       22175  +
                .body(::aws_smithy_http_server::body::Body::empty())
23317  22176   
                .unwrap();
       22177  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=Off".parse().unwrap();
23318  22178   
            #[allow(unused_mut)]
23319  22179   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23320  22180   
            let config = crate::service::RestJsonConfig::builder().build();
23321  22181   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23322         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22182  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23323  22183   
                                let sender = sender.clone();
23324  22184   
                                async move {
23325         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22185  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23326  22186   
                                    sender.send(()).await.expect("receiver dropped early");
23327  22187   
                                    result
23328  22188   
                                }
23329  22189   
                            })
23330  22190   
                            .build_unchecked();
23331  22191   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23332  22192   
                .await
23333  22193   
                .expect("unable to make an HTTP request");
23334  22194   
            ::pretty_assertions::assert_eq!(
23335  22195   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23336  22196   
                http_response.status()
23337  22197   
            );
23338  22198   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23339  22199   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23340  22200   
                http_response.headers(),
23341  22201   
                expected_headers,
23342  22202   
            ));
23343  22203   
        }
23344  22204   
    }
23345         -
    /// When the format is date-time, RFC 3339 timestamps with a UTC offset are rejected with a
23346         -
    /// 400 SerializationException
23347         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsUTCOffsets_case0
       22205  +
    /// Attempted string coercion should result in SerializationException
       22206  +
    /// Test ID: RestJsonQueryBooleanStringCoercion_case21
23348  22207   
    #[::tokio::test]
23349         -
    async fn rest_json_body_timestamp_date_time_rejects_utc_offsets_case0_malformed_request() {
       22208  +
    #[::tracing_test::traced_test]
       22209  +
    async fn rest_json_query_boolean_string_coercion_case21_malformed_request() {
23350  22210   
        {
23351  22211   
            #[allow(unused_mut)]
23352  22212   
            let mut http_request = http::Request::builder()
23353         -
                .uri("/MalformedTimestampBodyDateTime")
       22213  +
                .uri("/MalformedBoolean/true")
23354  22214   
                .method("POST")
23355         -
                .header("content-type", "application/json")
23356         -
                .body(::aws_smithy_http_server::body::Body::from(
23357         -
                    ::bytes::Bytes::from_static(
23358         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
23359         -
                    ),
23360         -
                ))
       22215  +
                .body(::aws_smithy_http_server::body::Body::empty())
23361  22216   
                .unwrap();
       22217  +
            *http_request.uri_mut() = "/MalformedBoolean/true?booleanInQuery=OFF".parse().unwrap();
23362  22218   
            #[allow(unused_mut)]
23363  22219   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23364  22220   
            let config = crate::service::RestJsonConfig::builder().build();
23365  22221   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23366         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22222  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23367  22223   
                                let sender = sender.clone();
23368  22224   
                                async move {
23369         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22225  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23370  22226   
                                    sender.send(()).await.expect("receiver dropped early");
23371  22227   
                                    result
23372  22228   
                                }
23373  22229   
                            })
23374  22230   
                            .build_unchecked();
23375  22231   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23376  22232   
                .await
23377  22233   
                .expect("unable to make an HTTP request");
23378  22234   
            ::pretty_assertions::assert_eq!(
23379  22235   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23380  22236   
                http_response.status()
23381  22237   
            );
23382  22238   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23383  22239   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23384  22240   
                http_response.headers(),
23385  22241   
                expected_headers,
23386  22242   
            ));
23387  22243   
        }
23388  22244   
    }
23389         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23390         -
    /// are rejected with a 400 SerializationException
23391         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case0
       22245  +
    /// Attempted string coercion should result in SerializationException
       22246  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case0
23392  22247   
    #[::tokio::test]
23393         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
23394         -
    ) {
       22248  +
    #[::tracing_test::traced_test]
       22249  +
    async fn rest_json_header_boolean_string_coercion_case0_malformed_request() {
23395  22250   
        {
23396  22251   
            #[allow(unused_mut)]
23397  22252   
            let mut http_request = http::Request::builder()
23398         -
                .uri("/MalformedTimestampBodyDateTime")
       22253  +
                .uri("/MalformedBoolean/true")
23399  22254   
                .method("POST")
23400         -
                .header("content-type", "application/json")
23401         -
                .body(::aws_smithy_http_server::body::Body::from(
23402         -
                    ::bytes::Bytes::from_static(
23403         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00\" }".as_bytes(),
23404         -
                    ),
23405         -
                ))
       22255  +
                .header("booleanInHeader", "True")
       22256  +
                .body(::aws_smithy_http_server::body::Body::empty())
23406  22257   
                .unwrap();
23407  22258   
            #[allow(unused_mut)]
23408  22259   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23409  22260   
            let config = crate::service::RestJsonConfig::builder().build();
23410  22261   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23411         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22262  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23412  22263   
                                let sender = sender.clone();
23413  22264   
                                async move {
23414         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22265  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23415  22266   
                                    sender.send(()).await.expect("receiver dropped early");
23416  22267   
                                    result
23417  22268   
                                }
23418  22269   
                            })
23419  22270   
                            .build_unchecked();
23420  22271   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23421  22272   
                .await
23422  22273   
                .expect("unable to make an HTTP request");
23423  22274   
            ::pretty_assertions::assert_eq!(
23424  22275   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23425  22276   
                http_response.status()
23426  22277   
            );
23427  22278   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23428  22279   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23429  22280   
                http_response.headers(),
23430  22281   
                expected_headers,
23431  22282   
            ));
23432  22283   
        }
23433  22284   
    }
23434         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23435         -
    /// are rejected with a 400 SerializationException
23436         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case1
       22285  +
    /// Attempted string coercion should result in SerializationException
       22286  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case1
23437  22287   
    #[::tokio::test]
23438         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
23439         -
    ) {
       22288  +
    #[::tracing_test::traced_test]
       22289  +
    async fn rest_json_header_boolean_string_coercion_case1_malformed_request() {
23440  22290   
        {
23441  22291   
            #[allow(unused_mut)]
23442  22292   
            let mut http_request = http::Request::builder()
23443         -
                .uri("/MalformedTimestampBodyDateTime")
       22293  +
                .uri("/MalformedBoolean/true")
23444  22294   
                .method("POST")
23445         -
                .header("content-type", "application/json")
23446         -
                .body(::aws_smithy_http_server::body::Body::from(
23447         -
                    ::bytes::Bytes::from_static(
23448         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57+00Z\" }".as_bytes(),
23449         -
                    ),
23450         -
                ))
       22295  +
                .header("booleanInHeader", "TRUE")
       22296  +
                .body(::aws_smithy_http_server::body::Body::empty())
23451  22297   
                .unwrap();
23452  22298   
            #[allow(unused_mut)]
23453  22299   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23454  22300   
            let config = crate::service::RestJsonConfig::builder().build();
23455  22301   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23456         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22302  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23457  22303   
                                let sender = sender.clone();
23458  22304   
                                async move {
23459         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22305  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23460  22306   
                                    sender.send(()).await.expect("receiver dropped early");
23461  22307   
                                    result
23462  22308   
                                }
23463  22309   
                            })
23464  22310   
                            .build_unchecked();
23465  22311   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23466  22312   
                .await
23467  22313   
                .expect("unable to make an HTTP request");
23468  22314   
            ::pretty_assertions::assert_eq!(
23469  22315   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23470  22316   
                http_response.status()
23471  22317   
            );
23472  22318   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23473  22319   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23474  22320   
                http_response.headers(),
23475  22321   
                expected_headers,
23476  22322   
            ));
23477  22323   
        }
23478  22324   
    }
23479         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23480         -
    /// are rejected with a 400 SerializationException
23481         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case2
       22325  +
    /// Attempted string coercion should result in SerializationException
       22326  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case2
23482  22327   
    #[::tokio::test]
23483         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
23484         -
    ) {
       22328  +
    #[::tracing_test::traced_test]
       22329  +
    async fn rest_json_header_boolean_string_coercion_case2_malformed_request() {
23485  22330   
        {
23486  22331   
            #[allow(unused_mut)]
23487  22332   
            let mut http_request = http::Request::builder()
23488         -
                .uri("/MalformedTimestampBodyDateTime")
       22333  +
                .uri("/MalformedBoolean/true")
23489  22334   
                .method("POST")
23490         -
                .header("content-type", "application/json")
23491         -
                .body(::aws_smithy_http_server::body::Body::from(
23492         -
                    ::bytes::Bytes::from_static(
23493         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57\" }".as_bytes(),
23494         -
                    ),
23495         -
                ))
       22335  +
                .header("booleanInHeader", "y")
       22336  +
                .body(::aws_smithy_http_server::body::Body::empty())
23496  22337   
                .unwrap();
23497  22338   
            #[allow(unused_mut)]
23498  22339   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23499  22340   
            let config = crate::service::RestJsonConfig::builder().build();
23500  22341   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23501         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22342  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23502  22343   
                                let sender = sender.clone();
23503  22344   
                                async move {
23504         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22345  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23505  22346   
                                    sender.send(()).await.expect("receiver dropped early");
23506  22347   
                                    result
23507  22348   
                                }
23508  22349   
                            })
23509  22350   
                            .build_unchecked();
23510  22351   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23511  22352   
                .await
23512  22353   
                .expect("unable to make an HTTP request");
23513  22354   
            ::pretty_assertions::assert_eq!(
23514  22355   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23515  22356   
                http_response.status()
23516  22357   
            );
23517  22358   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23518  22359   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23519  22360   
                http_response.headers(),
23520  22361   
                expected_headers,
23521  22362   
            ));
23522  22363   
        }
23523  22364   
    }
23524         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23525         -
    /// are rejected with a 400 SerializationException
23526         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case3
       22365  +
    /// Attempted string coercion should result in SerializationException
       22366  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case3
23527  22367   
    #[::tokio::test]
23528         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
23529         -
    ) {
       22368  +
    #[::tracing_test::traced_test]
       22369  +
    async fn rest_json_header_boolean_string_coercion_case3_malformed_request() {
23530  22370   
        {
23531  22371   
            #[allow(unused_mut)]
23532  22372   
            let mut http_request = http::Request::builder()
23533         -
                .uri("/MalformedTimestampBodyDateTime")
       22373  +
                .uri("/MalformedBoolean/true")
23534  22374   
                .method("POST")
23535         -
                .header("content-type", "application/json")
23536         -
                .body(::aws_smithy_http_server::body::Body::from(
23537         -
                    ::bytes::Bytes::from_static(
23538         -
                        "{ \"timestamp\": \"1996-12-19T163957\" }".as_bytes(),
23539         -
                    ),
23540         -
                ))
       22375  +
                .header("booleanInHeader", "Y")
       22376  +
                .body(::aws_smithy_http_server::body::Body::empty())
23541  22377   
                .unwrap();
23542  22378   
            #[allow(unused_mut)]
23543  22379   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23544  22380   
            let config = crate::service::RestJsonConfig::builder().build();
23545  22381   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23546         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22382  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23547  22383   
                                let sender = sender.clone();
23548  22384   
                                async move {
23549         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22385  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23550  22386   
                                    sender.send(()).await.expect("receiver dropped early");
23551  22387   
                                    result
23552  22388   
                                }
23553  22389   
                            })
23554  22390   
                            .build_unchecked();
23555  22391   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23556  22392   
                .await
23557  22393   
                .expect("unable to make an HTTP request");
23558  22394   
            ::pretty_assertions::assert_eq!(
23559  22395   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23560  22396   
                http_response.status()
23561  22397   
            );
23562  22398   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23563  22399   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23564  22400   
                http_response.headers(),
23565  22401   
                expected_headers,
23566  22402   
            ));
23567  22403   
        }
23568  22404   
    }
23569         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23570         -
    /// are rejected with a 400 SerializationException
23571         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case4
       22405  +
    /// Attempted string coercion should result in SerializationException
       22406  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case4
23572  22407   
    #[::tokio::test]
23573         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
23574         -
    ) {
       22408  +
    #[::tracing_test::traced_test]
       22409  +
    async fn rest_json_header_boolean_string_coercion_case4_malformed_request() {
23575  22410   
        {
23576  22411   
            #[allow(unused_mut)]
23577  22412   
            let mut http_request = http::Request::builder()
23578         -
                .uri("/MalformedTimestampBodyDateTime")
       22413  +
                .uri("/MalformedBoolean/true")
23579  22414   
                .method("POST")
23580         -
                .header("content-type", "application/json")
23581         -
                .body(::aws_smithy_http_server::body::Body::from(
23582         -
                    ::bytes::Bytes::from_static(
23583         -
                        "{ \"timestamp\": \"19961219T163957Z\" }".as_bytes(),
23584         -
                    ),
23585         -
                ))
       22415  +
                .header("booleanInHeader", "yes")
       22416  +
                .body(::aws_smithy_http_server::body::Body::empty())
23586  22417   
                .unwrap();
23587  22418   
            #[allow(unused_mut)]
23588  22419   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23589  22420   
            let config = crate::service::RestJsonConfig::builder().build();
23590  22421   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23591         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22422  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23592  22423   
                                let sender = sender.clone();
23593  22424   
                                async move {
23594         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22425  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23595  22426   
                                    sender.send(()).await.expect("receiver dropped early");
23596  22427   
                                    result
23597  22428   
                                }
23598  22429   
                            })
23599  22430   
                            .build_unchecked();
23600  22431   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23601  22432   
                .await
23602  22433   
                .expect("unable to make an HTTP request");
23603  22434   
            ::pretty_assertions::assert_eq!(
23604  22435   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23605  22436   
                http_response.status()
23606  22437   
            );
23607  22438   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23608  22439   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23609  22440   
                http_response.headers(),
23610  22441   
                expected_headers,
23611  22442   
            ));
23612  22443   
        }
23613  22444   
    }
23614         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23615         -
    /// are rejected with a 400 SerializationException
23616         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case5
       22445  +
    /// Attempted string coercion should result in SerializationException
       22446  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case5
23617  22447   
    #[::tokio::test]
23618         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
23619         -
    ) {
       22448  +
    #[::tracing_test::traced_test]
       22449  +
    async fn rest_json_header_boolean_string_coercion_case5_malformed_request() {
23620  22450   
        {
23621  22451   
            #[allow(unused_mut)]
23622  22452   
            let mut http_request = http::Request::builder()
23623         -
                .uri("/MalformedTimestampBodyDateTime")
       22453  +
                .uri("/MalformedBoolean/true")
23624  22454   
                .method("POST")
23625         -
                .header("content-type", "application/json")
23626         -
                .body(::aws_smithy_http_server::body::Body::from(
23627         -
                    ::bytes::Bytes::from_static(
23628         -
                        "{ \"timestamp\": \"19961219T163957\" }".as_bytes(),
23629         -
                    ),
23630         -
                ))
       22455  +
                .header("booleanInHeader", "Yes")
       22456  +
                .body(::aws_smithy_http_server::body::Body::empty())
23631  22457   
                .unwrap();
23632  22458   
            #[allow(unused_mut)]
23633  22459   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23634  22460   
            let config = crate::service::RestJsonConfig::builder().build();
23635  22461   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23636         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22462  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23637  22463   
                                let sender = sender.clone();
23638  22464   
                                async move {
23639         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22465  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23640  22466   
                                    sender.send(()).await.expect("receiver dropped early");
23641  22467   
                                    result
23642  22468   
                                }
23643  22469   
                            })
23644  22470   
                            .build_unchecked();
23645  22471   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23646  22472   
                .await
23647  22473   
                .expect("unable to make an HTTP request");
23648  22474   
            ::pretty_assertions::assert_eq!(
23649  22475   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23650  22476   
                http_response.status()
23651  22477   
            );
23652  22478   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23653  22479   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23654  22480   
                http_response.headers(),
23655  22481   
                expected_headers,
23656  22482   
            ));
23657  22483   
        }
23658  22484   
    }
23659         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23660         -
    /// are rejected with a 400 SerializationException
23661         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case6
       22485  +
    /// Attempted string coercion should result in SerializationException
       22486  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case6
23662  22487   
    #[::tokio::test]
23663         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
23664         -
    ) {
       22488  +
    #[::tracing_test::traced_test]
       22489  +
    async fn rest_json_header_boolean_string_coercion_case6_malformed_request() {
23665  22490   
        {
23666  22491   
            #[allow(unused_mut)]
23667  22492   
            let mut http_request = http::Request::builder()
23668         -
                .uri("/MalformedTimestampBodyDateTime")
       22493  +
                .uri("/MalformedBoolean/true")
23669  22494   
                .method("POST")
23670         -
                .header("content-type", "application/json")
23671         -
                .body(::aws_smithy_http_server::body::Body::from(
23672         -
                    ::bytes::Bytes::from_static(
23673         -
                        "{ \"timestamp\": \"19961219T16:39:57Z\" }".as_bytes(),
23674         -
                    ),
23675         -
                ))
       22495  +
                .header("booleanInHeader", "YES")
       22496  +
                .body(::aws_smithy_http_server::body::Body::empty())
23676  22497   
                .unwrap();
23677  22498   
            #[allow(unused_mut)]
23678  22499   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23679  22500   
            let config = crate::service::RestJsonConfig::builder().build();
23680  22501   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23681         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22502  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23682  22503   
                                let sender = sender.clone();
23683  22504   
                                async move {
23684         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22505  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23685  22506   
                                    sender.send(()).await.expect("receiver dropped early");
23686  22507   
                                    result
23687  22508   
                                }
23688  22509   
                            })
23689  22510   
                            .build_unchecked();
23690  22511   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23691  22512   
                .await
23692  22513   
                .expect("unable to make an HTTP request");
23693  22514   
            ::pretty_assertions::assert_eq!(
23694  22515   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23695  22516   
                http_response.status()
23696  22517   
            );
23697  22518   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23698  22519   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23699  22520   
                http_response.headers(),
23700  22521   
                expected_headers,
23701  22522   
            ));
23702  22523   
        }
23703  22524   
    }
23704         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23705         -
    /// are rejected with a 400 SerializationException
23706         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case7
       22525  +
    /// Attempted string coercion should result in SerializationException
       22526  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case7
23707  22527   
    #[::tokio::test]
23708         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
23709         -
    ) {
       22528  +
    #[::tracing_test::traced_test]
       22529  +
    async fn rest_json_header_boolean_string_coercion_case7_malformed_request() {
23710  22530   
        {
23711  22531   
            #[allow(unused_mut)]
23712  22532   
            let mut http_request = http::Request::builder()
23713         -
                .uri("/MalformedTimestampBodyDateTime")
       22533  +
                .uri("/MalformedBoolean/true")
23714  22534   
                .method("POST")
23715         -
                .header("content-type", "application/json")
23716         -
                .body(::aws_smithy_http_server::body::Body::from(
23717         -
                    ::bytes::Bytes::from_static(
23718         -
                        "{ \"timestamp\": \"19961219T16:39:57\" }".as_bytes(),
23719         -
                    ),
23720         -
                ))
       22535  +
                .header("booleanInHeader", "1")
       22536  +
                .body(::aws_smithy_http_server::body::Body::empty())
23721  22537   
                .unwrap();
23722  22538   
            #[allow(unused_mut)]
23723  22539   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23724  22540   
            let config = crate::service::RestJsonConfig::builder().build();
23725  22541   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23726         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22542  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23727  22543   
                                let sender = sender.clone();
23728  22544   
                                async move {
23729         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22545  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23730  22546   
                                    sender.send(()).await.expect("receiver dropped early");
23731  22547   
                                    result
23732  22548   
                                }
23733  22549   
                            })
23734  22550   
                            .build_unchecked();
23735  22551   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23736  22552   
                .await
23737  22553   
                .expect("unable to make an HTTP request");
23738  22554   
            ::pretty_assertions::assert_eq!(
23739  22555   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23740  22556   
                http_response.status()
23741  22557   
            );
23742  22558   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23743  22559   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23744  22560   
                http_response.headers(),
23745  22561   
                expected_headers,
23746  22562   
            ));
23747  22563   
        }
23748  22564   
    }
23749         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23750         -
    /// are rejected with a 400 SerializationException
23751         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case8
       22565  +
    /// Attempted string coercion should result in SerializationException
       22566  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case8
23752  22567   
    #[::tokio::test]
23753         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
23754         -
    ) {
       22568  +
    #[::tracing_test::traced_test]
       22569  +
    async fn rest_json_header_boolean_string_coercion_case8_malformed_request() {
23755  22570   
        {
23756  22571   
            #[allow(unused_mut)]
23757  22572   
            let mut http_request = http::Request::builder()
23758         -
                .uri("/MalformedTimestampBodyDateTime")
       22573  +
                .uri("/MalformedBoolean/true")
23759  22574   
                .method("POST")
23760         -
                .header("content-type", "application/json")
23761         -
                .body(::aws_smithy_http_server::body::Body::from(
23762         -
                    ::bytes::Bytes::from_static(
23763         -
                        "{ \"timestamp\": \"1996-12-19T16:39Z\" }".as_bytes(),
23764         -
                    ),
23765         -
                ))
       22575  +
                .header("booleanInHeader", "on")
       22576  +
                .body(::aws_smithy_http_server::body::Body::empty())
23766  22577   
                .unwrap();
23767  22578   
            #[allow(unused_mut)]
23768  22579   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23769  22580   
            let config = crate::service::RestJsonConfig::builder().build();
23770  22581   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23771         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22582  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23772  22583   
                                let sender = sender.clone();
23773  22584   
                                async move {
23774         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22585  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23775  22586   
                                    sender.send(()).await.expect("receiver dropped early");
23776  22587   
                                    result
23777  22588   
                                }
23778  22589   
                            })
23779  22590   
                            .build_unchecked();
23780  22591   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23781  22592   
                .await
23782  22593   
                .expect("unable to make an HTTP request");
23783  22594   
            ::pretty_assertions::assert_eq!(
23784  22595   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23785  22596   
                http_response.status()
23786  22597   
            );
23787  22598   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23788  22599   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23789  22600   
                http_response.headers(),
23790  22601   
                expected_headers,
23791  22602   
            ));
23792  22603   
        }
23793  22604   
    }
23794         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23795         -
    /// are rejected with a 400 SerializationException
23796         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case9
       22605  +
    /// Attempted string coercion should result in SerializationException
       22606  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case9
23797  22607   
    #[::tokio::test]
23798         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
23799         -
    ) {
       22608  +
    #[::tracing_test::traced_test]
       22609  +
    async fn rest_json_header_boolean_string_coercion_case9_malformed_request() {
23800  22610   
        {
23801  22611   
            #[allow(unused_mut)]
23802  22612   
            let mut http_request = http::Request::builder()
23803         -
                .uri("/MalformedTimestampBodyDateTime")
       22613  +
                .uri("/MalformedBoolean/true")
23804  22614   
                .method("POST")
23805         -
                .header("content-type", "application/json")
23806         -
                .body(::aws_smithy_http_server::body::Body::from(
23807         -
                    ::bytes::Bytes::from_static(
23808         -
                        "{ \"timestamp\": \"1996-12-19T16:39\" }".as_bytes(),
23809         -
                    ),
23810         -
                ))
       22615  +
                .header("booleanInHeader", "On")
       22616  +
                .body(::aws_smithy_http_server::body::Body::empty())
23811  22617   
                .unwrap();
23812  22618   
            #[allow(unused_mut)]
23813  22619   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23814  22620   
            let config = crate::service::RestJsonConfig::builder().build();
23815  22621   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23816         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22622  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23817  22623   
                                let sender = sender.clone();
23818  22624   
                                async move {
23819         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22625  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23820  22626   
                                    sender.send(()).await.expect("receiver dropped early");
23821  22627   
                                    result
23822  22628   
                                }
23823  22629   
                            })
23824  22630   
                            .build_unchecked();
23825  22631   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23826  22632   
                .await
23827  22633   
                .expect("unable to make an HTTP request");
23828  22634   
            ::pretty_assertions::assert_eq!(
23829  22635   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23830  22636   
                http_response.status()
23831  22637   
            );
23832  22638   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23833  22639   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23834  22640   
                http_response.headers(),
23835  22641   
                expected_headers,
23836  22642   
            ));
23837  22643   
        }
23838  22644   
    }
23839         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23840         -
    /// are rejected with a 400 SerializationException
23841         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case10
       22645  +
    /// Attempted string coercion should result in SerializationException
       22646  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case10
23842  22647   
    #[::tokio::test]
23843         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
23844         -
    ) {
       22648  +
    #[::tracing_test::traced_test]
       22649  +
    async fn rest_json_header_boolean_string_coercion_case10_malformed_request() {
23845  22650   
        {
23846  22651   
            #[allow(unused_mut)]
23847  22652   
            let mut http_request = http::Request::builder()
23848         -
                .uri("/MalformedTimestampBodyDateTime")
       22653  +
                .uri("/MalformedBoolean/true")
23849  22654   
                .method("POST")
23850         -
                .header("content-type", "application/json")
23851         -
                .body(::aws_smithy_http_server::body::Body::from(
23852         -
                    ::bytes::Bytes::from_static(
23853         -
                        "{ \"timestamp\": \"1996-12-19T1639\" }".as_bytes(),
23854         -
                    ),
23855         -
                ))
       22655  +
                .header("booleanInHeader", "ON")
       22656  +
                .body(::aws_smithy_http_server::body::Body::empty())
23856  22657   
                .unwrap();
23857  22658   
            #[allow(unused_mut)]
23858  22659   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23859  22660   
            let config = crate::service::RestJsonConfig::builder().build();
23860  22661   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23861         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22662  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23862  22663   
                                let sender = sender.clone();
23863  22664   
                                async move {
23864         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22665  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23865  22666   
                                    sender.send(()).await.expect("receiver dropped early");
23866  22667   
                                    result
23867  22668   
                                }
23868  22669   
                            })
23869  22670   
                            .build_unchecked();
23870  22671   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23871  22672   
                .await
23872  22673   
                .expect("unable to make an HTTP request");
23873  22674   
            ::pretty_assertions::assert_eq!(
23874  22675   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23875  22676   
                http_response.status()
23876  22677   
            );
23877  22678   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23878  22679   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23879  22680   
                http_response.headers(),
23880  22681   
                expected_headers,
23881  22682   
            ));
23882  22683   
        }
23883  22684   
    }
23884         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23885         -
    /// are rejected with a 400 SerializationException
23886         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case11
       22685  +
    /// Attempted string coercion should result in SerializationException
       22686  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case11
23887  22687   
    #[::tokio::test]
23888         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
23889         -
    ) {
       22688  +
    #[::tracing_test::traced_test]
       22689  +
    async fn rest_json_header_boolean_string_coercion_case11_malformed_request() {
23890  22690   
        {
23891  22691   
            #[allow(unused_mut)]
23892  22692   
            let mut http_request = http::Request::builder()
23893         -
                .uri("/MalformedTimestampBodyDateTime")
       22693  +
                .uri("/MalformedBoolean/true")
23894  22694   
                .method("POST")
23895         -
                .header("content-type", "application/json")
23896         -
                .body(::aws_smithy_http_server::body::Body::from(
23897         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16Z\" }".as_bytes()),
23898         -
                ))
       22695  +
                .header("booleanInHeader", "False")
       22696  +
                .body(::aws_smithy_http_server::body::Body::empty())
23899  22697   
                .unwrap();
23900  22698   
            #[allow(unused_mut)]
23901  22699   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23902  22700   
            let config = crate::service::RestJsonConfig::builder().build();
23903  22701   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23904         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22702  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23905  22703   
                                let sender = sender.clone();
23906  22704   
                                async move {
23907         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22705  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23908  22706   
                                    sender.send(()).await.expect("receiver dropped early");
23909  22707   
                                    result
23910  22708   
                                }
23911  22709   
                            })
23912  22710   
                            .build_unchecked();
23913  22711   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23914  22712   
                .await
23915  22713   
                .expect("unable to make an HTTP request");
23916  22714   
            ::pretty_assertions::assert_eq!(
23917  22715   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23918  22716   
                http_response.status()
23919  22717   
            );
23920  22718   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23921  22719   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23922  22720   
                http_response.headers(),
23923  22721   
                expected_headers,
23924  22722   
            ));
23925  22723   
        }
23926  22724   
    }
23927         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23928         -
    /// are rejected with a 400 SerializationException
23929         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case12
       22725  +
    /// Attempted string coercion should result in SerializationException
       22726  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case12
23930  22727   
    #[::tokio::test]
23931         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
23932         -
    ) {
       22728  +
    #[::tracing_test::traced_test]
       22729  +
    async fn rest_json_header_boolean_string_coercion_case12_malformed_request() {
23933  22730   
        {
23934  22731   
            #[allow(unused_mut)]
23935  22732   
            let mut http_request = http::Request::builder()
23936         -
                .uri("/MalformedTimestampBodyDateTime")
       22733  +
                .uri("/MalformedBoolean/true")
23937  22734   
                .method("POST")
23938         -
                .header("content-type", "application/json")
23939         -
                .body(::aws_smithy_http_server::body::Body::from(
23940         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1996-12-19T16\" }".as_bytes()),
23941         -
                ))
       22735  +
                .header("booleanInHeader", "FALSE")
       22736  +
                .body(::aws_smithy_http_server::body::Body::empty())
23942  22737   
                .unwrap();
23943  22738   
            #[allow(unused_mut)]
23944  22739   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23945  22740   
            let config = crate::service::RestJsonConfig::builder().build();
23946  22741   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23947         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22742  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23948  22743   
                                let sender = sender.clone();
23949  22744   
                                async move {
23950         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22745  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23951  22746   
                                    sender.send(()).await.expect("receiver dropped early");
23952  22747   
                                    result
23953  22748   
                                }
23954  22749   
                            })
23955  22750   
                            .build_unchecked();
23956  22751   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
23957  22752   
                .await
23958  22753   
                .expect("unable to make an HTTP request");
23959  22754   
            ::pretty_assertions::assert_eq!(
23960  22755   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
23961  22756   
                http_response.status()
23962  22757   
            );
23963  22758   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
23964  22759   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
23965  22760   
                http_response.headers(),
23966  22761   
                expected_headers,
23967  22762   
            ));
23968  22763   
        }
23969  22764   
    }
23970         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
23971         -
    /// are rejected with a 400 SerializationException
23972         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case13
       22765  +
    /// Attempted string coercion should result in SerializationException
       22766  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case13
23973  22767   
    #[::tokio::test]
23974         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
23975         -
    ) {
       22768  +
    #[::tracing_test::traced_test]
       22769  +
    async fn rest_json_header_boolean_string_coercion_case13_malformed_request() {
23976  22770   
        {
23977  22771   
            #[allow(unused_mut)]
23978  22772   
            let mut http_request = http::Request::builder()
23979         -
                .uri("/MalformedTimestampBodyDateTime")
       22773  +
                .uri("/MalformedBoolean/true")
23980  22774   
                .method("POST")
23981         -
                .header("content-type", "application/json")
23982         -
                .body(::aws_smithy_http_server::body::Body::from(
23983         -
                    ::bytes::Bytes::from_static(
23984         -
                        "{ \"timestamp\": \"1996-12-19 16:39:57Z\" }".as_bytes(),
23985         -
                    ),
23986         -
                ))
       22775  +
                .header("booleanInHeader", "n")
       22776  +
                .body(::aws_smithy_http_server::body::Body::empty())
23987  22777   
                .unwrap();
23988  22778   
            #[allow(unused_mut)]
23989  22779   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
23990  22780   
            let config = crate::service::RestJsonConfig::builder().build();
23991  22781   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
23992         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22782  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
23993  22783   
                                let sender = sender.clone();
23994  22784   
                                async move {
23995         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22785  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
23996  22786   
                                    sender.send(()).await.expect("receiver dropped early");
23997  22787   
                                    result
23998  22788   
                                }
23999  22789   
                            })
24000  22790   
                            .build_unchecked();
24001  22791   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24002  22792   
                .await
24003  22793   
                .expect("unable to make an HTTP request");
24004  22794   
            ::pretty_assertions::assert_eq!(
24005  22795   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24006  22796   
                http_response.status()
24007  22797   
            );
24008  22798   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24009  22799   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24010  22800   
                http_response.headers(),
24011  22801   
                expected_headers,
24012  22802   
            ));
24013  22803   
        }
24014  22804   
    }
24015         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
24016         -
    /// are rejected with a 400 SerializationException
24017         -
    /// Test ID: RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case14
       22805  +
    /// Attempted string coercion should result in SerializationException
       22806  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case14
24018  22807   
    #[::tokio::test]
24019         -
    async fn rest_json_body_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
24020         -
    ) {
       22808  +
    #[::tracing_test::traced_test]
       22809  +
    async fn rest_json_header_boolean_string_coercion_case14_malformed_request() {
24021  22810   
        {
24022  22811   
            #[allow(unused_mut)]
24023  22812   
            let mut http_request = http::Request::builder()
24024         -
                .uri("/MalformedTimestampBodyDateTime")
       22813  +
                .uri("/MalformedBoolean/true")
24025  22814   
                .method("POST")
24026         -
                .header("content-type", "application/json")
24027         -
                .body(::aws_smithy_http_server::body::Body::from(
24028         -
                    ::bytes::Bytes::from_static(
24029         -
                        "{ \"timestamp\": \"2011-12-03T10:15:30+01:00[Europe/Paris]\" }".as_bytes(),
24030         -
                    ),
24031         -
                ))
       22815  +
                .header("booleanInHeader", "N")
       22816  +
                .body(::aws_smithy_http_server::body::Body::empty())
24032  22817   
                .unwrap();
24033  22818   
            #[allow(unused_mut)]
24034  22819   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24035  22820   
            let config = crate::service::RestJsonConfig::builder().build();
24036  22821   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24037         -
                            .malformed_timestamp_body_date_time(move |input: crate::input::MalformedTimestampBodyDateTimeInput| {
       22822  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24038  22823   
                                let sender = sender.clone();
24039  22824   
                                async move {
24040         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDateTimeOutput, crate::error::MalformedTimestampBodyDateTimeError> };
       22825  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24041  22826   
                                    sender.send(()).await.expect("receiver dropped early");
24042  22827   
                                    result
24043  22828   
                                }
24044  22829   
                            })
24045  22830   
                            .build_unchecked();
24046  22831   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24047  22832   
                .await
24048  22833   
                .expect("unable to make an HTTP request");
24049  22834   
            ::pretty_assertions::assert_eq!(
24050  22835   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24051  22836   
                http_response.status()
24052  22837   
            );
24053  22838   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24054  22839   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24055  22840   
                http_response.headers(),
24056  22841   
                expected_headers,
24057  22842   
            ));
24058  22843   
        }
24059  22844   
    }
24060         -
}
24061         -
#[cfg(test)]
24062         -
#[allow(unreachable_code, unused_variables)]
24063         -
mod server_malformed_timestamp_body_default_test {
24064         -
    /// By default, RFC3339 timestamps are rejected with a
24065         -
    /// 400 SerializationException
24066         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case0
       22845  +
    /// Attempted string coercion should result in SerializationException
       22846  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case15
24067  22847   
    #[::tokio::test]
24068         -
    async fn rest_json_body_timestamp_default_rejects_date_time_case0_malformed_request() {
       22848  +
    #[::tracing_test::traced_test]
       22849  +
    async fn rest_json_header_boolean_string_coercion_case15_malformed_request() {
24069  22850   
        {
24070  22851   
            #[allow(unused_mut)]
24071  22852   
            let mut http_request = http::Request::builder()
24072         -
                .uri("/MalformedTimestampBodyDefault")
       22853  +
                .uri("/MalformedBoolean/true")
24073  22854   
                .method("POST")
24074         -
                .header("content-type", "application/json")
24075         -
                .body(::aws_smithy_http_server::body::Body::from(
24076         -
                    ::bytes::Bytes::from_static(
24077         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
24078         -
                    ),
24079         -
                ))
       22855  +
                .header("booleanInHeader", "no")
       22856  +
                .body(::aws_smithy_http_server::body::Body::empty())
24080  22857   
                .unwrap();
24081  22858   
            #[allow(unused_mut)]
24082  22859   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24083  22860   
            let config = crate::service::RestJsonConfig::builder().build();
24084  22861   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24085         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       22862  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24086  22863   
                                let sender = sender.clone();
24087  22864   
                                async move {
24088         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       22865  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24089  22866   
                                    sender.send(()).await.expect("receiver dropped early");
24090  22867   
                                    result
24091  22868   
                                }
24092  22869   
                            })
24093  22870   
                            .build_unchecked();
24094  22871   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24095  22872   
                .await
24096  22873   
                .expect("unable to make an HTTP request");
24097  22874   
            ::pretty_assertions::assert_eq!(
24098  22875   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24099  22876   
                http_response.status()
24100  22877   
            );
24101  22878   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24102  22879   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24103  22880   
                http_response.headers(),
24104  22881   
                expected_headers,
24105  22882   
            ));
24106  22883   
        }
24107  22884   
    }
24108         -
    /// By default, RFC3339 timestamps are rejected with a
24109         -
    /// 400 SerializationException
24110         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case1
       22885  +
    /// Attempted string coercion should result in SerializationException
       22886  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case16
24111  22887   
    #[::tokio::test]
24112         -
    async fn rest_json_body_timestamp_default_rejects_date_time_case1_malformed_request() {
       22888  +
    #[::tracing_test::traced_test]
       22889  +
    async fn rest_json_header_boolean_string_coercion_case16_malformed_request() {
24113  22890   
        {
24114  22891   
            #[allow(unused_mut)]
24115  22892   
            let mut http_request = http::Request::builder()
24116         -
                .uri("/MalformedTimestampBodyDefault")
       22893  +
                .uri("/MalformedBoolean/true")
24117  22894   
                .method("POST")
24118         -
                .header("content-type", "application/json")
24119         -
                .body(::aws_smithy_http_server::body::Body::from(
24120         -
                    ::bytes::Bytes::from_static(
24121         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
24122         -
                    ),
24123         -
                ))
       22895  +
                .header("booleanInHeader", "No")
       22896  +
                .body(::aws_smithy_http_server::body::Body::empty())
24124  22897   
                .unwrap();
24125  22898   
            #[allow(unused_mut)]
24126  22899   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24127  22900   
            let config = crate::service::RestJsonConfig::builder().build();
24128  22901   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24129         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       22902  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24130  22903   
                                let sender = sender.clone();
24131  22904   
                                async move {
24132         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       22905  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24133  22906   
                                    sender.send(()).await.expect("receiver dropped early");
24134  22907   
                                    result
24135  22908   
                                }
24136  22909   
                            })
24137  22910   
                            .build_unchecked();
24138  22911   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24139  22912   
                .await
24140  22913   
                .expect("unable to make an HTTP request");
24141  22914   
            ::pretty_assertions::assert_eq!(
24142  22915   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24143  22916   
                http_response.status()
24144  22917   
            );
24145  22918   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24146  22919   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24147  22920   
                http_response.headers(),
24148  22921   
                expected_headers,
24149  22922   
            ));
24150  22923   
        }
24151  22924   
    }
24152         -
    /// By default, RFC3339 timestamps are rejected with a
24153         -
    /// 400 SerializationException
24154         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsDateTime_case2
       22925  +
    /// Attempted string coercion should result in SerializationException
       22926  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case17
24155  22927   
    #[::tokio::test]
24156         -
    async fn rest_json_body_timestamp_default_rejects_date_time_case2_malformed_request() {
       22928  +
    #[::tracing_test::traced_test]
       22929  +
    async fn rest_json_header_boolean_string_coercion_case17_malformed_request() {
24157  22930   
        {
24158  22931   
            #[allow(unused_mut)]
24159  22932   
            let mut http_request = http::Request::builder()
24160         -
                .uri("/MalformedTimestampBodyDefault")
       22933  +
                .uri("/MalformedBoolean/true")
24161  22934   
                .method("POST")
24162         -
                .header("content-type", "application/json")
24163         -
                .body(::aws_smithy_http_server::body::Body::from(
24164         -
                    ::bytes::Bytes::from_static(
24165         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
24166         -
                    ),
24167         -
                ))
       22935  +
                .header("booleanInHeader", "NO")
       22936  +
                .body(::aws_smithy_http_server::body::Body::empty())
24168  22937   
                .unwrap();
24169  22938   
            #[allow(unused_mut)]
24170  22939   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24171  22940   
            let config = crate::service::RestJsonConfig::builder().build();
24172  22941   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24173         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       22942  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24174  22943   
                                let sender = sender.clone();
24175  22944   
                                async move {
24176         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       22945  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24177  22946   
                                    sender.send(()).await.expect("receiver dropped early");
24178  22947   
                                    result
24179  22948   
                                }
24180  22949   
                            })
24181  22950   
                            .build_unchecked();
24182  22951   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24183  22952   
                .await
24184  22953   
                .expect("unable to make an HTTP request");
24185  22954   
            ::pretty_assertions::assert_eq!(
24186  22955   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24187  22956   
                http_response.status()
24188  22957   
            );
24189  22958   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24190  22959   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24191  22960   
                http_response.headers(),
24192  22961   
                expected_headers,
24193  22962   
            ));
24194  22963   
        }
24195  22964   
    }
24196         -
    /// By default, epoch second timestamps as strings are rejected with a
24197         -
    /// 400 SerializationException
24198         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case0
       22965  +
    /// Attempted string coercion should result in SerializationException
       22966  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case18
24199  22967   
    #[::tokio::test]
24200         -
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case0_malformed_request(
24201         -
    ) {
       22968  +
    #[::tracing_test::traced_test]
       22969  +
    async fn rest_json_header_boolean_string_coercion_case18_malformed_request() {
24202  22970   
        {
24203  22971   
            #[allow(unused_mut)]
24204  22972   
            let mut http_request = http::Request::builder()
24205         -
                .uri("/MalformedTimestampBodyDefault")
       22973  +
                .uri("/MalformedBoolean/true")
24206  22974   
                .method("POST")
24207         -
                .header("content-type", "application/json")
24208         -
                .body(::aws_smithy_http_server::body::Body::from(
24209         -
                    ::bytes::Bytes::from_static(
24210         -
                        "{ \"timestamp\": \"1515531081.1234\" }".as_bytes(),
24211         -
                    ),
24212         -
                ))
       22975  +
                .header("booleanInHeader", "0")
       22976  +
                .body(::aws_smithy_http_server::body::Body::empty())
24213  22977   
                .unwrap();
24214  22978   
            #[allow(unused_mut)]
24215  22979   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24216  22980   
            let config = crate::service::RestJsonConfig::builder().build();
24217  22981   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24218         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       22982  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24219  22983   
                                let sender = sender.clone();
24220  22984   
                                async move {
24221         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       22985  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24222  22986   
                                    sender.send(()).await.expect("receiver dropped early");
24223  22987   
                                    result
24224  22988   
                                }
24225  22989   
                            })
24226  22990   
                            .build_unchecked();
24227  22991   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24228  22992   
                .await
24229  22993   
                .expect("unable to make an HTTP request");
24230  22994   
            ::pretty_assertions::assert_eq!(
24231  22995   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24232  22996   
                http_response.status()
24233  22997   
            );
24234  22998   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24235  22999   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24236  23000   
                http_response.headers(),
24237  23001   
                expected_headers,
24238  23002   
            ));
24239  23003   
        }
24240  23004   
    }
24241         -
    /// By default, epoch second timestamps as strings are rejected with a
24242         -
    /// 400 SerializationException
24243         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case1
       23005  +
    /// Attempted string coercion should result in SerializationException
       23006  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case19
24244  23007   
    #[::tokio::test]
24245         -
    async fn rest_json_body_timestamp_default_rejects_stringified_epoch_seconds_case1_malformed_request(
24246         -
    ) {
       23008  +
    #[::tracing_test::traced_test]
       23009  +
    async fn rest_json_header_boolean_string_coercion_case19_malformed_request() {
24247  23010   
        {
24248  23011   
            #[allow(unused_mut)]
24249  23012   
            let mut http_request = http::Request::builder()
24250         -
                .uri("/MalformedTimestampBodyDefault")
       23013  +
                .uri("/MalformedBoolean/true")
24251  23014   
                .method("POST")
24252         -
                .header("content-type", "application/json")
24253         -
                .body(::aws_smithy_http_server::body::Body::from(
24254         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"1515531081\" }".as_bytes()),
24255         -
                ))
       23015  +
                .header("booleanInHeader", "off")
       23016  +
                .body(::aws_smithy_http_server::body::Body::empty())
24256  23017   
                .unwrap();
24257  23018   
            #[allow(unused_mut)]
24258  23019   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24259  23020   
            let config = crate::service::RestJsonConfig::builder().build();
24260  23021   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24261         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23022  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24262  23023   
                                let sender = sender.clone();
24263  23024   
                                async move {
24264         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23025  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24265  23026   
                                    sender.send(()).await.expect("receiver dropped early");
24266  23027   
                                    result
24267  23028   
                                }
24268  23029   
                            })
24269  23030   
                            .build_unchecked();
24270  23031   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24271  23032   
                .await
24272  23033   
                .expect("unable to make an HTTP request");
24273  23034   
            ::pretty_assertions::assert_eq!(
24274  23035   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24275  23036   
                http_response.status()
24276  23037   
            );
24277  23038   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24278  23039   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24279  23040   
                http_response.headers(),
24280  23041   
                expected_headers,
24281  23042   
            ));
24282  23043   
        }
24283  23044   
    }
24284         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24285         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case0
       23045  +
    /// Attempted string coercion should result in SerializationException
       23046  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case20
24286  23047   
    #[::tokio::test]
24287         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case0_malformed_request(
24288         -
    ) {
       23048  +
    #[::tracing_test::traced_test]
       23049  +
    async fn rest_json_header_boolean_string_coercion_case20_malformed_request() {
24289  23050   
        {
24290  23051   
            #[allow(unused_mut)]
24291  23052   
            let mut http_request = http::Request::builder()
24292         -
                .uri("/MalformedTimestampBodyDefault")
       23053  +
                .uri("/MalformedBoolean/true")
24293  23054   
                .method("POST")
24294         -
                .header("content-type", "application/json")
24295         -
                .body(::aws_smithy_http_server::body::Body::from(
24296         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": true }".as_bytes()),
24297         -
                ))
       23055  +
                .header("booleanInHeader", "Off")
       23056  +
                .body(::aws_smithy_http_server::body::Body::empty())
24298  23057   
                .unwrap();
24299  23058   
            #[allow(unused_mut)]
24300  23059   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24301  23060   
            let config = crate::service::RestJsonConfig::builder().build();
24302  23061   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24303         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23062  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24304  23063   
                                let sender = sender.clone();
24305  23064   
                                async move {
24306         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23065  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24307  23066   
                                    sender.send(()).await.expect("receiver dropped early");
24308  23067   
                                    result
24309  23068   
                                }
24310  23069   
                            })
24311  23070   
                            .build_unchecked();
24312  23071   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24313  23072   
                .await
24314  23073   
                .expect("unable to make an HTTP request");
24315  23074   
            ::pretty_assertions::assert_eq!(
24316  23075   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24317  23076   
                http_response.status()
24318  23077   
            );
24319  23078   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24320  23079   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24321  23080   
                http_response.headers(),
24322  23081   
                expected_headers,
24323  23082   
            ));
24324  23083   
        }
24325  23084   
    }
24326         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24327         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case1
       23085  +
    /// Attempted string coercion should result in SerializationException
       23086  +
    /// Test ID: RestJsonHeaderBooleanStringCoercion_case21
24328  23087   
    #[::tokio::test]
24329         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case1_malformed_request(
24330         -
    ) {
       23088  +
    #[::tracing_test::traced_test]
       23089  +
    async fn rest_json_header_boolean_string_coercion_case21_malformed_request() {
24331  23090   
        {
24332  23091   
            #[allow(unused_mut)]
24333  23092   
            let mut http_request = http::Request::builder()
24334         -
                .uri("/MalformedTimestampBodyDefault")
       23093  +
                .uri("/MalformedBoolean/true")
24335  23094   
                .method("POST")
24336         -
                .header("content-type", "application/json")
24337         -
                .body(::aws_smithy_http_server::body::Body::from(
24338         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081ABC }".as_bytes()),
24339         -
                ))
       23095  +
                .header("booleanInHeader", "OFF")
       23096  +
                .body(::aws_smithy_http_server::body::Body::empty())
24340  23097   
                .unwrap();
24341  23098   
            #[allow(unused_mut)]
24342  23099   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24343  23100   
            let config = crate::service::RestJsonConfig::builder().build();
24344  23101   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24345         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23102  +
                            .malformed_boolean(move |input: crate::input::MalformedBooleanInput| {
24346  23103   
                                let sender = sender.clone();
24347  23104   
                                async move {
24348         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23105  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedBooleanOutput, crate::error::MalformedBooleanError> };
24349  23106   
                                    sender.send(()).await.expect("receiver dropped early");
24350  23107   
                                    result
24351  23108   
                                }
24352  23109   
                            })
24353  23110   
                            .build_unchecked();
24354  23111   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24355  23112   
                .await
24356  23113   
                .expect("unable to make an HTTP request");
24357  23114   
            ::pretty_assertions::assert_eq!(
24358  23115   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24359  23116   
                http_response.status()
24360  23117   
            );
24361  23118   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24362  23119   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24363  23120   
                http_response.headers(),
24364  23121   
                expected_headers,
24365  23122   
            ));
24366  23123   
        }
24367  23124   
    }
24368         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24369         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case2
24370         -
    #[::tokio::test]
24371         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case2_malformed_request(
       23125  +
}
       23126  +
       23127  +
const CONTENT_TYPE_MALFORMEDUNION: ::mime::Mime = ::mime::APPLICATION_JSON;
       23128  +
::pin_project_lite::pin_project! {
       23129  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       23130  +
    /// [`MalformedUnionInput`](crate::input::MalformedUnionInput) using modelled bindings.
       23131  +
    pub struct MalformedUnionInputFuture {
       23132  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedUnionInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       23133  +
    }
       23134  +
}
       23135  +
       23136  +
impl std::future::Future for MalformedUnionInputFuture {
       23137  +
    type Output = Result<
       23138  +
        crate::input::MalformedUnionInput,
       23139  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       23140  +
    >;
       23141  +
       23142  +
    fn poll(
       23143  +
        self: std::pin::Pin<&mut Self>,
       23144  +
        cx: &mut std::task::Context<'_>,
       23145  +
    ) -> std::task::Poll<Self::Output> {
       23146  +
        let this = self.project();
       23147  +
        this.inner.as_mut().poll(cx)
       23148  +
    }
       23149  +
}
       23150  +
       23151  +
impl<B>
       23152  +
    ::aws_smithy_http_server::request::FromRequest<
       23153  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       23154  +
        B,
       23155  +
    > for crate::input::MalformedUnionInput
       23156  +
where
       23157  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       23158  +
    B: 'static,
       23159  +
       23160  +
    B::Data: Send,
       23161  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       23162  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       23163  +
{
       23164  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       23165  +
    type Future = MalformedUnionInputFuture;
       23166  +
       23167  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       23168  +
        let fut = async move {
       23169  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       23170  +
                request.headers(),
       23171  +
                &CONTENT_TYPE_MALFORMEDUNION,
24372  23172   
            ) {
       23173  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       23174  +
            }
       23175  +
            crate::protocol_serde::shape_malformed_union::de_malformed_union_http_request(request)
       23176  +
                .await
       23177  +
                .map_err(Into::into)
       23178  +
        };
       23179  +
        use ::futures_util::future::TryFutureExt;
       23180  +
        let fut = fut.map_err(
       23181  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       23182  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       23183  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       23184  +
                    e,
       23185  +
                )
       23186  +
            },
       23187  +
        );
       23188  +
        MalformedUnionInputFuture {
       23189  +
            inner: Box::pin(fut),
       23190  +
        }
       23191  +
    }
       23192  +
}
       23193  +
impl
       23194  +
    ::aws_smithy_http_server::response::IntoResponse<
       23195  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       23196  +
    > for crate::output::MalformedUnionOutput
       23197  +
{
       23198  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       23199  +
        match crate::protocol_serde::shape_malformed_union::ser_malformed_union_http_response(self)
       23200  +
        {
       23201  +
            Ok(response) => response,
       23202  +
            Err(e) => {
       23203  +
                ::tracing::error!(error = %e, "failed to serialize response");
       23204  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       23205  +
            }
       23206  +
        }
       23207  +
    }
       23208  +
}
       23209  +
       23210  +
#[allow(unreachable_code, unused_variables)]
       23211  +
#[cfg(test)]
       23212  +
mod malformed_union_test {
       23213  +
       23214  +
    /// When the union has multiple fields set, the response should be a 400
       23215  +
    /// SerializationException.
       23216  +
    /// Test ID: RestJsonMalformedUnionMultipleFieldsSet
       23217  +
    #[::tokio::test]
       23218  +
    #[::tracing_test::traced_test]
       23219  +
    async fn rest_json_malformed_union_multiple_fields_set_malformed_request() {
24373  23220   
        {
24374  23221   
            #[allow(unused_mut)]
24375  23222   
            let mut http_request = http::Request::builder()
24376         -
                .uri("/MalformedTimestampBodyDefault")
       23223  +
                .uri("/MalformedUnion")
24377  23224   
                .method("POST")
24378  23225   
                .header("content-type", "application/json")
24379  23226   
                .body(::aws_smithy_http_server::body::Body::from(
24380         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 0x42 }".as_bytes()),
       23227  +
                    ::bytes::Bytes::from_static(
       23228  +
                        "{ \"union\" : { \"int\": 2, \"string\": \"three\" } }".as_bytes(),
       23229  +
                    ),
24381  23230   
                ))
24382  23231   
                .unwrap();
24383  23232   
            #[allow(unused_mut)]
24384  23233   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24385  23234   
            let config = crate::service::RestJsonConfig::builder().build();
24386  23235   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24387         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23236  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
24388  23237   
                                let sender = sender.clone();
24389  23238   
                                async move {
24390         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23239  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
24391  23240   
                                    sender.send(()).await.expect("receiver dropped early");
24392  23241   
                                    result
24393  23242   
                                }
24394  23243   
                            })
24395  23244   
                            .build_unchecked();
24396  23245   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24397  23246   
                .await
24398  23247   
                .expect("unable to make an HTTP request");
24399  23248   
            ::pretty_assertions::assert_eq!(
24400  23249   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24401  23250   
                http_response.status()
24402  23251   
            );
24403  23252   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24404  23253   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24405  23254   
                http_response.headers(),
24406  23255   
                expected_headers,
24407  23256   
            ));
24408  23257   
        }
24409  23258   
    }
24410         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24411         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case3
       23259  +
    /// When the union has multiple fields set, even when only one is modeled,
       23260  +
    /// the response should be a 400 SerializationException.
       23261  +
    /// Test ID: RestJsonMalformedUnionKnownAndUnknownFieldsSet
24412  23262   
    #[::tokio::test]
24413         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case3_malformed_request(
24414         -
    ) {
       23263  +
    #[::tracing_test::traced_test]
       23264  +
    async fn rest_json_malformed_union_known_and_unknown_fields_set_malformed_request() {
24415  23265   
        {
24416  23266   
            #[allow(unused_mut)]
24417  23267   
            let mut http_request = http::Request::builder()
24418         -
                .uri("/MalformedTimestampBodyDefault")
       23268  +
                .uri("/MalformedUnion")
24419  23269   
                .method("POST")
24420  23270   
                .header("content-type", "application/json")
24421  23271   
                .body(::aws_smithy_http_server::body::Body::from(
24422         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.123.456 }".as_bytes()),
       23272  +
                    ::bytes::Bytes::from_static(
       23273  +
                        "{ \"union\" : { \"int\": 2, \"unknownField\": \"three\" } }".as_bytes(),
       23274  +
                    ),
24423  23275   
                ))
24424  23276   
                .unwrap();
24425  23277   
            #[allow(unused_mut)]
24426  23278   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24427  23279   
            let config = crate::service::RestJsonConfig::builder().build();
24428  23280   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24429         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23281  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
24430  23282   
                                let sender = sender.clone();
24431  23283   
                                async move {
24432         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23284  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
24433  23285   
                                    sender.send(()).await.expect("receiver dropped early");
24434  23286   
                                    result
24435  23287   
                                }
24436  23288   
                            })
24437  23289   
                            .build_unchecked();
24438  23290   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24439  23291   
                .await
24440  23292   
                .expect("unable to make an HTTP request");
24441  23293   
            ::pretty_assertions::assert_eq!(
24442  23294   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24443  23295   
                http_response.status()
24444  23296   
            );
24445  23297   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24446  23298   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24447  23299   
                http_response.headers(),
24448  23300   
                expected_headers,
24449  23301   
            ));
24450  23302   
        }
24451  23303   
    }
24452         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24453         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case4
       23304  +
    /// When the union has no fields set, the response should be a 400
       23305  +
    /// SerializationException.
       23306  +
    /// Test ID: RestJsonMalformedUnionNoFieldsSet
24454  23307   
    #[::tokio::test]
24455         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case4_malformed_request(
24456         -
    ) {
       23308  +
    #[::tracing_test::traced_test]
       23309  +
    async fn rest_json_malformed_union_no_fields_set_malformed_request() {
24457  23310   
        {
24458  23311   
            #[allow(unused_mut)]
24459  23312   
            let mut http_request = http::Request::builder()
24460         -
                .uri("/MalformedTimestampBodyDefault")
       23313  +
                .uri("/MalformedUnion")
24461  23314   
                .method("POST")
24462  23315   
                .header("content-type", "application/json")
24463  23316   
                .body(::aws_smithy_http_server::body::Body::from(
24464         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": Infinity }".as_bytes()),
       23317  +
                    ::bytes::Bytes::from_static("{ \"union\" : { \"int\": null } }".as_bytes()),
24465  23318   
                ))
24466  23319   
                .unwrap();
24467  23320   
            #[allow(unused_mut)]
24468  23321   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24469  23322   
            let config = crate::service::RestJsonConfig::builder().build();
24470  23323   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24471         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23324  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
24472  23325   
                                let sender = sender.clone();
24473  23326   
                                async move {
24474         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23327  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
24475  23328   
                                    sender.send(()).await.expect("receiver dropped early");
24476  23329   
                                    result
24477  23330   
                                }
24478  23331   
                            })
24479  23332   
                            .build_unchecked();
24480  23333   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24481  23334   
                .await
24482  23335   
                .expect("unable to make an HTTP request");
24483  23336   
            ::pretty_assertions::assert_eq!(
24484  23337   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24485  23338   
                http_response.status()
24486  23339   
            );
24487  23340   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24488  23341   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24489  23342   
                http_response.headers(),
24490  23343   
                expected_headers,
24491  23344   
            ));
24492  23345   
        }
24493  23346   
    }
24494         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24495         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case5
       23347  +
    /// When the union value is actually an array, the response should be a 400
       23348  +
    /// SerializationException.
       23349  +
    /// Test ID: RestJsonMalformedUnionValueIsArray
24496  23350   
    #[::tokio::test]
24497         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case5_malformed_request(
24498         -
    ) {
       23351  +
    #[::tracing_test::traced_test]
       23352  +
    async fn rest_json_malformed_union_value_is_array_malformed_request() {
24499  23353   
        {
24500  23354   
            #[allow(unused_mut)]
24501  23355   
            let mut http_request = http::Request::builder()
24502         -
                .uri("/MalformedTimestampBodyDefault")
       23356  +
                .uri("/MalformedUnion")
24503  23357   
                .method("POST")
24504  23358   
                .header("content-type", "application/json")
24505  23359   
                .body(::aws_smithy_http_server::body::Body::from(
24506         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"Infinity\" }".as_bytes()),
       23360  +
                    ::bytes::Bytes::from_static("{ \"union\" : [\"int\"] }".as_bytes()),
24507  23361   
                ))
24508  23362   
                .unwrap();
24509  23363   
            #[allow(unused_mut)]
24510  23364   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24511  23365   
            let config = crate::service::RestJsonConfig::builder().build();
24512  23366   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24513         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23367  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
24514  23368   
                                let sender = sender.clone();
24515  23369   
                                async move {
24516         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23370  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
24517  23371   
                                    sender.send(()).await.expect("receiver dropped early");
24518  23372   
                                    result
24519  23373   
                                }
24520  23374   
                            })
24521  23375   
                            .build_unchecked();
24522  23376   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24523  23377   
                .await
24524  23378   
                .expect("unable to make an HTTP request");
24525  23379   
            ::pretty_assertions::assert_eq!(
24526  23380   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24527  23381   
                http_response.status()
24528  23382   
            );
24529  23383   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24530  23384   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24531  23385   
                http_response.headers(),
24532  23386   
                expected_headers,
24533  23387   
            ));
24534  23388   
        }
24535  23389   
    }
24536         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24537         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case6
       23390  +
    /// When an unknown union member is received, the response should be a 400
       23391  +
    /// SerializationException.
       23392  +
    /// Test ID: RestJsonMalformedUnionUnknownMember
24538  23393   
    #[::tokio::test]
24539         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case6_malformed_request(
24540         -
    ) {
       23394  +
    #[::tracing_test::traced_test]
       23395  +
    async fn rest_json_malformed_union_unknown_member_malformed_request() {
24541  23396   
        {
24542  23397   
            #[allow(unused_mut)]
24543  23398   
            let mut http_request = http::Request::builder()
24544         -
                .uri("/MalformedTimestampBodyDefault")
       23399  +
                .uri("/MalformedUnion")
24545  23400   
                .method("POST")
24546  23401   
                .header("content-type", "application/json")
24547  23402   
                .body(::aws_smithy_http_server::body::Body::from(
24548         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": -Infinity }".as_bytes()),
       23403  +
                    ::bytes::Bytes::from_static(
       23404  +
                        "{\n    \"union\": {\n        \"unknown\": \"hello\"\n    }\n}".as_bytes(),
       23405  +
                    ),
24549  23406   
                ))
24550  23407   
                .unwrap();
24551  23408   
            #[allow(unused_mut)]
24552  23409   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24553  23410   
            let config = crate::service::RestJsonConfig::builder().build();
24554  23411   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24555         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23412  +
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
24556  23413   
                                let sender = sender.clone();
24557  23414   
                                async move {
24558         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23415  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
24559  23416   
                                    sender.send(()).await.expect("receiver dropped early");
24560  23417   
                                    result
24561  23418   
                                }
24562  23419   
                            })
24563  23420   
                            .build_unchecked();
24564  23421   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24565  23422   
                .await
24566  23423   
                .expect("unable to make an HTTP request");
24567  23424   
            ::pretty_assertions::assert_eq!(
24568  23425   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24569  23426   
                http_response.status()
24570  23427   
            );
24571  23428   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24572  23429   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24573  23430   
                http_response.headers(),
24574  23431   
                expected_headers,
24575  23432   
            ));
24576  23433   
        }
24577  23434   
    }
24578         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24579         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case7
24580         -
    #[::tokio::test]
24581         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case7_malformed_request(
       23435  +
}
       23436  +
       23437  +
const CONTENT_TYPE_MALFORMEDINTEGER: ::mime::Mime = ::mime::APPLICATION_JSON;
       23438  +
::pin_project_lite::pin_project! {
       23439  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       23440  +
    /// [`MalformedIntegerInput`](crate::input::MalformedIntegerInput) using modelled bindings.
       23441  +
    pub struct MalformedIntegerInputFuture {
       23442  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedIntegerInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       23443  +
    }
       23444  +
}
       23445  +
       23446  +
impl std::future::Future for MalformedIntegerInputFuture {
       23447  +
    type Output = Result<
       23448  +
        crate::input::MalformedIntegerInput,
       23449  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       23450  +
    >;
       23451  +
       23452  +
    fn poll(
       23453  +
        self: std::pin::Pin<&mut Self>,
       23454  +
        cx: &mut std::task::Context<'_>,
       23455  +
    ) -> std::task::Poll<Self::Output> {
       23456  +
        let this = self.project();
       23457  +
        this.inner.as_mut().poll(cx)
       23458  +
    }
       23459  +
}
       23460  +
       23461  +
impl<B>
       23462  +
    ::aws_smithy_http_server::request::FromRequest<
       23463  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       23464  +
        B,
       23465  +
    > for crate::input::MalformedIntegerInput
       23466  +
where
       23467  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       23468  +
    B: 'static,
       23469  +
       23470  +
    B::Data: Send,
       23471  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       23472  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       23473  +
{
       23474  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       23475  +
    type Future = MalformedIntegerInputFuture;
       23476  +
       23477  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       23478  +
        let fut = async move {
       23479  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       23480  +
                request.headers(),
       23481  +
                &CONTENT_TYPE_MALFORMEDINTEGER,
       23482  +
            ) {
       23483  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       23484  +
            }
       23485  +
            crate::protocol_serde::shape_malformed_integer::de_malformed_integer_http_request(
       23486  +
                request,
       23487  +
            )
       23488  +
            .await
       23489  +
            .map_err(Into::into)
       23490  +
        };
       23491  +
        use ::futures_util::future::TryFutureExt;
       23492  +
        let fut = fut.map_err(
       23493  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       23494  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       23495  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       23496  +
                    e,
       23497  +
                )
       23498  +
            },
       23499  +
        );
       23500  +
        MalformedIntegerInputFuture {
       23501  +
            inner: Box::pin(fut),
       23502  +
        }
       23503  +
    }
       23504  +
}
       23505  +
impl
       23506  +
    ::aws_smithy_http_server::response::IntoResponse<
       23507  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       23508  +
    > for crate::output::MalformedIntegerOutput
       23509  +
{
       23510  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       23511  +
        match crate::protocol_serde::shape_malformed_integer::ser_malformed_integer_http_response(
       23512  +
            self,
       23513  +
        ) {
       23514  +
            Ok(response) => response,
       23515  +
            Err(e) => {
       23516  +
                ::tracing::error!(error = %e, "failed to serialize response");
       23517  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       23518  +
            }
       23519  +
        }
       23520  +
    }
       23521  +
}
       23522  +
impl
       23523  +
    ::aws_smithy_http_server::response::IntoResponse<
       23524  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       23525  +
    > for crate::error::MalformedIntegerError
       23526  +
{
       23527  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       23528  +
        match crate::protocol_serde::shape_malformed_integer::ser_malformed_integer_http_error(
       23529  +
            &self,
24582  23530   
        ) {
       23531  +
            Ok(mut response) => {
       23532  +
                response.extensions_mut().insert(
       23533  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       23534  +
                );
       23535  +
                response
       23536  +
            }
       23537  +
            Err(e) => {
       23538  +
                ::tracing::error!(error = %e, "failed to serialize response");
       23539  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       23540  +
            }
       23541  +
        }
       23542  +
    }
       23543  +
}
       23544  +
       23545  +
#[allow(unreachable_code, unused_variables)]
       23546  +
#[cfg(test)]
       23547  +
mod malformed_integer_test {
       23548  +
       23549  +
    /// Underflow or overflow should result in SerializationException
       23550  +
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case0
       23551  +
    #[::tokio::test]
       23552  +
    #[::tracing_test::traced_test]
       23553  +
    async fn rest_json_body_integer_underflow_overflow_case0_malformed_request() {
24583  23554   
        {
24584  23555   
            #[allow(unused_mut)]
24585  23556   
            let mut http_request = http::Request::builder()
24586         -
                .uri("/MalformedTimestampBodyDefault")
       23557  +
                .uri("/MalformedInteger/1")
24587  23558   
                .method("POST")
24588  23559   
                .header("content-type", "application/json")
24589  23560   
                .body(::aws_smithy_http_server::body::Body::from(
24590         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"-Infinity\" }".as_bytes()),
       23561  +
                    ::bytes::Bytes::from_static(
       23562  +
                        "{ \"integerInBody\" : -9223372000000000000 }".as_bytes(),
       23563  +
                    ),
24591  23564   
                ))
24592  23565   
                .unwrap();
24593  23566   
            #[allow(unused_mut)]
24594  23567   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24595  23568   
            let config = crate::service::RestJsonConfig::builder().build();
24596  23569   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24597         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23570  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24598  23571   
                                let sender = sender.clone();
24599  23572   
                                async move {
24600         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23573  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24601  23574   
                                    sender.send(()).await.expect("receiver dropped early");
24602  23575   
                                    result
24603  23576   
                                }
24604  23577   
                            })
24605  23578   
                            .build_unchecked();
24606  23579   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24607  23580   
                .await
24608  23581   
                .expect("unable to make an HTTP request");
24609  23582   
            ::pretty_assertions::assert_eq!(
24610  23583   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24611  23584   
                http_response.status()
24612  23585   
            );
24613  23586   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24614  23587   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24615  23588   
                http_response.headers(),
24616  23589   
                expected_headers,
24617  23590   
            ));
24618  23591   
        }
24619  23592   
    }
24620         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24621         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case8
       23593  +
    /// Underflow or overflow should result in SerializationException
       23594  +
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case1
24622  23595   
    #[::tokio::test]
24623         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case8_malformed_request(
24624         -
    ) {
       23596  +
    #[::tracing_test::traced_test]
       23597  +
    async fn rest_json_body_integer_underflow_overflow_case1_malformed_request() {
24625  23598   
        {
24626  23599   
            #[allow(unused_mut)]
24627  23600   
            let mut http_request = http::Request::builder()
24628         -
                .uri("/MalformedTimestampBodyDefault")
       23601  +
                .uri("/MalformedInteger/1")
24629  23602   
                .method("POST")
24630  23603   
                .header("content-type", "application/json")
24631  23604   
                .body(::aws_smithy_http_server::body::Body::from(
24632         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": NaN }".as_bytes()),
       23605  +
                    ::bytes::Bytes::from_static(
       23606  +
                        "{ \"integerInBody\" : 9223372000000000000 }".as_bytes(),
       23607  +
                    ),
24633  23608   
                ))
24634  23609   
                .unwrap();
24635  23610   
            #[allow(unused_mut)]
24636  23611   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24637  23612   
            let config = crate::service::RestJsonConfig::builder().build();
24638  23613   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24639         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23614  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24640  23615   
                                let sender = sender.clone();
24641  23616   
                                async move {
24642         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23617  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24643  23618   
                                    sender.send(()).await.expect("receiver dropped early");
24644  23619   
                                    result
24645  23620   
                                }
24646  23621   
                            })
24647  23622   
                            .build_unchecked();
24648  23623   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24649  23624   
                .await
24650  23625   
                .expect("unable to make an HTTP request");
24651  23626   
            ::pretty_assertions::assert_eq!(
24652  23627   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24653  23628   
                http_response.status()
24654  23629   
            );
24655  23630   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24656  23631   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24657  23632   
                http_response.headers(),
24658  23633   
                expected_headers,
24659  23634   
            ));
24660  23635   
        }
24661  23636   
    }
24662         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
24663         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case9
       23637  +
    /// Underflow or overflow should result in SerializationException
       23638  +
    /// Test ID: RestJsonBodyIntegerUnderflowOverflow_case2
24664  23639   
    #[::tokio::test]
24665         -
    async fn rest_json_body_timestamp_default_rejects_malformed_epoch_seconds_case9_malformed_request(
24666         -
    ) {
       23640  +
    #[::tracing_test::traced_test]
       23641  +
    async fn rest_json_body_integer_underflow_overflow_case2_malformed_request() {
24667  23642   
        {
24668  23643   
            #[allow(unused_mut)]
24669  23644   
            let mut http_request = http::Request::builder()
24670         -
                .uri("/MalformedTimestampBodyDefault")
       23645  +
                .uri("/MalformedInteger/1")
24671  23646   
                .method("POST")
24672  23647   
                .header("content-type", "application/json")
24673  23648   
                .body(::aws_smithy_http_server::body::Body::from(
24674         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": \"NaN\" }".as_bytes()),
       23649  +
                    ::bytes::Bytes::from_static(
       23650  +
                        "{ \"integerInBody\" : 123000000000000000000000 }".as_bytes(),
       23651  +
                    ),
24675  23652   
                ))
24676  23653   
                .unwrap();
24677  23654   
            #[allow(unused_mut)]
24678  23655   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24679  23656   
            let config = crate::service::RestJsonConfig::builder().build();
24680  23657   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24681         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23658  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24682  23659   
                                let sender = sender.clone();
24683  23660   
                                async move {
24684         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23661  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24685  23662   
                                    sender.send(()).await.expect("receiver dropped early");
24686  23663   
                                    result
24687  23664   
                                }
24688  23665   
                            })
24689  23666   
                            .build_unchecked();
24690  23667   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24691  23668   
                .await
24692  23669   
                .expect("unable to make an HTTP request");
24693  23670   
            ::pretty_assertions::assert_eq!(
24694  23671   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24695  23672   
                http_response.status()
24696  23673   
            );
24697  23674   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24698  23675   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24699  23676   
                http_response.headers(),
24700  23677   
                expected_headers,
24701  23678   
            ));
24702  23679   
        }
24703  23680   
    }
24704         -
    /// By default, IMF-fixdate timestamps are rejected with a
24705         -
    /// 400 SerializationException
24706         -
    /// Test ID: RestJsonBodyTimestampDefaultRejectsHttpDate_case0
       23681  +
    /// Underflow or overflow should result in SerializationException
       23682  +
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case0
24707  23683   
    #[::tokio::test]
24708         -
    async fn rest_json_body_timestamp_default_rejects_http_date_case0_malformed_request() {
       23684  +
    #[::tracing_test::traced_test]
       23685  +
    async fn rest_json_path_integer_underflow_overflow_case0_malformed_request() {
24709  23686   
        {
24710  23687   
            #[allow(unused_mut)]
24711  23688   
            let mut http_request = http::Request::builder()
24712         -
                .uri("/MalformedTimestampBodyDefault")
       23689  +
                .uri("/MalformedInteger/-9223372000000000000")
24713  23690   
                .method("POST")
24714         -
                .header("content-type", "application/json")
24715         -
                .body(::aws_smithy_http_server::body::Body::from(
24716         -
                    ::bytes::Bytes::from_static(
24717         -
                        "{ \"timestamp\": \"Tue, 29 Apr 2014 18:30:38 GMT\" }".as_bytes(),
24718         -
                    ),
24719         -
                ))
       23691  +
                .body(::aws_smithy_http_server::body::Body::empty())
24720  23692   
                .unwrap();
24721  23693   
            #[allow(unused_mut)]
24722  23694   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24723  23695   
            let config = crate::service::RestJsonConfig::builder().build();
24724  23696   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24725         -
                            .malformed_timestamp_body_default(move |input: crate::input::MalformedTimestampBodyDefaultInput| {
       23697  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24726  23698   
                                let sender = sender.clone();
24727  23699   
                                async move {
24728         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyDefaultOutput, crate::error::MalformedTimestampBodyDefaultError> };
       23700  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24729  23701   
                                    sender.send(()).await.expect("receiver dropped early");
24730  23702   
                                    result
24731  23703   
                                }
24732  23704   
                            })
24733  23705   
                            .build_unchecked();
24734  23706   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24735  23707   
                .await
24736  23708   
                .expect("unable to make an HTTP request");
24737  23709   
            ::pretty_assertions::assert_eq!(
24738  23710   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24739  23711   
                http_response.status()
24740  23712   
            );
24741  23713   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24742  23714   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24743  23715   
                http_response.headers(),
24744  23716   
                expected_headers,
24745  23717   
            ));
24746  23718   
        }
24747  23719   
    }
24748         -
}
24749         -
#[cfg(test)]
24750         -
#[allow(unreachable_code, unused_variables)]
24751         -
mod server_malformed_timestamp_body_http_date_test {
24752         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
24753         -
    /// 400 SerializationException
24754         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case0
       23720  +
    /// Underflow or overflow should result in SerializationException
       23721  +
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case1
24755  23722   
    #[::tokio::test]
24756         -
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case0_malformed_request() {
       23723  +
    #[::tracing_test::traced_test]
       23724  +
    async fn rest_json_path_integer_underflow_overflow_case1_malformed_request() {
24757  23725   
        {
24758  23726   
            #[allow(unused_mut)]
24759  23727   
            let mut http_request = http::Request::builder()
24760         -
                .uri("/MalformedTimestampBodyHttpDate")
       23728  +
                .uri("/MalformedInteger/9223372000000000000")
24761  23729   
                .method("POST")
24762         -
                .header("content-type", "application/json")
24763         -
                .body(::aws_smithy_http_server::body::Body::from(
24764         -
                    ::bytes::Bytes::from_static(
24765         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50.52Z\" }".as_bytes(),
24766         -
                    ),
24767         -
                ))
       23730  +
                .body(::aws_smithy_http_server::body::Body::empty())
24768  23731   
                .unwrap();
24769  23732   
            #[allow(unused_mut)]
24770  23733   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24771  23734   
            let config = crate::service::RestJsonConfig::builder().build();
24772  23735   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24773         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       23736  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24774  23737   
                                let sender = sender.clone();
24775  23738   
                                async move {
24776         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
       23739  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24777  23740   
                                    sender.send(()).await.expect("receiver dropped early");
24778  23741   
                                    result
24779  23742   
                                }
24780  23743   
                            })
24781  23744   
                            .build_unchecked();
24782  23745   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24783  23746   
                .await
24784  23747   
                .expect("unable to make an HTTP request");
24785  23748   
            ::pretty_assertions::assert_eq!(
24786  23749   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24787  23750   
                http_response.status()
24788  23751   
            );
24789  23752   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24790  23753   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24791  23754   
                http_response.headers(),
24792  23755   
                expected_headers,
24793  23756   
            ));
24794  23757   
        }
24795  23758   
    }
24796         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
24797         -
    /// 400 SerializationException
24798         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case1
       23759  +
    /// Underflow or overflow should result in SerializationException
       23760  +
    /// Test ID: RestJsonPathIntegerUnderflowOverflow_case2
24799  23761   
    #[::tokio::test]
24800         -
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case1_malformed_request() {
       23762  +
    #[::tracing_test::traced_test]
       23763  +
    async fn rest_json_path_integer_underflow_overflow_case2_malformed_request() {
24801  23764   
        {
24802  23765   
            #[allow(unused_mut)]
24803  23766   
            let mut http_request = http::Request::builder()
24804         -
                .uri("/MalformedTimestampBodyHttpDate")
       23767  +
                .uri("/MalformedInteger/123000000000000000000000")
24805  23768   
                .method("POST")
24806         -
                .header("content-type", "application/json")
24807         -
                .body(::aws_smithy_http_server::body::Body::from(
24808         -
                    ::bytes::Bytes::from_static(
24809         -
                        "{ \"timestamp\": \"1985-04-12T23:20:50Z\" }".as_bytes(),
24810         -
                    ),
24811         -
                ))
       23769  +
                .body(::aws_smithy_http_server::body::Body::empty())
24812  23770   
                .unwrap();
24813  23771   
            #[allow(unused_mut)]
24814  23772   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24815  23773   
            let config = crate::service::RestJsonConfig::builder().build();
24816  23774   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24817         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       23775  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24818  23776   
                                let sender = sender.clone();
24819  23777   
                                async move {
24820         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
       23778  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24821  23779   
                                    sender.send(()).await.expect("receiver dropped early");
24822  23780   
                                    result
24823  23781   
                                }
24824  23782   
                            })
24825  23783   
                            .build_unchecked();
24826  23784   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24827  23785   
                .await
24828  23786   
                .expect("unable to make an HTTP request");
24829  23787   
            ::pretty_assertions::assert_eq!(
24830  23788   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24831  23789   
                http_response.status()
24832  23790   
            );
24833  23791   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24834  23792   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24835  23793   
                http_response.headers(),
24836  23794   
                expected_headers,
24837  23795   
            ));
24838  23796   
        }
24839  23797   
    }
24840         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
24841         -
    /// 400 SerializationException
24842         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsDateTime_case2
       23798  +
    /// Underflow or overflow should result in SerializationException
       23799  +
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case0
24843  23800   
    #[::tokio::test]
24844         -
    async fn rest_json_body_timestamp_http_date_rejects_date_time_case2_malformed_request() {
       23801  +
    #[::tracing_test::traced_test]
       23802  +
    async fn rest_json_query_integer_underflow_overflow_case0_malformed_request() {
24845  23803   
        {
24846  23804   
            #[allow(unused_mut)]
24847  23805   
            let mut http_request = http::Request::builder()
24848         -
                .uri("/MalformedTimestampBodyHttpDate")
       23806  +
                .uri("/MalformedInteger/1")
24849  23807   
                .method("POST")
24850         -
                .header("content-type", "application/json")
24851         -
                .body(::aws_smithy_http_server::body::Body::from(
24852         -
                    ::bytes::Bytes::from_static(
24853         -
                        "{ \"timestamp\": \"1996-12-19T16:39:57-08:00\" }".as_bytes(),
24854         -
                    ),
24855         -
                ))
       23808  +
                .body(::aws_smithy_http_server::body::Body::empty())
       23809  +
                .unwrap();
       23810  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-9223372000000000000"
       23811  +
                .parse()
24856  23812   
                .unwrap();
24857  23813   
            #[allow(unused_mut)]
24858  23814   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24859  23815   
            let config = crate::service::RestJsonConfig::builder().build();
24860  23816   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24861         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       23817  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24862  23818   
                                let sender = sender.clone();
24863  23819   
                                async move {
24864         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
       23820  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24865  23821   
                                    sender.send(()).await.expect("receiver dropped early");
24866  23822   
                                    result
24867  23823   
                                }
24868  23824   
                            })
24869  23825   
                            .build_unchecked();
24870  23826   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24871  23827   
                .await
24872  23828   
                .expect("unable to make an HTTP request");
24873  23829   
            ::pretty_assertions::assert_eq!(
24874  23830   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24875  23831   
                http_response.status()
24876  23832   
            );
24877  23833   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24878  23834   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24879  23835   
                http_response.headers(),
24880  23836   
                expected_headers,
24881  23837   
            ));
24882  23838   
        }
24883  23839   
    }
24884         -
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
24885         -
    /// 400 SerializationException
24886         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case0
       23840  +
    /// Underflow or overflow should result in SerializationException
       23841  +
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case1
24887  23842   
    #[::tokio::test]
24888         -
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case0_malformed_request() {
       23843  +
    #[::tracing_test::traced_test]
       23844  +
    async fn rest_json_query_integer_underflow_overflow_case1_malformed_request() {
24889  23845   
        {
24890  23846   
            #[allow(unused_mut)]
24891  23847   
            let mut http_request = http::Request::builder()
24892         -
                .uri("/MalformedTimestampBodyHttpDate")
       23848  +
                .uri("/MalformedInteger/1")
24893  23849   
                .method("POST")
24894         -
                .header("content-type", "application/json")
24895         -
                .body(::aws_smithy_http_server::body::Body::from(
24896         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081.1234 }".as_bytes()),
24897         -
                ))
       23850  +
                .body(::aws_smithy_http_server::body::Body::empty())
       23851  +
                .unwrap();
       23852  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=9223372000000000000"
       23853  +
                .parse()
24898  23854   
                .unwrap();
24899  23855   
            #[allow(unused_mut)]
24900  23856   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24901  23857   
            let config = crate::service::RestJsonConfig::builder().build();
24902  23858   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24903         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       23859  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24904  23860   
                                let sender = sender.clone();
24905  23861   
                                async move {
24906         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
       23862  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24907  23863   
                                    sender.send(()).await.expect("receiver dropped early");
24908  23864   
                                    result
24909  23865   
                                }
24910  23866   
                            })
24911  23867   
                            .build_unchecked();
24912  23868   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24913  23869   
                .await
24914  23870   
                .expect("unable to make an HTTP request");
24915  23871   
            ::pretty_assertions::assert_eq!(
24916  23872   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24917  23873   
                http_response.status()
24918  23874   
            );
24919  23875   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24920  23876   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24921  23877   
                http_response.headers(),
24922  23878   
                expected_headers,
24923  23879   
            ));
24924  23880   
        }
24925  23881   
    }
24926         -
    /// When the format is http-date, epoch-seconds timestamps are rejected with a
24927         -
    /// 400 SerializationException
24928         -
    /// Test ID: RestJsonBodyTimestampHttpDateRejectsEpoch_case1
       23882  +
    /// Underflow or overflow should result in SerializationException
       23883  +
    /// Test ID: RestJsonQueryIntegerUnderflowOverflow_case2
24929  23884   
    #[::tokio::test]
24930         -
    async fn rest_json_body_timestamp_http_date_rejects_epoch_case1_malformed_request() {
       23885  +
    #[::tracing_test::traced_test]
       23886  +
    async fn rest_json_query_integer_underflow_overflow_case2_malformed_request() {
24931  23887   
        {
24932  23888   
            #[allow(unused_mut)]
24933  23889   
            let mut http_request = http::Request::builder()
24934         -
                .uri("/MalformedTimestampBodyHttpDate")
       23890  +
                .uri("/MalformedInteger/1")
24935  23891   
                .method("POST")
24936         -
                .header("content-type", "application/json")
24937         -
                .body(::aws_smithy_http_server::body::Body::from(
24938         -
                    ::bytes::Bytes::from_static("{ \"timestamp\": 1515531081 }".as_bytes()),
24939         -
                ))
       23892  +
                .body(::aws_smithy_http_server::body::Body::empty())
       23893  +
                .unwrap();
       23894  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=123000000000000000000000"
       23895  +
                .parse()
24940  23896   
                .unwrap();
24941  23897   
            #[allow(unused_mut)]
24942  23898   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24943  23899   
            let config = crate::service::RestJsonConfig::builder().build();
24944  23900   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24945         -
                            .malformed_timestamp_body_http_date(move |input: crate::input::MalformedTimestampBodyHttpDateInput| {
       23901  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24946  23902   
                                let sender = sender.clone();
24947  23903   
                                async move {
24948         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampBodyHttpDateOutput, crate::error::MalformedTimestampBodyHttpDateError> };
       23904  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24949  23905   
                                    sender.send(()).await.expect("receiver dropped early");
24950  23906   
                                    result
24951  23907   
                                }
24952  23908   
                            })
24953  23909   
                            .build_unchecked();
24954  23910   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24955  23911   
                .await
24956  23912   
                .expect("unable to make an HTTP request");
24957  23913   
            ::pretty_assertions::assert_eq!(
24958  23914   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
24959  23915   
                http_response.status()
24960  23916   
            );
24961  23917   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
24962  23918   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
24963  23919   
                http_response.headers(),
24964  23920   
                expected_headers,
24965  23921   
            ));
24966  23922   
        }
24967  23923   
    }
24968         -
}
24969         -
#[cfg(test)]
24970         -
#[allow(unreachable_code, unused_variables)]
24971         -
mod server_malformed_timestamp_header_date_time_test {
24972         -
    /// When the format is date-time, IMF-fixdate timestamps are rejected with a
24973         -
    /// 400 SerializationException
24974         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsHttpDate_case0
       23924  +
    /// Underflow or overflow should result in SerializationException
       23925  +
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case0
24975  23926   
    #[::tokio::test]
24976         -
    async fn rest_json_header_timestamp_date_time_rejects_http_date_case0_malformed_request() {
       23927  +
    #[::tracing_test::traced_test]
       23928  +
    async fn rest_json_header_integer_underflow_overflow_case0_malformed_request() {
24977  23929   
        {
24978  23930   
            #[allow(unused_mut)]
24979  23931   
            let mut http_request = http::Request::builder()
24980         -
                .uri("/MalformedTimestampHeaderDateTime")
       23932  +
                .uri("/MalformedInteger/1")
24981  23933   
                .method("POST")
24982         -
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
       23934  +
                .header("integerInHeader", "-9223372000000000000")
24983  23935   
                .body(::aws_smithy_http_server::body::Body::empty())
24984  23936   
                .unwrap();
24985  23937   
            #[allow(unused_mut)]
24986  23938   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
24987  23939   
            let config = crate::service::RestJsonConfig::builder().build();
24988  23940   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
24989         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       23941  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
24990  23942   
                                let sender = sender.clone();
24991  23943   
                                async move {
24992         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       23944  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
24993  23945   
                                    sender.send(()).await.expect("receiver dropped early");
24994  23946   
                                    result
24995  23947   
                                }
24996  23948   
                            })
24997  23949   
                            .build_unchecked();
24998  23950   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
24999  23951   
                .await
25000  23952   
                .expect("unable to make an HTTP request");
25001  23953   
            ::pretty_assertions::assert_eq!(
25002  23954   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25003  23955   
                http_response.status()
25004  23956   
            );
25005  23957   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25006  23958   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25007  23959   
                http_response.headers(),
25008  23960   
                expected_headers,
25009  23961   
            ));
25010  23962   
        }
25011  23963   
    }
25012         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
25013         -
    /// 400 SerializationException
25014         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case0
       23964  +
    /// Underflow or overflow should result in SerializationException
       23965  +
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case1
25015  23966   
    #[::tokio::test]
25016         -
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case0_malformed_request() {
       23967  +
    #[::tracing_test::traced_test]
       23968  +
    async fn rest_json_header_integer_underflow_overflow_case1_malformed_request() {
25017  23969   
        {
25018  23970   
            #[allow(unused_mut)]
25019  23971   
            let mut http_request = http::Request::builder()
25020         -
                .uri("/MalformedTimestampHeaderDateTime")
       23972  +
                .uri("/MalformedInteger/1")
25021  23973   
                .method("POST")
25022         -
                .header("timestamp", "1515531081.1234")
       23974  +
                .header("integerInHeader", "9223372000000000000")
25023  23975   
                .body(::aws_smithy_http_server::body::Body::empty())
25024  23976   
                .unwrap();
25025  23977   
            #[allow(unused_mut)]
25026  23978   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25027  23979   
            let config = crate::service::RestJsonConfig::builder().build();
25028  23980   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25029         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       23981  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25030  23982   
                                let sender = sender.clone();
25031  23983   
                                async move {
25032         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       23984  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25033  23985   
                                    sender.send(()).await.expect("receiver dropped early");
25034  23986   
                                    result
25035  23987   
                                }
25036  23988   
                            })
25037  23989   
                            .build_unchecked();
25038  23990   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25039  23991   
                .await
25040  23992   
                .expect("unable to make an HTTP request");
25041  23993   
            ::pretty_assertions::assert_eq!(
25042  23994   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25043  23995   
                http_response.status()
25044  23996   
            );
25045  23997   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25046  23998   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25047  23999   
                http_response.headers(),
25048  24000   
                expected_headers,
25049  24001   
            ));
25050  24002   
        }
25051  24003   
    }
25052         -
    /// When the format is date-time, epoch-seconds timestamps are rejected with a
25053         -
    /// 400 SerializationException
25054         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case1
       24004  +
    /// Underflow or overflow should result in SerializationException
       24005  +
    /// Test ID: RestJsonHeaderIntegerUnderflowOverflow_case2
25055  24006   
    #[::tokio::test]
25056         -
    async fn rest_json_header_timestamp_date_time_rejects_epoch_seconds_case1_malformed_request() {
       24007  +
    #[::tracing_test::traced_test]
       24008  +
    async fn rest_json_header_integer_underflow_overflow_case2_malformed_request() {
25057  24009   
        {
25058  24010   
            #[allow(unused_mut)]
25059  24011   
            let mut http_request = http::Request::builder()
25060         -
                .uri("/MalformedTimestampHeaderDateTime")
       24012  +
                .uri("/MalformedInteger/1")
25061  24013   
                .method("POST")
25062         -
                .header("timestamp", "1515531081")
       24014  +
                .header("integerInHeader", "123000000000000000000000")
25063  24015   
                .body(::aws_smithy_http_server::body::Body::empty())
25064  24016   
                .unwrap();
25065  24017   
            #[allow(unused_mut)]
25066  24018   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25067  24019   
            let config = crate::service::RestJsonConfig::builder().build();
25068  24020   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25069         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24021  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25070  24022   
                                let sender = sender.clone();
25071  24023   
                                async move {
25072         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24024  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25073  24025   
                                    sender.send(()).await.expect("receiver dropped early");
25074  24026   
                                    result
25075  24027   
                                }
25076  24028   
                            })
25077  24029   
                            .build_unchecked();
25078  24030   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25079  24031   
                .await
25080  24032   
                .expect("unable to make an HTTP request");
25081  24033   
            ::pretty_assertions::assert_eq!(
25082  24034   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25083  24035   
                http_response.status()
25084  24036   
            );
25085  24037   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25086  24038   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25087  24039   
                http_response.headers(),
25088  24040   
                expected_headers,
25089  24041   
            ));
25090  24042   
        }
25091  24043   
    }
25092         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25093         -
    /// are rejected with a 400 SerializationException
25094         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case0
       24044  +
    /// Malformed values in the body should be rejected
       24045  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case0
25095  24046   
    #[::tokio::test]
25096         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case0_malformed_request(
25097         -
    ) {
       24047  +
    #[::tracing_test::traced_test]
       24048  +
    async fn rest_json_body_integer_malformed_value_rejected_case0_malformed_request() {
25098  24049   
        {
25099  24050   
            #[allow(unused_mut)]
25100  24051   
            let mut http_request = http::Request::builder()
25101         -
                .uri("/MalformedTimestampHeaderDateTime")
       24052  +
                .uri("/MalformedInteger/1")
25102  24053   
                .method("POST")
25103         -
                .header("timestamp", "1996-12-19T16:39:57+00")
25104         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24054  +
                .header("content-type", "application/json")
       24055  +
                .body(::aws_smithy_http_server::body::Body::from(
       24056  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"123\" }".as_bytes()),
       24057  +
                ))
25105  24058   
                .unwrap();
25106  24059   
            #[allow(unused_mut)]
25107  24060   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25108  24061   
            let config = crate::service::RestJsonConfig::builder().build();
25109  24062   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25110         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24063  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25111  24064   
                                let sender = sender.clone();
25112  24065   
                                async move {
25113         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24066  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25114  24067   
                                    sender.send(()).await.expect("receiver dropped early");
25115  24068   
                                    result
25116  24069   
                                }
25117  24070   
                            })
25118  24071   
                            .build_unchecked();
25119  24072   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25120  24073   
                .await
25121  24074   
                .expect("unable to make an HTTP request");
25122  24075   
            ::pretty_assertions::assert_eq!(
25123  24076   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25124  24077   
                http_response.status()
25125  24078   
            );
25126  24079   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25127  24080   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25128  24081   
                http_response.headers(),
25129  24082   
                expected_headers,
25130  24083   
            ));
25131  24084   
        }
25132  24085   
    }
25133         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25134         -
    /// are rejected with a 400 SerializationException
25135         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case1
       24086  +
    /// Malformed values in the body should be rejected
       24087  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case1
25136  24088   
    #[::tokio::test]
25137         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case1_malformed_request(
25138         -
    ) {
       24089  +
    #[::tracing_test::traced_test]
       24090  +
    async fn rest_json_body_integer_malformed_value_rejected_case1_malformed_request() {
25139  24091   
        {
25140  24092   
            #[allow(unused_mut)]
25141  24093   
            let mut http_request = http::Request::builder()
25142         -
                .uri("/MalformedTimestampHeaderDateTime")
       24094  +
                .uri("/MalformedInteger/1")
25143  24095   
                .method("POST")
25144         -
                .header("timestamp", "1996-12-19T16:39:57+00Z")
25145         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24096  +
                .header("content-type", "application/json")
       24097  +
                .body(::aws_smithy_http_server::body::Body::from(
       24098  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : true }".as_bytes()),
       24099  +
                ))
25146  24100   
                .unwrap();
25147  24101   
            #[allow(unused_mut)]
25148  24102   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25149  24103   
            let config = crate::service::RestJsonConfig::builder().build();
25150  24104   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25151         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24105  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25152  24106   
                                let sender = sender.clone();
25153  24107   
                                async move {
25154         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24108  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25155  24109   
                                    sender.send(()).await.expect("receiver dropped early");
25156  24110   
                                    result
25157  24111   
                                }
25158  24112   
                            })
25159  24113   
                            .build_unchecked();
25160  24114   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25161  24115   
                .await
25162  24116   
                .expect("unable to make an HTTP request");
25163  24117   
            ::pretty_assertions::assert_eq!(
25164  24118   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25165  24119   
                http_response.status()
25166  24120   
            );
25167  24121   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25168  24122   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25169  24123   
                http_response.headers(),
25170  24124   
                expected_headers,
25171  24125   
            ));
25172  24126   
        }
25173  24127   
    }
25174         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25175         -
    /// are rejected with a 400 SerializationException
25176         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case2
       24128  +
    /// Malformed values in the body should be rejected
       24129  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case2
25177  24130   
    #[::tokio::test]
25178         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case2_malformed_request(
25179         -
    ) {
       24131  +
    #[::tracing_test::traced_test]
       24132  +
    async fn rest_json_body_integer_malformed_value_rejected_case2_malformed_request() {
25180  24133   
        {
25181  24134   
            #[allow(unused_mut)]
25182  24135   
            let mut http_request = http::Request::builder()
25183         -
                .uri("/MalformedTimestampHeaderDateTime")
       24136  +
                .uri("/MalformedInteger/1")
25184  24137   
                .method("POST")
25185         -
                .header("timestamp", "1996-12-19T16:39:57")
25186         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24138  +
                .header("content-type", "application/json")
       24139  +
                .body(::aws_smithy_http_server::body::Body::from(
       24140  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 1.001 }".as_bytes()),
       24141  +
                ))
25187  24142   
                .unwrap();
25188  24143   
            #[allow(unused_mut)]
25189  24144   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25190  24145   
            let config = crate::service::RestJsonConfig::builder().build();
25191  24146   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25192         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24147  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25193  24148   
                                let sender = sender.clone();
25194  24149   
                                async move {
25195         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24150  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25196  24151   
                                    sender.send(()).await.expect("receiver dropped early");
25197  24152   
                                    result
25198  24153   
                                }
25199  24154   
                            })
25200  24155   
                            .build_unchecked();
25201  24156   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25202  24157   
                .await
25203  24158   
                .expect("unable to make an HTTP request");
25204  24159   
            ::pretty_assertions::assert_eq!(
25205  24160   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25206  24161   
                http_response.status()
25207  24162   
            );
25208  24163   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25209  24164   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25210  24165   
                http_response.headers(),
25211  24166   
                expected_headers,
25212  24167   
            ));
25213  24168   
        }
25214  24169   
    }
25215         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25216         -
    /// are rejected with a 400 SerializationException
25217         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case3
       24170  +
    /// Malformed values in the body should be rejected
       24171  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case3
25218  24172   
    #[::tokio::test]
25219         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case3_malformed_request(
25220         -
    ) {
       24173  +
    #[::tracing_test::traced_test]
       24174  +
    async fn rest_json_body_integer_malformed_value_rejected_case3_malformed_request() {
25221  24175   
        {
25222  24176   
            #[allow(unused_mut)]
25223  24177   
            let mut http_request = http::Request::builder()
25224         -
                .uri("/MalformedTimestampHeaderDateTime")
       24178  +
                .uri("/MalformedInteger/1")
25225  24179   
                .method("POST")
25226         -
                .header("timestamp", "1996-12-19T163957")
25227         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24180  +
                .header("content-type", "application/json")
       24181  +
                .body(::aws_smithy_http_server::body::Body::from(
       24182  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 2ABC }".as_bytes()),
       24183  +
                ))
25228  24184   
                .unwrap();
25229  24185   
            #[allow(unused_mut)]
25230  24186   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25231  24187   
            let config = crate::service::RestJsonConfig::builder().build();
25232  24188   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25233         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24189  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25234  24190   
                                let sender = sender.clone();
25235  24191   
                                async move {
25236         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24192  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25237  24193   
                                    sender.send(()).await.expect("receiver dropped early");
25238  24194   
                                    result
25239  24195   
                                }
25240  24196   
                            })
25241  24197   
                            .build_unchecked();
25242  24198   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25243  24199   
                .await
25244  24200   
                .expect("unable to make an HTTP request");
25245  24201   
            ::pretty_assertions::assert_eq!(
25246  24202   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25247  24203   
                http_response.status()
25248  24204   
            );
25249  24205   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25250  24206   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25251  24207   
                http_response.headers(),
25252  24208   
                expected_headers,
25253  24209   
            ));
25254  24210   
        }
25255  24211   
    }
25256         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25257         -
    /// are rejected with a 400 SerializationException
25258         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case4
       24212  +
    /// Malformed values in the body should be rejected
       24213  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case4
25259  24214   
    #[::tokio::test]
25260         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case4_malformed_request(
25261         -
    ) {
       24215  +
    #[::tracing_test::traced_test]
       24216  +
    async fn rest_json_body_integer_malformed_value_rejected_case4_malformed_request() {
25262  24217   
        {
25263  24218   
            #[allow(unused_mut)]
25264  24219   
            let mut http_request = http::Request::builder()
25265         -
                .uri("/MalformedTimestampHeaderDateTime")
       24220  +
                .uri("/MalformedInteger/1")
25266  24221   
                .method("POST")
25267         -
                .header("timestamp", "19961219T163957Z")
25268         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24222  +
                .header("content-type", "application/json")
       24223  +
                .body(::aws_smithy_http_server::body::Body::from(
       24224  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : 0x42 }".as_bytes()),
       24225  +
                ))
25269  24226   
                .unwrap();
25270  24227   
            #[allow(unused_mut)]
25271  24228   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25272  24229   
            let config = crate::service::RestJsonConfig::builder().build();
25273  24230   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25274         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24231  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25275  24232   
                                let sender = sender.clone();
25276  24233   
                                async move {
25277         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24234  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25278  24235   
                                    sender.send(()).await.expect("receiver dropped early");
25279  24236   
                                    result
25280  24237   
                                }
25281  24238   
                            })
25282  24239   
                            .build_unchecked();
25283  24240   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25284  24241   
                .await
25285  24242   
                .expect("unable to make an HTTP request");
25286  24243   
            ::pretty_assertions::assert_eq!(
25287  24244   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25288  24245   
                http_response.status()
25289  24246   
            );
25290  24247   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25291  24248   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25292  24249   
                http_response.headers(),
25293  24250   
                expected_headers,
25294  24251   
            ));
25295  24252   
        }
25296  24253   
    }
25297         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25298         -
    /// are rejected with a 400 SerializationException
25299         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case5
       24254  +
    /// Malformed values in the body should be rejected
       24255  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case5
25300  24256   
    #[::tokio::test]
25301         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case5_malformed_request(
25302         -
    ) {
       24257  +
    #[::tracing_test::traced_test]
       24258  +
    async fn rest_json_body_integer_malformed_value_rejected_case5_malformed_request() {
25303  24259   
        {
25304  24260   
            #[allow(unused_mut)]
25305  24261   
            let mut http_request = http::Request::builder()
25306         -
                .uri("/MalformedTimestampHeaderDateTime")
       24262  +
                .uri("/MalformedInteger/1")
25307  24263   
                .method("POST")
25308         -
                .header("timestamp", "19961219T163957")
25309         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24264  +
                .header("content-type", "application/json")
       24265  +
                .body(::aws_smithy_http_server::body::Body::from(
       24266  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : Infinity }".as_bytes()),
       24267  +
                ))
25310  24268   
                .unwrap();
25311  24269   
            #[allow(unused_mut)]
25312  24270   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25313  24271   
            let config = crate::service::RestJsonConfig::builder().build();
25314  24272   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25315         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24273  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25316  24274   
                                let sender = sender.clone();
25317  24275   
                                async move {
25318         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24276  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25319  24277   
                                    sender.send(()).await.expect("receiver dropped early");
25320  24278   
                                    result
25321  24279   
                                }
25322  24280   
                            })
25323  24281   
                            .build_unchecked();
25324  24282   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25325  24283   
                .await
25326  24284   
                .expect("unable to make an HTTP request");
25327  24285   
            ::pretty_assertions::assert_eq!(
25328  24286   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25329  24287   
                http_response.status()
25330  24288   
            );
25331  24289   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25332  24290   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25333  24291   
                http_response.headers(),
25334  24292   
                expected_headers,
25335  24293   
            ));
25336  24294   
        }
25337  24295   
    }
25338         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25339         -
    /// are rejected with a 400 SerializationException
25340         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case6
       24296  +
    /// Malformed values in the body should be rejected
       24297  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case6
25341  24298   
    #[::tokio::test]
25342         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case6_malformed_request(
25343         -
    ) {
       24299  +
    #[::tracing_test::traced_test]
       24300  +
    async fn rest_json_body_integer_malformed_value_rejected_case6_malformed_request() {
25344  24301   
        {
25345  24302   
            #[allow(unused_mut)]
25346  24303   
            let mut http_request = http::Request::builder()
25347         -
                .uri("/MalformedTimestampHeaderDateTime")
       24304  +
                .uri("/MalformedInteger/1")
25348  24305   
                .method("POST")
25349         -
                .header("timestamp", "19961219T16:39:57Z")
25350         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24306  +
                .header("content-type", "application/json")
       24307  +
                .body(::aws_smithy_http_server::body::Body::from(
       24308  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"Infinity\" }".as_bytes()),
       24309  +
                ))
25351  24310   
                .unwrap();
25352  24311   
            #[allow(unused_mut)]
25353  24312   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25354  24313   
            let config = crate::service::RestJsonConfig::builder().build();
25355  24314   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25356         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24315  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25357  24316   
                                let sender = sender.clone();
25358  24317   
                                async move {
25359         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24318  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25360  24319   
                                    sender.send(()).await.expect("receiver dropped early");
25361  24320   
                                    result
25362  24321   
                                }
25363  24322   
                            })
25364  24323   
                            .build_unchecked();
25365  24324   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25366  24325   
                .await
25367  24326   
                .expect("unable to make an HTTP request");
25368  24327   
            ::pretty_assertions::assert_eq!(
25369  24328   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25370  24329   
                http_response.status()
25371  24330   
            );
25372  24331   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25373  24332   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25374  24333   
                http_response.headers(),
25375  24334   
                expected_headers,
25376  24335   
            ));
25377  24336   
        }
25378  24337   
    }
25379         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25380         -
    /// are rejected with a 400 SerializationException
25381         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case7
       24338  +
    /// Malformed values in the body should be rejected
       24339  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case7
25382  24340   
    #[::tokio::test]
25383         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case7_malformed_request(
25384         -
    ) {
       24341  +
    #[::tracing_test::traced_test]
       24342  +
    async fn rest_json_body_integer_malformed_value_rejected_case7_malformed_request() {
25385  24343   
        {
25386  24344   
            #[allow(unused_mut)]
25387  24345   
            let mut http_request = http::Request::builder()
25388         -
                .uri("/MalformedTimestampHeaderDateTime")
       24346  +
                .uri("/MalformedInteger/1")
25389  24347   
                .method("POST")
25390         -
                .header("timestamp", "19961219T16:39:57")
25391         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24348  +
                .header("content-type", "application/json")
       24349  +
                .body(::aws_smithy_http_server::body::Body::from(
       24350  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : -Infinity }".as_bytes()),
       24351  +
                ))
25392  24352   
                .unwrap();
25393  24353   
            #[allow(unused_mut)]
25394  24354   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25395  24355   
            let config = crate::service::RestJsonConfig::builder().build();
25396  24356   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25397         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24357  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25398  24358   
                                let sender = sender.clone();
25399  24359   
                                async move {
25400         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24360  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25401  24361   
                                    sender.send(()).await.expect("receiver dropped early");
25402  24362   
                                    result
25403  24363   
                                }
25404  24364   
                            })
25405  24365   
                            .build_unchecked();
25406  24366   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25407  24367   
                .await
25408  24368   
                .expect("unable to make an HTTP request");
25409  24369   
            ::pretty_assertions::assert_eq!(
25410  24370   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25411  24371   
                http_response.status()
25412  24372   
            );
25413  24373   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25414  24374   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25415  24375   
                http_response.headers(),
25416  24376   
                expected_headers,
25417  24377   
            ));
25418  24378   
        }
25419  24379   
    }
25420         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25421         -
    /// are rejected with a 400 SerializationException
25422         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case8
       24380  +
    /// Malformed values in the body should be rejected
       24381  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case8
25423  24382   
    #[::tokio::test]
25424         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case8_malformed_request(
25425         -
    ) {
       24383  +
    #[::tracing_test::traced_test]
       24384  +
    async fn rest_json_body_integer_malformed_value_rejected_case8_malformed_request() {
25426  24385   
        {
25427  24386   
            #[allow(unused_mut)]
25428  24387   
            let mut http_request = http::Request::builder()
25429         -
                .uri("/MalformedTimestampHeaderDateTime")
       24388  +
                .uri("/MalformedInteger/1")
25430  24389   
                .method("POST")
25431         -
                .header("timestamp", "1996-12-19T16:39Z")
25432         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24390  +
                .header("content-type", "application/json")
       24391  +
                .body(::aws_smithy_http_server::body::Body::from(
       24392  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"-Infinity\" }".as_bytes()),
       24393  +
                ))
25433  24394   
                .unwrap();
25434  24395   
            #[allow(unused_mut)]
25435  24396   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25436  24397   
            let config = crate::service::RestJsonConfig::builder().build();
25437  24398   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25438         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24399  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25439  24400   
                                let sender = sender.clone();
25440  24401   
                                async move {
25441         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24402  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25442  24403   
                                    sender.send(()).await.expect("receiver dropped early");
25443  24404   
                                    result
25444  24405   
                                }
25445  24406   
                            })
25446  24407   
                            .build_unchecked();
25447  24408   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25448  24409   
                .await
25449  24410   
                .expect("unable to make an HTTP request");
25450  24411   
            ::pretty_assertions::assert_eq!(
25451  24412   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25452  24413   
                http_response.status()
25453  24414   
            );
25454  24415   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25455  24416   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25456  24417   
                http_response.headers(),
25457  24418   
                expected_headers,
25458  24419   
            ));
25459  24420   
        }
25460  24421   
    }
25461         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25462         -
    /// are rejected with a 400 SerializationException
25463         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case9
       24422  +
    /// Malformed values in the body should be rejected
       24423  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case9
25464  24424   
    #[::tokio::test]
25465         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case9_malformed_request(
25466         -
    ) {
       24425  +
    #[::tracing_test::traced_test]
       24426  +
    async fn rest_json_body_integer_malformed_value_rejected_case9_malformed_request() {
25467  24427   
        {
25468  24428   
            #[allow(unused_mut)]
25469  24429   
            let mut http_request = http::Request::builder()
25470         -
                .uri("/MalformedTimestampHeaderDateTime")
       24430  +
                .uri("/MalformedInteger/1")
25471  24431   
                .method("POST")
25472         -
                .header("timestamp", "1996-12-19T16:39")
25473         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24432  +
                .header("content-type", "application/json")
       24433  +
                .body(::aws_smithy_http_server::body::Body::from(
       24434  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : NaN }".as_bytes()),
       24435  +
                ))
25474  24436   
                .unwrap();
25475  24437   
            #[allow(unused_mut)]
25476  24438   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25477  24439   
            let config = crate::service::RestJsonConfig::builder().build();
25478  24440   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25479         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24441  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25480  24442   
                                let sender = sender.clone();
25481  24443   
                                async move {
25482         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24444  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25483  24445   
                                    sender.send(()).await.expect("receiver dropped early");
25484  24446   
                                    result
25485  24447   
                                }
25486  24448   
                            })
25487  24449   
                            .build_unchecked();
25488  24450   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25489  24451   
                .await
25490  24452   
                .expect("unable to make an HTTP request");
25491  24453   
            ::pretty_assertions::assert_eq!(
25492  24454   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25493  24455   
                http_response.status()
25494  24456   
            );
25495  24457   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25496  24458   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25497  24459   
                http_response.headers(),
25498  24460   
                expected_headers,
25499  24461   
            ));
25500  24462   
        }
25501  24463   
    }
25502         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25503         -
    /// are rejected with a 400 SerializationException
25504         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case10
       24464  +
    /// Malformed values in the body should be rejected
       24465  +
    /// Test ID: RestJsonBodyIntegerMalformedValueRejected_case10
25505  24466   
    #[::tokio::test]
25506         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case10_malformed_request(
25507         -
    ) {
       24467  +
    #[::tracing_test::traced_test]
       24468  +
    async fn rest_json_body_integer_malformed_value_rejected_case10_malformed_request() {
25508  24469   
        {
25509  24470   
            #[allow(unused_mut)]
25510  24471   
            let mut http_request = http::Request::builder()
25511         -
                .uri("/MalformedTimestampHeaderDateTime")
       24472  +
                .uri("/MalformedInteger/1")
25512  24473   
                .method("POST")
25513         -
                .header("timestamp", "1996-12-19T1639")
25514         -
                .body(::aws_smithy_http_server::body::Body::empty())
       24474  +
                .header("content-type", "application/json")
       24475  +
                .body(::aws_smithy_http_server::body::Body::from(
       24476  +
                    ::bytes::Bytes::from_static("{ \"integerInBody\" : \"NaN\" }".as_bytes()),
       24477  +
                ))
25515  24478   
                .unwrap();
25516  24479   
            #[allow(unused_mut)]
25517  24480   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25518  24481   
            let config = crate::service::RestJsonConfig::builder().build();
25519  24482   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25520         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24483  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25521  24484   
                                let sender = sender.clone();
25522  24485   
                                async move {
25523         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24486  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25524  24487   
                                    sender.send(()).await.expect("receiver dropped early");
25525  24488   
                                    result
25526  24489   
                                }
25527  24490   
                            })
25528  24491   
                            .build_unchecked();
25529  24492   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25530  24493   
                .await
25531  24494   
                .expect("unable to make an HTTP request");
25532  24495   
            ::pretty_assertions::assert_eq!(
25533  24496   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25534  24497   
                http_response.status()
25535  24498   
            );
25536  24499   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25537  24500   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25538  24501   
                http_response.headers(),
25539  24502   
                expected_headers,
25540  24503   
            ));
25541  24504   
        }
25542  24505   
    }
25543         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25544         -
    /// are rejected with a 400 SerializationException
25545         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case11
       24506  +
    /// Malformed values in the path should be rejected
       24507  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case0
25546  24508   
    #[::tokio::test]
25547         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case11_malformed_request(
25548         -
    ) {
       24509  +
    #[::tracing_test::traced_test]
       24510  +
    async fn rest_json_path_integer_malformed_value_rejected_case0_malformed_request() {
25549  24511   
        {
25550  24512   
            #[allow(unused_mut)]
25551  24513   
            let mut http_request = http::Request::builder()
25552         -
                .uri("/MalformedTimestampHeaderDateTime")
       24514  +
                .uri("/MalformedInteger/true")
25553  24515   
                .method("POST")
25554         -
                .header("timestamp", "1996-12-19T16Z")
25555  24516   
                .body(::aws_smithy_http_server::body::Body::empty())
25556  24517   
                .unwrap();
25557  24518   
            #[allow(unused_mut)]
25558  24519   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25559  24520   
            let config = crate::service::RestJsonConfig::builder().build();
25560  24521   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25561         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24522  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25562  24523   
                                let sender = sender.clone();
25563  24524   
                                async move {
25564         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24525  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25565  24526   
                                    sender.send(()).await.expect("receiver dropped early");
25566  24527   
                                    result
25567  24528   
                                }
25568  24529   
                            })
25569  24530   
                            .build_unchecked();
25570  24531   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25571  24532   
                .await
25572  24533   
                .expect("unable to make an HTTP request");
25573  24534   
            ::pretty_assertions::assert_eq!(
25574  24535   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25575  24536   
                http_response.status()
25576  24537   
            );
25577  24538   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25578  24539   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25579  24540   
                http_response.headers(),
25580  24541   
                expected_headers,
25581  24542   
            ));
25582  24543   
        }
25583  24544   
    }
25584         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25585         -
    /// are rejected with a 400 SerializationException
25586         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case12
       24545  +
    /// Malformed values in the path should be rejected
       24546  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case1
25587  24547   
    #[::tokio::test]
25588         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case12_malformed_request(
25589         -
    ) {
       24548  +
    #[::tracing_test::traced_test]
       24549  +
    async fn rest_json_path_integer_malformed_value_rejected_case1_malformed_request() {
25590  24550   
        {
25591  24551   
            #[allow(unused_mut)]
25592  24552   
            let mut http_request = http::Request::builder()
25593         -
                .uri("/MalformedTimestampHeaderDateTime")
       24553  +
                .uri("/MalformedInteger/1.001")
25594  24554   
                .method("POST")
25595         -
                .header("timestamp", "1996-12-19T16")
25596  24555   
                .body(::aws_smithy_http_server::body::Body::empty())
25597  24556   
                .unwrap();
25598  24557   
            #[allow(unused_mut)]
25599  24558   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25600  24559   
            let config = crate::service::RestJsonConfig::builder().build();
25601  24560   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25602         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24561  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25603  24562   
                                let sender = sender.clone();
25604  24563   
                                async move {
25605         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24564  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25606  24565   
                                    sender.send(()).await.expect("receiver dropped early");
25607  24566   
                                    result
25608  24567   
                                }
25609  24568   
                            })
25610  24569   
                            .build_unchecked();
25611  24570   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25612  24571   
                .await
25613  24572   
                .expect("unable to make an HTTP request");
25614  24573   
            ::pretty_assertions::assert_eq!(
25615  24574   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25616  24575   
                http_response.status()
25617  24576   
            );
25618  24577   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25619  24578   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25620  24579   
                http_response.headers(),
25621  24580   
                expected_headers,
25622  24581   
            ));
25623  24582   
        }
25624  24583   
    }
25625         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25626         -
    /// are rejected with a 400 SerializationException
25627         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case13
       24584  +
    /// Malformed values in the path should be rejected
       24585  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case2
25628  24586   
    #[::tokio::test]
25629         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case13_malformed_request(
25630         -
    ) {
       24587  +
    #[::tracing_test::traced_test]
       24588  +
    async fn rest_json_path_integer_malformed_value_rejected_case2_malformed_request() {
25631  24589   
        {
25632  24590   
            #[allow(unused_mut)]
25633  24591   
            let mut http_request = http::Request::builder()
25634         -
                .uri("/MalformedTimestampHeaderDateTime")
       24592  +
                .uri("/MalformedInteger/2ABC")
25635  24593   
                .method("POST")
25636         -
                .header("timestamp", "1996-12-19 16:39:57Z")
25637  24594   
                .body(::aws_smithy_http_server::body::Body::empty())
25638  24595   
                .unwrap();
25639  24596   
            #[allow(unused_mut)]
25640  24597   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25641  24598   
            let config = crate::service::RestJsonConfig::builder().build();
25642  24599   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25643         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24600  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25644  24601   
                                let sender = sender.clone();
25645  24602   
                                async move {
25646         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24603  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25647  24604   
                                    sender.send(()).await.expect("receiver dropped early");
25648  24605   
                                    result
25649  24606   
                                }
25650  24607   
                            })
25651  24608   
                            .build_unchecked();
25652  24609   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25653  24610   
                .await
25654  24611   
                .expect("unable to make an HTTP request");
25655  24612   
            ::pretty_assertions::assert_eq!(
25656  24613   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25657  24614   
                http_response.status()
25658  24615   
            );
25659  24616   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25660  24617   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25661  24618   
                http_response.headers(),
25662  24619   
                expected_headers,
25663  24620   
            ));
25664  24621   
        }
25665  24622   
    }
25666         -
    /// When the format is date-time, maybe-valid ISO-8601 date-times not conforming to RFC 3339
25667         -
    /// are rejected with a 400 SerializationException
25668         -
    /// Test ID: RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case14
       24623  +
    /// Malformed values in the path should be rejected
       24624  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case3
25669  24625   
    #[::tokio::test]
25670         -
    async fn rest_json_header_timestamp_date_time_rejects_different8601_formats_case14_malformed_request(
25671         -
    ) {
       24626  +
    #[::tracing_test::traced_test]
       24627  +
    async fn rest_json_path_integer_malformed_value_rejected_case3_malformed_request() {
25672  24628   
        {
25673  24629   
            #[allow(unused_mut)]
25674  24630   
            let mut http_request = http::Request::builder()
25675         -
                .uri("/MalformedTimestampHeaderDateTime")
       24631  +
                .uri("/MalformedInteger/0x42")
25676  24632   
                .method("POST")
25677         -
                .header("timestamp", "2011-12-03T10:15:30+01:00[Europe/Paris]")
25678  24633   
                .body(::aws_smithy_http_server::body::Body::empty())
25679  24634   
                .unwrap();
25680  24635   
            #[allow(unused_mut)]
25681  24636   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25682  24637   
            let config = crate::service::RestJsonConfig::builder().build();
25683  24638   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25684         -
                            .malformed_timestamp_header_date_time(move |input: crate::input::MalformedTimestampHeaderDateTimeInput| {
       24639  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25685  24640   
                                let sender = sender.clone();
25686  24641   
                                async move {
25687         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDateTimeOutput, crate::error::MalformedTimestampHeaderDateTimeError> };
       24642  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25688  24643   
                                    sender.send(()).await.expect("receiver dropped early");
25689  24644   
                                    result
25690  24645   
                                }
25691  24646   
                            })
25692  24647   
                            .build_unchecked();
25693  24648   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25694  24649   
                .await
25695  24650   
                .expect("unable to make an HTTP request");
25696  24651   
            ::pretty_assertions::assert_eq!(
25697  24652   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25698  24653   
                http_response.status()
25699  24654   
            );
25700  24655   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25701  24656   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25702  24657   
                http_response.headers(),
25703  24658   
                expected_headers,
25704  24659   
            ));
25705  24660   
        }
25706  24661   
    }
25707         -
}
25708         -
#[cfg(test)]
25709         -
#[allow(unreachable_code, unused_variables)]
25710         -
mod server_malformed_timestamp_header_default_test {
25711         -
    /// By default, RFC3339 timestamps are rejected with a
25712         -
    /// 400 SerializationException
25713         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case0
       24662  +
    /// Malformed values in the path should be rejected
       24663  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case4
25714  24664   
    #[::tokio::test]
25715         -
    async fn rest_json_header_timestamp_default_rejects_date_time_case0_malformed_request() {
       24665  +
    #[::tracing_test::traced_test]
       24666  +
    async fn rest_json_path_integer_malformed_value_rejected_case4_malformed_request() {
25716  24667   
        {
25717  24668   
            #[allow(unused_mut)]
25718  24669   
            let mut http_request = http::Request::builder()
25719         -
                .uri("/MalformedTimestampHeaderDefault")
       24670  +
                .uri("/MalformedInteger/Infinity")
25720  24671   
                .method("POST")
25721         -
                .header("timestamp", "1985-04-12T23:20:50.52Z")
25722  24672   
                .body(::aws_smithy_http_server::body::Body::empty())
25723  24673   
                .unwrap();
25724  24674   
            #[allow(unused_mut)]
25725  24675   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25726  24676   
            let config = crate::service::RestJsonConfig::builder().build();
25727  24677   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25728         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       24678  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25729  24679   
                                let sender = sender.clone();
25730  24680   
                                async move {
25731         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
       24681  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25732  24682   
                                    sender.send(()).await.expect("receiver dropped early");
25733  24683   
                                    result
25734  24684   
                                }
25735  24685   
                            })
25736  24686   
                            .build_unchecked();
25737  24687   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25738  24688   
                .await
25739  24689   
                .expect("unable to make an HTTP request");
25740  24690   
            ::pretty_assertions::assert_eq!(
25741  24691   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25742  24692   
                http_response.status()
25743  24693   
            );
25744  24694   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25745  24695   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25746  24696   
                http_response.headers(),
25747  24697   
                expected_headers,
25748  24698   
            ));
25749  24699   
        }
25750  24700   
    }
25751         -
    /// By default, RFC3339 timestamps are rejected with a
25752         -
    /// 400 SerializationException
25753         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case1
       24701  +
    /// Malformed values in the path should be rejected
       24702  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case5
25754  24703   
    #[::tokio::test]
25755         -
    async fn rest_json_header_timestamp_default_rejects_date_time_case1_malformed_request() {
       24704  +
    #[::tracing_test::traced_test]
       24705  +
    async fn rest_json_path_integer_malformed_value_rejected_case5_malformed_request() {
25756  24706   
        {
25757  24707   
            #[allow(unused_mut)]
25758  24708   
            let mut http_request = http::Request::builder()
25759         -
                .uri("/MalformedTimestampHeaderDefault")
       24709  +
                .uri("/MalformedInteger/-Infinity")
25760  24710   
                .method("POST")
25761         -
                .header("timestamp", "1985-04-12T23:20:50Z")
25762  24711   
                .body(::aws_smithy_http_server::body::Body::empty())
25763  24712   
                .unwrap();
25764  24713   
            #[allow(unused_mut)]
25765  24714   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25766  24715   
            let config = crate::service::RestJsonConfig::builder().build();
25767  24716   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25768         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       24717  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25769  24718   
                                let sender = sender.clone();
25770  24719   
                                async move {
25771         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
       24720  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25772  24721   
                                    sender.send(()).await.expect("receiver dropped early");
25773  24722   
                                    result
25774  24723   
                                }
25775  24724   
                            })
25776  24725   
                            .build_unchecked();
25777  24726   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25778  24727   
                .await
25779  24728   
                .expect("unable to make an HTTP request");
25780  24729   
            ::pretty_assertions::assert_eq!(
25781  24730   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25782  24731   
                http_response.status()
25783  24732   
            );
25784  24733   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25785  24734   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25786  24735   
                http_response.headers(),
25787  24736   
                expected_headers,
25788  24737   
            ));
25789  24738   
        }
25790  24739   
    }
25791         -
    /// By default, RFC3339 timestamps are rejected with a
25792         -
    /// 400 SerializationException
25793         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsDateTime_case2
       24740  +
    /// Malformed values in the path should be rejected
       24741  +
    /// Test ID: RestJsonPathIntegerMalformedValueRejected_case6
25794  24742   
    #[::tokio::test]
25795         -
    async fn rest_json_header_timestamp_default_rejects_date_time_case2_malformed_request() {
       24743  +
    #[::tracing_test::traced_test]
       24744  +
    async fn rest_json_path_integer_malformed_value_rejected_case6_malformed_request() {
25796  24745   
        {
25797  24746   
            #[allow(unused_mut)]
25798  24747   
            let mut http_request = http::Request::builder()
25799         -
                .uri("/MalformedTimestampHeaderDefault")
       24748  +
                .uri("/MalformedInteger/NaN")
25800  24749   
                .method("POST")
25801         -
                .header("timestamp", "1996-12-19T16:39:57-08:00")
25802  24750   
                .body(::aws_smithy_http_server::body::Body::empty())
25803  24751   
                .unwrap();
25804  24752   
            #[allow(unused_mut)]
25805  24753   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25806  24754   
            let config = crate::service::RestJsonConfig::builder().build();
25807  24755   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25808         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       24756  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25809  24757   
                                let sender = sender.clone();
25810  24758   
                                async move {
25811         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
       24759  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25812  24760   
                                    sender.send(()).await.expect("receiver dropped early");
25813  24761   
                                    result
25814  24762   
                                }
25815  24763   
                            })
25816  24764   
                            .build_unchecked();
25817  24765   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25818  24766   
                .await
25819  24767   
                .expect("unable to make an HTTP request");
25820  24768   
            ::pretty_assertions::assert_eq!(
25821  24769   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25822  24770   
                http_response.status()
25823  24771   
            );
25824  24772   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25825  24773   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25826  24774   
                http_response.headers(),
25827  24775   
                expected_headers,
25828  24776   
            ));
25829  24777   
        }
25830  24778   
    }
25831         -
    /// By default, epoch second timestamps are rejected with a
25832         -
    /// 400 SerializationException
25833         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case0
       24779  +
    /// Malformed values in query parameters should be rejected
       24780  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case0
25834  24781   
    #[::tokio::test]
25835         -
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
       24782  +
    #[::tracing_test::traced_test]
       24783  +
    async fn rest_json_query_integer_malformed_value_rejected_case0_malformed_request() {
25836  24784   
        {
25837  24785   
            #[allow(unused_mut)]
25838  24786   
            let mut http_request = http::Request::builder()
25839         -
                .uri("/MalformedTimestampHeaderDefault")
       24787  +
                .uri("/MalformedInteger/1")
25840  24788   
                .method("POST")
25841         -
                .header("timestamp", "1515531081.1234")
25842  24789   
                .body(::aws_smithy_http_server::body::Body::empty())
25843  24790   
                .unwrap();
       24791  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=true".parse().unwrap();
25844  24792   
            #[allow(unused_mut)]
25845  24793   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25846  24794   
            let config = crate::service::RestJsonConfig::builder().build();
25847  24795   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25848         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       24796  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25849  24797   
                                let sender = sender.clone();
25850  24798   
                                async move {
25851         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
       24799  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25852  24800   
                                    sender.send(()).await.expect("receiver dropped early");
25853  24801   
                                    result
25854  24802   
                                }
25855  24803   
                            })
25856  24804   
                            .build_unchecked();
25857  24805   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25858  24806   
                .await
25859  24807   
                .expect("unable to make an HTTP request");
25860  24808   
            ::pretty_assertions::assert_eq!(
25861  24809   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25862  24810   
                http_response.status()
25863  24811   
            );
25864  24812   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25865  24813   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25866  24814   
                http_response.headers(),
25867  24815   
                expected_headers,
25868  24816   
            ));
25869  24817   
        }
25870  24818   
    }
25871         -
    /// By default, epoch second timestamps are rejected with a
25872         -
    /// 400 SerializationException
25873         -
    /// Test ID: RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case1
       24819  +
    /// Malformed values in query parameters should be rejected
       24820  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case1
25874  24821   
    #[::tokio::test]
25875         -
    async fn rest_json_header_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
       24822  +
    #[::tracing_test::traced_test]
       24823  +
    async fn rest_json_query_integer_malformed_value_rejected_case1_malformed_request() {
25876  24824   
        {
25877  24825   
            #[allow(unused_mut)]
25878  24826   
            let mut http_request = http::Request::builder()
25879         -
                .uri("/MalformedTimestampHeaderDefault")
       24827  +
                .uri("/MalformedInteger/1")
25880  24828   
                .method("POST")
25881         -
                .header("timestamp", "1515531081")
25882  24829   
                .body(::aws_smithy_http_server::body::Body::empty())
25883  24830   
                .unwrap();
       24831  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=1.001".parse().unwrap();
25884  24832   
            #[allow(unused_mut)]
25885  24833   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25886  24834   
            let config = crate::service::RestJsonConfig::builder().build();
25887  24835   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25888         -
                            .malformed_timestamp_header_default(move |input: crate::input::MalformedTimestampHeaderDefaultInput| {
       24836  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25889  24837   
                                let sender = sender.clone();
25890  24838   
                                async move {
25891         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderDefaultOutput, crate::error::MalformedTimestampHeaderDefaultError> };
       24839  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25892  24840   
                                    sender.send(()).await.expect("receiver dropped early");
25893  24841   
                                    result
25894  24842   
                                }
25895  24843   
                            })
25896  24844   
                            .build_unchecked();
25897  24845   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25898  24846   
                .await
25899  24847   
                .expect("unable to make an HTTP request");
25900  24848   
            ::pretty_assertions::assert_eq!(
25901  24849   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25902  24850   
                http_response.status()
25903  24851   
            );
25904  24852   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25905  24853   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25906  24854   
                http_response.headers(),
25907  24855   
                expected_headers,
25908  24856   
            ));
25909  24857   
        }
25910  24858   
    }
25911         -
}
25912         -
#[cfg(test)]
25913         -
#[allow(unreachable_code, unused_variables)]
25914         -
mod server_malformed_timestamp_header_epoch_test {
25915         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
25916         -
    /// 400 SerializationException
25917         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case0
       24859  +
    /// Malformed values in query parameters should be rejected
       24860  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case2
25918  24861   
    #[::tokio::test]
25919         -
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case0_malformed_request() {
       24862  +
    #[::tracing_test::traced_test]
       24863  +
    async fn rest_json_query_integer_malformed_value_rejected_case2_malformed_request() {
25920  24864   
        {
25921  24865   
            #[allow(unused_mut)]
25922  24866   
            let mut http_request = http::Request::builder()
25923         -
                .uri("/MalformedTimestampHeaderEpoch")
       24867  +
                .uri("/MalformedInteger/1")
25924  24868   
                .method("POST")
25925         -
                .header("timestamp", "1985-04-12T23:20:50.52Z")
25926  24869   
                .body(::aws_smithy_http_server::body::Body::empty())
25927  24870   
                .unwrap();
       24871  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=2ABC".parse().unwrap();
25928  24872   
            #[allow(unused_mut)]
25929  24873   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25930  24874   
            let config = crate::service::RestJsonConfig::builder().build();
25931  24875   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25932         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       24876  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25933  24877   
                                let sender = sender.clone();
25934  24878   
                                async move {
25935         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       24879  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25936  24880   
                                    sender.send(()).await.expect("receiver dropped early");
25937  24881   
                                    result
25938  24882   
                                }
25939  24883   
                            })
25940  24884   
                            .build_unchecked();
25941  24885   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25942  24886   
                .await
25943  24887   
                .expect("unable to make an HTTP request");
25944  24888   
            ::pretty_assertions::assert_eq!(
25945  24889   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25946  24890   
                http_response.status()
25947  24891   
            );
25948  24892   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25949  24893   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25950  24894   
                http_response.headers(),
25951  24895   
                expected_headers,
25952  24896   
            ));
25953  24897   
        }
25954  24898   
    }
25955         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
25956         -
    /// 400 SerializationException
25957         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case1
       24899  +
    /// Malformed values in query parameters should be rejected
       24900  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case3
25958  24901   
    #[::tokio::test]
25959         -
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case1_malformed_request() {
       24902  +
    #[::tracing_test::traced_test]
       24903  +
    async fn rest_json_query_integer_malformed_value_rejected_case3_malformed_request() {
25960  24904   
        {
25961  24905   
            #[allow(unused_mut)]
25962  24906   
            let mut http_request = http::Request::builder()
25963         -
                .uri("/MalformedTimestampHeaderEpoch")
       24907  +
                .uri("/MalformedInteger/1")
25964  24908   
                .method("POST")
25965         -
                .header("timestamp", "1985-04-12T23:20:50Z")
25966  24909   
                .body(::aws_smithy_http_server::body::Body::empty())
25967  24910   
                .unwrap();
       24911  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=0x42".parse().unwrap();
25968  24912   
            #[allow(unused_mut)]
25969  24913   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
25970  24914   
            let config = crate::service::RestJsonConfig::builder().build();
25971  24915   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
25972         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       24916  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
25973  24917   
                                let sender = sender.clone();
25974  24918   
                                async move {
25975         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       24919  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
25976  24920   
                                    sender.send(()).await.expect("receiver dropped early");
25977  24921   
                                    result
25978  24922   
                                }
25979  24923   
                            })
25980  24924   
                            .build_unchecked();
25981  24925   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
25982  24926   
                .await
25983  24927   
                .expect("unable to make an HTTP request");
25984  24928   
            ::pretty_assertions::assert_eq!(
25985  24929   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
25986  24930   
                http_response.status()
25987  24931   
            );
25988  24932   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
25989  24933   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
25990  24934   
                http_response.headers(),
25991  24935   
                expected_headers,
25992  24936   
            ));
25993  24937   
        }
25994  24938   
    }
25995         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
25996         -
    /// 400 SerializationException
25997         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsDateTime_case2
       24939  +
    /// Malformed values in query parameters should be rejected
       24940  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case4
25998  24941   
    #[::tokio::test]
25999         -
    async fn rest_json_header_timestamp_epoch_rejects_date_time_case2_malformed_request() {
       24942  +
    #[::tracing_test::traced_test]
       24943  +
    async fn rest_json_query_integer_malformed_value_rejected_case4_malformed_request() {
26000  24944   
        {
26001  24945   
            #[allow(unused_mut)]
26002  24946   
            let mut http_request = http::Request::builder()
26003         -
                .uri("/MalformedTimestampHeaderEpoch")
       24947  +
                .uri("/MalformedInteger/1")
26004  24948   
                .method("POST")
26005         -
                .header("timestamp", "1996-12-19T16:39:57-08:00")
26006  24949   
                .body(::aws_smithy_http_server::body::Body::empty())
26007  24950   
                .unwrap();
       24951  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=Infinity"
       24952  +
                .parse()
       24953  +
                .unwrap();
26008  24954   
            #[allow(unused_mut)]
26009  24955   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26010  24956   
            let config = crate::service::RestJsonConfig::builder().build();
26011  24957   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26012         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       24958  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26013  24959   
                                let sender = sender.clone();
26014  24960   
                                async move {
26015         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       24961  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26016  24962   
                                    sender.send(()).await.expect("receiver dropped early");
26017  24963   
                                    result
26018  24964   
                                }
26019  24965   
                            })
26020  24966   
                            .build_unchecked();
26021  24967   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26022  24968   
                .await
26023  24969   
                .expect("unable to make an HTTP request");
26024  24970   
            ::pretty_assertions::assert_eq!(
26025  24971   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26026  24972   
                http_response.status()
26027  24973   
            );
26028  24974   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26029  24975   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26030  24976   
                http_response.headers(),
26031  24977   
                expected_headers,
26032  24978   
            ));
26033  24979   
        }
26034  24980   
    }
26035         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
26036         -
    /// 400 SerializationException
26037         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsHttpDate_case0
       24981  +
    /// Malformed values in query parameters should be rejected
       24982  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case5
26038  24983   
    #[::tokio::test]
26039         -
    async fn rest_json_header_timestamp_epoch_rejects_http_date_case0_malformed_request() {
       24984  +
    #[::tracing_test::traced_test]
       24985  +
    async fn rest_json_query_integer_malformed_value_rejected_case5_malformed_request() {
26040  24986   
        {
26041  24987   
            #[allow(unused_mut)]
26042  24988   
            let mut http_request = http::Request::builder()
26043         -
                .uri("/MalformedTimestampHeaderEpoch")
       24989  +
                .uri("/MalformedInteger/1")
26044  24990   
                .method("POST")
26045         -
                .header("timestamp", "Tue, 29 Apr 2014 18:30:38 GMT")
26046  24991   
                .body(::aws_smithy_http_server::body::Body::empty())
26047  24992   
                .unwrap();
       24993  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=-Infinity"
       24994  +
                .parse()
       24995  +
                .unwrap();
26048  24996   
            #[allow(unused_mut)]
26049  24997   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26050  24998   
            let config = crate::service::RestJsonConfig::builder().build();
26051  24999   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26052         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25000  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26053  25001   
                                let sender = sender.clone();
26054  25002   
                                async move {
26055         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25003  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26056  25004   
                                    sender.send(()).await.expect("receiver dropped early");
26057  25005   
                                    result
26058  25006   
                                }
26059  25007   
                            })
26060  25008   
                            .build_unchecked();
26061  25009   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26062  25010   
                .await
26063  25011   
                .expect("unable to make an HTTP request");
26064  25012   
            ::pretty_assertions::assert_eq!(
26065  25013   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26066  25014   
                http_response.status()
26067  25015   
            );
26068  25016   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26069  25017   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26070  25018   
                http_response.headers(),
26071  25019   
                expected_headers,
26072  25020   
            ));
26073  25021   
        }
26074  25022   
    }
26075         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26076         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case0
       25023  +
    /// Malformed values in query parameters should be rejected
       25024  +
    /// Test ID: RestJsonQueryIntegerMalformedValueRejected_case6
26077  25025   
    #[::tokio::test]
26078         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
       25026  +
    #[::tracing_test::traced_test]
       25027  +
    async fn rest_json_query_integer_malformed_value_rejected_case6_malformed_request() {
26079  25028   
        {
26080  25029   
            #[allow(unused_mut)]
26081  25030   
            let mut http_request = http::Request::builder()
26082         -
                .uri("/MalformedTimestampHeaderEpoch")
       25031  +
                .uri("/MalformedInteger/1")
26083  25032   
                .method("POST")
26084         -
                .header("timestamp", "true")
26085  25033   
                .body(::aws_smithy_http_server::body::Body::empty())
26086  25034   
                .unwrap();
       25035  +
            *http_request.uri_mut() = "/MalformedInteger/1?integerInQuery=NaN".parse().unwrap();
26087  25036   
            #[allow(unused_mut)]
26088  25037   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26089  25038   
            let config = crate::service::RestJsonConfig::builder().build();
26090  25039   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26091         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25040  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26092  25041   
                                let sender = sender.clone();
26093  25042   
                                async move {
26094         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25043  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26095  25044   
                                    sender.send(()).await.expect("receiver dropped early");
26096  25045   
                                    result
26097  25046   
                                }
26098  25047   
                            })
26099  25048   
                            .build_unchecked();
26100  25049   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26101  25050   
                .await
26102  25051   
                .expect("unable to make an HTTP request");
26103  25052   
            ::pretty_assertions::assert_eq!(
26104  25053   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26105  25054   
                http_response.status()
26106  25055   
            );
26107  25056   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26108  25057   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26109  25058   
                http_response.headers(),
26110  25059   
                expected_headers,
26111  25060   
            ));
26112  25061   
        }
26113  25062   
    }
26114         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26115         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case1
       25063  +
    /// Malformed values in headers should be rejected
       25064  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case0
26116  25065   
    #[::tokio::test]
26117         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
       25066  +
    #[::tracing_test::traced_test]
       25067  +
    async fn rest_json_header_integer_malformed_value_rejected_case0_malformed_request() {
26118  25068   
        {
26119  25069   
            #[allow(unused_mut)]
26120  25070   
            let mut http_request = http::Request::builder()
26121         -
                .uri("/MalformedTimestampHeaderEpoch")
       25071  +
                .uri("/MalformedInteger/1")
26122  25072   
                .method("POST")
26123         -
                .header("timestamp", "1515531081ABC")
       25073  +
                .header("integerInHeader", "true")
26124  25074   
                .body(::aws_smithy_http_server::body::Body::empty())
26125  25075   
                .unwrap();
26126  25076   
            #[allow(unused_mut)]
26127  25077   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26128  25078   
            let config = crate::service::RestJsonConfig::builder().build();
26129  25079   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26130         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25080  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26131  25081   
                                let sender = sender.clone();
26132  25082   
                                async move {
26133         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25083  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26134  25084   
                                    sender.send(()).await.expect("receiver dropped early");
26135  25085   
                                    result
26136  25086   
                                }
26137  25087   
                            })
26138  25088   
                            .build_unchecked();
26139  25089   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26140  25090   
                .await
26141  25091   
                .expect("unable to make an HTTP request");
26142  25092   
            ::pretty_assertions::assert_eq!(
26143  25093   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26144  25094   
                http_response.status()
26145  25095   
            );
26146  25096   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26147  25097   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26148  25098   
                http_response.headers(),
26149  25099   
                expected_headers,
26150  25100   
            ));
26151  25101   
        }
26152  25102   
    }
26153         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26154         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case2
       25103  +
    /// Malformed values in headers should be rejected
       25104  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case1
26155  25105   
    #[::tokio::test]
26156         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
       25106  +
    #[::tracing_test::traced_test]
       25107  +
    async fn rest_json_header_integer_malformed_value_rejected_case1_malformed_request() {
26157  25108   
        {
26158  25109   
            #[allow(unused_mut)]
26159  25110   
            let mut http_request = http::Request::builder()
26160         -
                .uri("/MalformedTimestampHeaderEpoch")
       25111  +
                .uri("/MalformedInteger/1")
26161  25112   
                .method("POST")
26162         -
                .header("timestamp", "0x42")
       25113  +
                .header("integerInHeader", "1.001")
26163  25114   
                .body(::aws_smithy_http_server::body::Body::empty())
26164  25115   
                .unwrap();
26165  25116   
            #[allow(unused_mut)]
26166  25117   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26167  25118   
            let config = crate::service::RestJsonConfig::builder().build();
26168  25119   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26169         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25120  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26170  25121   
                                let sender = sender.clone();
26171  25122   
                                async move {
26172         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25123  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26173  25124   
                                    sender.send(()).await.expect("receiver dropped early");
26174  25125   
                                    result
26175  25126   
                                }
26176  25127   
                            })
26177  25128   
                            .build_unchecked();
26178  25129   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26179  25130   
                .await
26180  25131   
                .expect("unable to make an HTTP request");
26181  25132   
            ::pretty_assertions::assert_eq!(
26182  25133   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26183  25134   
                http_response.status()
26184  25135   
            );
26185  25136   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26186  25137   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26187  25138   
                http_response.headers(),
26188  25139   
                expected_headers,
26189  25140   
            ));
26190  25141   
        }
26191  25142   
    }
26192         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26193         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case3
       25143  +
    /// Malformed values in headers should be rejected
       25144  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case2
26194  25145   
    #[::tokio::test]
26195         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
       25146  +
    #[::tracing_test::traced_test]
       25147  +
    async fn rest_json_header_integer_malformed_value_rejected_case2_malformed_request() {
26196  25148   
        {
26197  25149   
            #[allow(unused_mut)]
26198  25150   
            let mut http_request = http::Request::builder()
26199         -
                .uri("/MalformedTimestampHeaderEpoch")
       25151  +
                .uri("/MalformedInteger/1")
26200  25152   
                .method("POST")
26201         -
                .header("timestamp", "1515531081.123.456")
       25153  +
                .header("integerInHeader", "2ABC")
26202  25154   
                .body(::aws_smithy_http_server::body::Body::empty())
26203  25155   
                .unwrap();
26204  25156   
            #[allow(unused_mut)]
26205  25157   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26206  25158   
            let config = crate::service::RestJsonConfig::builder().build();
26207  25159   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26208         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25160  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26209  25161   
                                let sender = sender.clone();
26210  25162   
                                async move {
26211         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25163  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26212  25164   
                                    sender.send(()).await.expect("receiver dropped early");
26213  25165   
                                    result
26214  25166   
                                }
26215  25167   
                            })
26216  25168   
                            .build_unchecked();
26217  25169   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26218  25170   
                .await
26219  25171   
                .expect("unable to make an HTTP request");
26220  25172   
            ::pretty_assertions::assert_eq!(
26221  25173   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26222  25174   
                http_response.status()
26223  25175   
            );
26224  25176   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26225  25177   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26226  25178   
                http_response.headers(),
26227  25179   
                expected_headers,
26228  25180   
            ));
26229  25181   
        }
26230  25182   
    }
26231         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26232         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case4
       25183  +
    /// Malformed values in headers should be rejected
       25184  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case3
26233  25185   
    #[::tokio::test]
26234         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
       25186  +
    #[::tracing_test::traced_test]
       25187  +
    async fn rest_json_header_integer_malformed_value_rejected_case3_malformed_request() {
26235  25188   
        {
26236  25189   
            #[allow(unused_mut)]
26237  25190   
            let mut http_request = http::Request::builder()
26238         -
                .uri("/MalformedTimestampHeaderEpoch")
       25191  +
                .uri("/MalformedInteger/1")
26239  25192   
                .method("POST")
26240         -
                .header("timestamp", "Infinity")
       25193  +
                .header("integerInHeader", "0x42")
26241  25194   
                .body(::aws_smithy_http_server::body::Body::empty())
26242  25195   
                .unwrap();
26243  25196   
            #[allow(unused_mut)]
26244  25197   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26245  25198   
            let config = crate::service::RestJsonConfig::builder().build();
26246  25199   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26247         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25200  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26248  25201   
                                let sender = sender.clone();
26249  25202   
                                async move {
26250         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25203  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26251  25204   
                                    sender.send(()).await.expect("receiver dropped early");
26252  25205   
                                    result
26253  25206   
                                }
26254  25207   
                            })
26255  25208   
                            .build_unchecked();
26256  25209   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26257  25210   
                .await
26258  25211   
                .expect("unable to make an HTTP request");
26259  25212   
            ::pretty_assertions::assert_eq!(
26260  25213   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26261  25214   
                http_response.status()
26262  25215   
            );
26263  25216   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26264  25217   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26265  25218   
                http_response.headers(),
26266  25219   
                expected_headers,
26267  25220   
            ));
26268  25221   
        }
26269  25222   
    }
26270         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26271         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case5
       25223  +
    /// Malformed values in headers should be rejected
       25224  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case4
26272  25225   
    #[::tokio::test]
26273         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
       25226  +
    #[::tracing_test::traced_test]
       25227  +
    async fn rest_json_header_integer_malformed_value_rejected_case4_malformed_request() {
26274  25228   
        {
26275  25229   
            #[allow(unused_mut)]
26276  25230   
            let mut http_request = http::Request::builder()
26277         -
                .uri("/MalformedTimestampHeaderEpoch")
       25231  +
                .uri("/MalformedInteger/1")
26278  25232   
                .method("POST")
26279         -
                .header("timestamp", "-Infinity")
       25233  +
                .header("integerInHeader", "Infinity")
26280  25234   
                .body(::aws_smithy_http_server::body::Body::empty())
26281  25235   
                .unwrap();
26282  25236   
            #[allow(unused_mut)]
26283  25237   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26284  25238   
            let config = crate::service::RestJsonConfig::builder().build();
26285  25239   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26286         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25240  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26287  25241   
                                let sender = sender.clone();
26288  25242   
                                async move {
26289         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25243  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26290  25244   
                                    sender.send(()).await.expect("receiver dropped early");
26291  25245   
                                    result
26292  25246   
                                }
26293  25247   
                            })
26294  25248   
                            .build_unchecked();
26295  25249   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26296  25250   
                .await
26297  25251   
                .expect("unable to make an HTTP request");
26298  25252   
            ::pretty_assertions::assert_eq!(
26299  25253   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26300  25254   
                http_response.status()
26301  25255   
            );
26302  25256   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26303  25257   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26304  25258   
                http_response.headers(),
26305  25259   
                expected_headers,
26306  25260   
            ));
26307  25261   
        }
26308  25262   
    }
26309         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
26310         -
    /// Test ID: RestJsonHeaderTimestampEpochRejectsMalformedValues_case6
       25263  +
    /// Malformed values in headers should be rejected
       25264  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case5
26311  25265   
    #[::tokio::test]
26312         -
    async fn rest_json_header_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
       25266  +
    #[::tracing_test::traced_test]
       25267  +
    async fn rest_json_header_integer_malformed_value_rejected_case5_malformed_request() {
26313  25268   
        {
26314  25269   
            #[allow(unused_mut)]
26315  25270   
            let mut http_request = http::Request::builder()
26316         -
                .uri("/MalformedTimestampHeaderEpoch")
       25271  +
                .uri("/MalformedInteger/1")
26317  25272   
                .method("POST")
26318         -
                .header("timestamp", "NaN")
       25273  +
                .header("integerInHeader", "-Infinity")
26319  25274   
                .body(::aws_smithy_http_server::body::Body::empty())
26320  25275   
                .unwrap();
26321  25276   
            #[allow(unused_mut)]
26322  25277   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26323  25278   
            let config = crate::service::RestJsonConfig::builder().build();
26324  25279   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26325         -
                            .malformed_timestamp_header_epoch(move |input: crate::input::MalformedTimestampHeaderEpochInput| {
       25280  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26326  25281   
                                let sender = sender.clone();
26327  25282   
                                async move {
26328         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampHeaderEpochOutput, crate::error::MalformedTimestampHeaderEpochError> };
       25283  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26329  25284   
                                    sender.send(()).await.expect("receiver dropped early");
26330  25285   
                                    result
26331  25286   
                                }
26332  25287   
                            })
26333  25288   
                            .build_unchecked();
26334  25289   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26335  25290   
                .await
26336  25291   
                .expect("unable to make an HTTP request");
26337  25292   
            ::pretty_assertions::assert_eq!(
26338  25293   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26339  25294   
                http_response.status()
26340  25295   
            );
26341  25296   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26342  25297   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26343  25298   
                http_response.headers(),
26344  25299   
                expected_headers,
26345  25300   
            ));
26346  25301   
        }
26347  25302   
    }
26348         -
}
26349         -
#[cfg(test)]
26350         -
#[allow(unreachable_code, unused_variables)]
26351         -
mod server_malformed_timestamp_path_default_test {
26352         -
    /// By default, IMF-fixdate timestamps are rejected with a
26353         -
    /// 400 SerializationException
26354         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsHttpDate_case0
       25303  +
    /// Malformed values in headers should be rejected
       25304  +
    /// Test ID: RestJsonHeaderIntegerMalformedValueRejected_case6
26355  25305   
    #[::tokio::test]
26356         -
    async fn rest_json_path_timestamp_default_rejects_http_date_case0_malformed_request() {
       25306  +
    #[::tracing_test::traced_test]
       25307  +
    async fn rest_json_header_integer_malformed_value_rejected_case6_malformed_request() {
26357  25308   
        {
26358  25309   
            #[allow(unused_mut)]
26359  25310   
            let mut http_request = http::Request::builder()
26360         -
                .uri("/MalformedTimestampPathDefault/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
       25311  +
                .uri("/MalformedInteger/1")
26361  25312   
                .method("POST")
       25313  +
                .header("integerInHeader", "NaN")
26362  25314   
                .body(::aws_smithy_http_server::body::Body::empty())
26363  25315   
                .unwrap();
26364  25316   
            #[allow(unused_mut)]
26365  25317   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26366  25318   
            let config = crate::service::RestJsonConfig::builder().build();
26367  25319   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26368         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25320  +
                            .malformed_integer(move |input: crate::input::MalformedIntegerInput| {
26369  25321   
                                let sender = sender.clone();
26370  25322   
                                async move {
26371         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25323  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedIntegerOutput, crate::error::MalformedIntegerError> };
26372  25324   
                                    sender.send(()).await.expect("receiver dropped early");
26373  25325   
                                    result
26374  25326   
                                }
26375  25327   
                            })
26376  25328   
                            .build_unchecked();
26377  25329   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26378  25330   
                .await
26379  25331   
                .expect("unable to make an HTTP request");
26380  25332   
            ::pretty_assertions::assert_eq!(
26381  25333   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26382  25334   
                http_response.status()
26383  25335   
            );
26384  25336   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26385  25337   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26386  25338   
                http_response.headers(),
26387  25339   
                expected_headers,
26388  25340   
            ));
26389  25341   
        }
26390  25342   
    }
26391         -
    /// By default, IMF-fixdate timestamps are rejected with a
26392         -
    /// 400 SerializationException
26393         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsHttpDate_case1
       25343  +
}
       25344  +
       25345  +
const CONTENT_TYPE_MALFORMEDREQUESTBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
       25346  +
::pin_project_lite::pin_project! {
       25347  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       25348  +
    /// [`MalformedRequestBodyInput`](crate::input::MalformedRequestBodyInput) using modelled bindings.
       25349  +
    pub struct MalformedRequestBodyInputFuture {
       25350  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedRequestBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       25351  +
    }
       25352  +
}
       25353  +
       25354  +
impl std::future::Future for MalformedRequestBodyInputFuture {
       25355  +
    type Output = Result<
       25356  +
        crate::input::MalformedRequestBodyInput,
       25357  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       25358  +
    >;
       25359  +
       25360  +
    fn poll(
       25361  +
        self: std::pin::Pin<&mut Self>,
       25362  +
        cx: &mut std::task::Context<'_>,
       25363  +
    ) -> std::task::Poll<Self::Output> {
       25364  +
        let this = self.project();
       25365  +
        this.inner.as_mut().poll(cx)
       25366  +
    }
       25367  +
}
       25368  +
       25369  +
impl<B>
       25370  +
    ::aws_smithy_http_server::request::FromRequest<
       25371  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       25372  +
        B,
       25373  +
    > for crate::input::MalformedRequestBodyInput
       25374  +
where
       25375  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       25376  +
    B: 'static,
       25377  +
       25378  +
    B::Data: Send,
       25379  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       25380  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       25381  +
{
       25382  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       25383  +
    type Future = MalformedRequestBodyInputFuture;
       25384  +
       25385  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       25386  +
        let fut = async move {
       25387  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       25388  +
                request.headers(),
       25389  +
                &CONTENT_TYPE_MALFORMEDREQUESTBODY,
       25390  +
            ) {
       25391  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       25392  +
            }
       25393  +
            crate::protocol_serde::shape_malformed_request_body::de_malformed_request_body_http_request(request)
       25394  +
                            .await
       25395  +
                            .map_err(Into::into)
       25396  +
        };
       25397  +
        use ::futures_util::future::TryFutureExt;
       25398  +
        let fut = fut.map_err(
       25399  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       25400  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       25401  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       25402  +
                    e,
       25403  +
                )
       25404  +
            },
       25405  +
        );
       25406  +
        MalformedRequestBodyInputFuture {
       25407  +
            inner: Box::pin(fut),
       25408  +
        }
       25409  +
    }
       25410  +
}
       25411  +
impl
       25412  +
    ::aws_smithy_http_server::response::IntoResponse<
       25413  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       25414  +
    > for crate::output::MalformedRequestBodyOutput
       25415  +
{
       25416  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       25417  +
        match crate::protocol_serde::shape_malformed_request_body::ser_malformed_request_body_http_response(self) {
       25418  +
                        Ok(response) => response,
       25419  +
                        Err(e) => {
       25420  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       25421  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       25422  +
                        }
       25423  +
                    }
       25424  +
    }
       25425  +
}
       25426  +
       25427  +
#[allow(unreachable_code, unused_variables)]
       25428  +
#[cfg(test)]
       25429  +
mod malformed_request_body_test {
       25430  +
       25431  +
    /// When the request body is not valid JSON, the response should be a 400
       25432  +
    /// SerializationException.
       25433  +
    /// Test ID: RestJsonInvalidJsonBody_case0
26394  25434   
    #[::tokio::test]
26395         -
    async fn rest_json_path_timestamp_default_rejects_http_date_case1_malformed_request() {
       25435  +
    #[::tracing_test::traced_test]
       25436  +
    async fn rest_json_invalid_json_body_case0_malformed_request() {
26396  25437   
        {
26397  25438   
            #[allow(unused_mut)]
26398  25439   
            let mut http_request = http::Request::builder()
26399         -
                            .uri("/MalformedTimestampPathDefault/Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT")
       25440  +
                .uri("/MalformedRequestBody")
26400  25441   
                .method("POST")
26401         -
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
       25442  +
                .header("content-type", "application/json")
       25443  +
                .body(::aws_smithy_http_server::body::Body::from(
       25444  +
                    ::bytes::Bytes::from_static("{[".as_bytes()),
       25445  +
                ))
       25446  +
                .unwrap();
26402  25447   
            #[allow(unused_mut)]
26403  25448   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26404  25449   
            let config = crate::service::RestJsonConfig::builder().build();
26405  25450   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26406         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25451  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26407  25452   
                                let sender = sender.clone();
26408  25453   
                                async move {
26409         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25454  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26410  25455   
                                    sender.send(()).await.expect("receiver dropped early");
26411  25456   
                                    result
26412  25457   
                                }
26413  25458   
                            })
26414  25459   
                            .build_unchecked();
26415  25460   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26416  25461   
                .await
26417  25462   
                .expect("unable to make an HTTP request");
26418  25463   
            ::pretty_assertions::assert_eq!(
26419  25464   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26420  25465   
                http_response.status()
26421  25466   
            );
26422  25467   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26423  25468   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26424  25469   
                http_response.headers(),
26425  25470   
                expected_headers,
26426  25471   
            ));
26427  25472   
        }
26428  25473   
    }
26429         -
    /// By default, epoch second timestamps are rejected with a
26430         -
    /// 400 SerializationException
26431         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case0
       25474  +
    /// When the request body is not valid JSON, the response should be a 400
       25475  +
    /// SerializationException.
       25476  +
    /// Test ID: RestJsonInvalidJsonBody_case1
26432  25477   
    #[::tokio::test]
26433         -
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
       25478  +
    #[::tracing_test::traced_test]
       25479  +
    async fn rest_json_invalid_json_body_case1_malformed_request() {
26434  25480   
        {
26435  25481   
            #[allow(unused_mut)]
26436  25482   
            let mut http_request = http::Request::builder()
26437         -
                .uri("/MalformedTimestampPathDefault/1515531081.1234")
       25483  +
                .uri("/MalformedRequestBody")
26438  25484   
                .method("POST")
26439         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25485  +
                .header("content-type", "application/json")
       25486  +
                .body(::aws_smithy_http_server::body::Body::from(
       25487  +
                    ::bytes::Bytes::from_static("{ \"int\": 10 }abc".as_bytes()),
       25488  +
                ))
26440  25489   
                .unwrap();
26441  25490   
            #[allow(unused_mut)]
26442  25491   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26443  25492   
            let config = crate::service::RestJsonConfig::builder().build();
26444  25493   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26445         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25494  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26446  25495   
                                let sender = sender.clone();
26447  25496   
                                async move {
26448         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25497  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26449  25498   
                                    sender.send(()).await.expect("receiver dropped early");
26450  25499   
                                    result
26451  25500   
                                }
26452  25501   
                            })
26453  25502   
                            .build_unchecked();
26454  25503   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26455  25504   
                .await
26456  25505   
                .expect("unable to make an HTTP request");
26457  25506   
            ::pretty_assertions::assert_eq!(
26458  25507   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26459  25508   
                http_response.status()
26460  25509   
            );
26461  25510   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26462  25511   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26463  25512   
                http_response.headers(),
26464  25513   
                expected_headers,
26465  25514   
            ));
26466  25515   
        }
26467  25516   
    }
26468         -
    /// By default, epoch second timestamps are rejected with a
26469         -
    /// 400 SerializationException
26470         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsEpochSeconds_case1
       25517  +
    /// When the request body is not valid JSON, the response should be a 400
       25518  +
    /// SerializationException.
       25519  +
    /// Test ID: RestJsonInvalidJsonBody_case2
26471  25520   
    #[::tokio::test]
26472         -
    async fn rest_json_path_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
       25521  +
    #[::tracing_test::traced_test]
       25522  +
    async fn rest_json_invalid_json_body_case2_malformed_request() {
26473  25523   
        {
26474  25524   
            #[allow(unused_mut)]
26475  25525   
            let mut http_request = http::Request::builder()
26476         -
                .uri("/MalformedTimestampPathDefault/1515531081")
       25526  +
                .uri("/MalformedRequestBody")
26477  25527   
                .method("POST")
26478         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25528  +
                .header("content-type", "application/json")
       25529  +
                .body(::aws_smithy_http_server::body::Body::from(
       25530  +
                    ::bytes::Bytes::from_static("abc{ \"int\": 10 }".as_bytes()),
       25531  +
                ))
26479  25532   
                .unwrap();
26480  25533   
            #[allow(unused_mut)]
26481  25534   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26482  25535   
            let config = crate::service::RestJsonConfig::builder().build();
26483  25536   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26484         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25537  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26485  25538   
                                let sender = sender.clone();
26486  25539   
                                async move {
26487         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25540  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26488  25541   
                                    sender.send(()).await.expect("receiver dropped early");
26489  25542   
                                    result
26490  25543   
                                }
26491  25544   
                            })
26492  25545   
                            .build_unchecked();
26493  25546   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26494  25547   
                .await
26495  25548   
                .expect("unable to make an HTTP request");
26496  25549   
            ::pretty_assertions::assert_eq!(
26497  25550   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26498  25551   
                http_response.status()
26499  25552   
            );
26500  25553   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26501  25554   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26502  25555   
                http_response.headers(),
26503  25556   
                expected_headers,
26504  25557   
            ));
26505  25558   
        }
26506  25559   
    }
26507         -
    /// UTC offsets must be rejected with a
26508         -
    /// 400 SerializationException
26509         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsUTCOffsets
       25560  +
    /// When the request body is not valid JSON, the response should be a 400
       25561  +
    /// SerializationException.
       25562  +
    /// Test ID: RestJsonInvalidJsonBody_case3
26510  25563   
    #[::tokio::test]
26511         -
    async fn rest_json_path_timestamp_default_rejects_utc_offsets_malformed_request() {
       25564  +
    #[::tracing_test::traced_test]
       25565  +
    async fn rest_json_invalid_json_body_case3_malformed_request() {
26512  25566   
        {
26513  25567   
            #[allow(unused_mut)]
26514  25568   
            let mut http_request = http::Request::builder()
26515         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57-08%3A00")
       25569  +
                .uri("/MalformedRequestBody")
26516  25570   
                .method("POST")
26517         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25571  +
                .header("content-type", "application/json")
       25572  +
                .body(::aws_smithy_http_server::body::Body::from(
       25573  +
                    ::bytes::Bytes::from_static(
       25574  +
                        "{\n    \"int\": 10 // the integer should be 10\n}".as_bytes(),
       25575  +
                    ),
       25576  +
                ))
26518  25577   
                .unwrap();
26519  25578   
            #[allow(unused_mut)]
26520  25579   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26521  25580   
            let config = crate::service::RestJsonConfig::builder().build();
26522  25581   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26523         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25582  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26524  25583   
                                let sender = sender.clone();
26525  25584   
                                async move {
26526         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25585  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26527  25586   
                                    sender.send(()).await.expect("receiver dropped early");
26528  25587   
                                    result
26529  25588   
                                }
26530  25589   
                            })
26531  25590   
                            .build_unchecked();
26532  25591   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26533  25592   
                .await
26534  25593   
                .expect("unable to make an HTTP request");
26535  25594   
            ::pretty_assertions::assert_eq!(
26536  25595   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26537  25596   
                http_response.status()
26538  25597   
            );
26539  25598   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26540  25599   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26541  25600   
                http_response.headers(),
26542  25601   
                expected_headers,
26543  25602   
            ));
26544  25603   
        }
26545  25604   
    }
26546         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26547         -
    /// are rejected with a 400 SerializationException
26548         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case0
       25605  +
    /// When the request body is not valid JSON, the response should be a 400
       25606  +
    /// SerializationException.
       25607  +
    /// Test ID: RestJsonInvalidJsonBody_case4
26549  25608   
    #[::tokio::test]
26550         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case0_malformed_request(
26551         -
    ) {
       25609  +
    #[::tracing_test::traced_test]
       25610  +
    async fn rest_json_invalid_json_body_case4_malformed_request() {
26552  25611   
        {
26553  25612   
            #[allow(unused_mut)]
26554  25613   
            let mut http_request = http::Request::builder()
26555         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00")
       25614  +
                .uri("/MalformedRequestBody")
26556  25615   
                .method("POST")
26557         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25616  +
                .header("content-type", "application/json")
       25617  +
                .body(::aws_smithy_http_server::body::Body::from(
       25618  +
                    ::bytes::Bytes::from_static(
       25619  +
                        "{\n    \"int\": 10 /* the integer should be 10 */\n}".as_bytes(),
       25620  +
                    ),
       25621  +
                ))
26558  25622   
                .unwrap();
26559  25623   
            #[allow(unused_mut)]
26560  25624   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26561  25625   
            let config = crate::service::RestJsonConfig::builder().build();
26562  25626   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26563         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25627  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26564  25628   
                                let sender = sender.clone();
26565  25629   
                                async move {
26566         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25630  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26567  25631   
                                    sender.send(()).await.expect("receiver dropped early");
26568  25632   
                                    result
26569  25633   
                                }
26570  25634   
                            })
26571  25635   
                            .build_unchecked();
26572  25636   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26573  25637   
                .await
26574  25638   
                .expect("unable to make an HTTP request");
26575  25639   
            ::pretty_assertions::assert_eq!(
26576  25640   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26577  25641   
                http_response.status()
26578  25642   
            );
26579  25643   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26580  25644   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26581  25645   
                http_response.headers(),
26582  25646   
                expected_headers,
26583  25647   
            ));
26584  25648   
        }
26585  25649   
    }
26586         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26587         -
    /// are rejected with a 400 SerializationException
26588         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case1
       25650  +
    /// When the request body is not valid JSON, the response should be a 400
       25651  +
    /// SerializationException.
       25652  +
    /// Test ID: RestJsonInvalidJsonBody_case5
26589  25653   
    #[::tokio::test]
26590         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case1_malformed_request(
26591         -
    ) {
       25654  +
    #[::tracing_test::traced_test]
       25655  +
    async fn rest_json_invalid_json_body_case5_malformed_request() {
26592  25656   
        {
26593  25657   
            #[allow(unused_mut)]
26594  25658   
            let mut http_request = http::Request::builder()
26595         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57%2B00Z")
       25659  +
                .uri("/MalformedRequestBody")
26596  25660   
                .method("POST")
26597         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25661  +
                .header("content-type", "application/json")
       25662  +
                .body(::aws_smithy_http_server::body::Body::from(
       25663  +
                    ::bytes::Bytes::from_static("{\"int\" :\\u{000c}10}".as_bytes()),
       25664  +
                ))
26598  25665   
                .unwrap();
26599  25666   
            #[allow(unused_mut)]
26600  25667   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26601  25668   
            let config = crate::service::RestJsonConfig::builder().build();
26602  25669   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26603         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25670  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26604  25671   
                                let sender = sender.clone();
26605  25672   
                                async move {
26606         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25673  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26607  25674   
                                    sender.send(()).await.expect("receiver dropped early");
26608  25675   
                                    result
26609  25676   
                                }
26610  25677   
                            })
26611  25678   
                            .build_unchecked();
26612  25679   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26613  25680   
                .await
26614  25681   
                .expect("unable to make an HTTP request");
26615  25682   
            ::pretty_assertions::assert_eq!(
26616  25683   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26617  25684   
                http_response.status()
26618  25685   
            );
26619  25686   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26620  25687   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26621  25688   
                http_response.headers(),
26622  25689   
                expected_headers,
26623  25690   
            ));
26624  25691   
        }
26625  25692   
    }
26626         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26627         -
    /// are rejected with a 400 SerializationException
26628         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case2
       25693  +
    /// When the request body is not valid JSON, the response should be a 400
       25694  +
    /// SerializationException.
       25695  +
    /// Test ID: RestJsonInvalidJsonBody_case6
26629  25696   
    #[::tokio::test]
26630         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case2_malformed_request(
26631         -
    ) {
       25697  +
    #[::tracing_test::traced_test]
       25698  +
    async fn rest_json_invalid_json_body_case6_malformed_request() {
26632  25699   
        {
26633  25700   
            #[allow(unused_mut)]
26634  25701   
            let mut http_request = http::Request::builder()
26635         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39%3A57")
       25702  +
                .uri("/MalformedRequestBody")
26636  25703   
                .method("POST")
26637         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25704  +
                .header("content-type", "application/json")
       25705  +
                .body(::aws_smithy_http_server::body::Body::from(
       25706  +
                    ::bytes::Bytes::from_static("{'int': 10}".as_bytes()),
       25707  +
                ))
26638  25708   
                .unwrap();
26639  25709   
            #[allow(unused_mut)]
26640  25710   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26641  25711   
            let config = crate::service::RestJsonConfig::builder().build();
26642  25712   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26643         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25713  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26644  25714   
                                let sender = sender.clone();
26645  25715   
                                async move {
26646         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25716  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26647  25717   
                                    sender.send(()).await.expect("receiver dropped early");
26648  25718   
                                    result
26649  25719   
                                }
26650  25720   
                            })
26651  25721   
                            .build_unchecked();
26652  25722   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26653  25723   
                .await
26654  25724   
                .expect("unable to make an HTTP request");
26655  25725   
            ::pretty_assertions::assert_eq!(
26656  25726   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26657  25727   
                http_response.status()
26658  25728   
            );
26659  25729   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26660  25730   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26661  25731   
                http_response.headers(),
26662  25732   
                expected_headers,
26663  25733   
            ));
26664  25734   
        }
26665  25735   
    }
26666         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26667         -
    /// are rejected with a 400 SerializationException
26668         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case3
       25736  +
    /// When the request body is not valid JSON, the response should be a 400
       25737  +
    /// SerializationException.
       25738  +
    /// Test ID: RestJsonInvalidJsonBody_case7
26669  25739   
    #[::tokio::test]
26670         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case3_malformed_request(
26671         -
    ) {
       25740  +
    #[::tracing_test::traced_test]
       25741  +
    async fn rest_json_invalid_json_body_case7_malformed_request() {
26672  25742   
        {
26673  25743   
            #[allow(unused_mut)]
26674  25744   
            let mut http_request = http::Request::builder()
26675         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T163957")
       25745  +
                .uri("/MalformedRequestBody")
26676  25746   
                .method("POST")
26677         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25747  +
                .header("content-type", "application/json")
       25748  +
                .body(::aws_smithy_http_server::body::Body::from(
       25749  +
                    ::bytes::Bytes::from_static("{\"int\": 10,}".as_bytes()),
       25750  +
                ))
26678  25751   
                .unwrap();
26679  25752   
            #[allow(unused_mut)]
26680  25753   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26681  25754   
            let config = crate::service::RestJsonConfig::builder().build();
26682  25755   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26683         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25756  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26684  25757   
                                let sender = sender.clone();
26685  25758   
                                async move {
26686         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25759  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26687  25760   
                                    sender.send(()).await.expect("receiver dropped early");
26688  25761   
                                    result
26689  25762   
                                }
26690  25763   
                            })
26691  25764   
                            .build_unchecked();
26692  25765   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26693  25766   
                .await
26694  25767   
                .expect("unable to make an HTTP request");
26695  25768   
            ::pretty_assertions::assert_eq!(
26696  25769   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26697  25770   
                http_response.status()
26698  25771   
            );
26699  25772   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26700  25773   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26701  25774   
                http_response.headers(),
26702  25775   
                expected_headers,
26703  25776   
            ));
26704  25777   
        }
26705  25778   
    }
26706         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26707         -
    /// are rejected with a 400 SerializationException
26708         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case4
       25779  +
    /// When the request body is technically valid, but cannot map to a Smithy structure,
       25780  +
    /// the response should be a 400 SerializationException.
       25781  +
    /// Test ID: RestJsonTechnicallyValidJsonBody_case0
26709  25782   
    #[::tokio::test]
26710         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case4_malformed_request(
26711         -
    ) {
       25783  +
    #[::tracing_test::traced_test]
       25784  +
    async fn rest_json_technically_valid_json_body_case0_malformed_request() {
26712  25785   
        {
26713  25786   
            #[allow(unused_mut)]
26714  25787   
            let mut http_request = http::Request::builder()
26715         -
                .uri("/MalformedTimestampPathDefault/19961219T163957Z")
       25788  +
                .uri("/MalformedRequestBody")
26716  25789   
                .method("POST")
26717         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25790  +
                .header("content-type", "application/json")
       25791  +
                .body(::aws_smithy_http_server::body::Body::from(
       25792  +
                    ::bytes::Bytes::from_static("[{ \"int\": 10}]".as_bytes()),
       25793  +
                ))
26718  25794   
                .unwrap();
26719  25795   
            #[allow(unused_mut)]
26720  25796   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26721  25797   
            let config = crate::service::RestJsonConfig::builder().build();
26722  25798   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26723         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25799  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26724  25800   
                                let sender = sender.clone();
26725  25801   
                                async move {
26726         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25802  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26727  25803   
                                    sender.send(()).await.expect("receiver dropped early");
26728  25804   
                                    result
26729  25805   
                                }
26730  25806   
                            })
26731  25807   
                            .build_unchecked();
26732  25808   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26733  25809   
                .await
26734  25810   
                .expect("unable to make an HTTP request");
26735  25811   
            ::pretty_assertions::assert_eq!(
26736  25812   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26737  25813   
                http_response.status()
26738  25814   
            );
26739  25815   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26740  25816   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26741  25817   
                http_response.headers(),
26742  25818   
                expected_headers,
26743  25819   
            ));
26744  25820   
        }
26745  25821   
    }
26746         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26747         -
    /// are rejected with a 400 SerializationException
26748         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case5
       25822  +
    /// When the request body is technically valid, but cannot map to a Smithy structure,
       25823  +
    /// the response should be a 400 SerializationException.
       25824  +
    /// Test ID: RestJsonTechnicallyValidJsonBody_case1
26749  25825   
    #[::tokio::test]
26750         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case5_malformed_request(
26751         -
    ) {
       25826  +
    #[::tracing_test::traced_test]
       25827  +
    async fn rest_json_technically_valid_json_body_case1_malformed_request() {
26752  25828   
        {
26753  25829   
            #[allow(unused_mut)]
26754  25830   
            let mut http_request = http::Request::builder()
26755         -
                .uri("/MalformedTimestampPathDefault/19961219T163957")
       25831  +
                .uri("/MalformedRequestBody")
26756  25832   
                .method("POST")
26757         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25833  +
                .header("content-type", "application/json")
       25834  +
                .body(::aws_smithy_http_server::body::Body::from(
       25835  +
                    ::bytes::Bytes::from_static("10".as_bytes()),
       25836  +
                ))
26758  25837   
                .unwrap();
26759  25838   
            #[allow(unused_mut)]
26760  25839   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26761  25840   
            let config = crate::service::RestJsonConfig::builder().build();
26762  25841   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26763         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25842  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26764  25843   
                                let sender = sender.clone();
26765  25844   
                                async move {
26766         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25845  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26767  25846   
                                    sender.send(()).await.expect("receiver dropped early");
26768  25847   
                                    result
26769  25848   
                                }
26770  25849   
                            })
26771  25850   
                            .build_unchecked();
26772  25851   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26773  25852   
                .await
26774  25853   
                .expect("unable to make an HTTP request");
26775  25854   
            ::pretty_assertions::assert_eq!(
26776  25855   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26777  25856   
                http_response.status()
26778  25857   
            );
26779  25858   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26780  25859   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26781  25860   
                http_response.headers(),
26782  25861   
                expected_headers,
26783  25862   
            ));
26784  25863   
        }
26785  25864   
    }
26786         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26787         -
    /// are rejected with a 400 SerializationException
26788         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case6
       25865  +
    /// When the request body is technically valid, but cannot map to a Smithy structure,
       25866  +
    /// the response should be a 400 SerializationException.
       25867  +
    /// Test ID: RestJsonTechnicallyValidJsonBody_case2
26789  25868   
    #[::tokio::test]
26790         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case6_malformed_request(
26791         -
    ) {
       25869  +
    #[::tracing_test::traced_test]
       25870  +
    async fn rest_json_technically_valid_json_body_case2_malformed_request() {
26792  25871   
        {
26793  25872   
            #[allow(unused_mut)]
26794  25873   
            let mut http_request = http::Request::builder()
26795         -
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57Z")
       25874  +
                .uri("/MalformedRequestBody")
26796  25875   
                .method("POST")
26797         -
                .body(::aws_smithy_http_server::body::Body::empty())
       25876  +
                .header("content-type", "application/json")
       25877  +
                .body(::aws_smithy_http_server::body::Body::from(
       25878  +
                    ::bytes::Bytes::from_static("null".as_bytes()),
       25879  +
                ))
26798  25880   
                .unwrap();
26799  25881   
            #[allow(unused_mut)]
26800  25882   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26801  25883   
            let config = crate::service::RestJsonConfig::builder().build();
26802  25884   
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26803         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       25885  +
                            .malformed_request_body(move |input: crate::input::MalformedRequestBodyInput| {
26804  25886   
                                let sender = sender.clone();
26805  25887   
                                async move {
26806         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       25888  +
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedRequestBodyOutput };
26807  25889   
                                    sender.send(()).await.expect("receiver dropped early");
26808  25890   
                                    result
26809  25891   
                                }
26810  25892   
                            })
26811  25893   
                            .build_unchecked();
26812  25894   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26813  25895   
                .await
26814  25896   
                .expect("unable to make an HTTP request");
26815  25897   
            ::pretty_assertions::assert_eq!(
26816  25898   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26817  25899   
                http_response.status()
26818  25900   
            );
26819  25901   
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26820  25902   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26821  25903   
                http_response.headers(),
26822  25904   
                expected_headers,
26823  25905   
            ));
26824  25906   
        }
26825  25907   
    }
26826         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26827         -
    /// are rejected with a 400 SerializationException
26828         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case7
26829         -
    #[::tokio::test]
26830         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case7_malformed_request(
26831         -
    ) {
26832         -
        {
26833         -
            #[allow(unused_mut)]
26834         -
            let mut http_request = http::Request::builder()
26835         -
                .uri("/MalformedTimestampPathDefault/19961219T16%3A39%3A57")
26836         -
                .method("POST")
26837         -
                .body(::aws_smithy_http_server::body::Body::empty())
26838         -
                .unwrap();
26839         -
            #[allow(unused_mut)]
26840         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26841         -
            let config = crate::service::RestJsonConfig::builder().build();
26842         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26843         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
26844         -
                                let sender = sender.clone();
26845         -
                                async move {
26846         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
26847         -
                                    sender.send(()).await.expect("receiver dropped early");
26848         -
                                    result
26849         -
                                }
26850         -
                            })
26851         -
                            .build_unchecked();
26852         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       25908  +
}
       25909  +
       25910  +
const CONTENT_TYPE_HTTPCHECKSUMREQUIRED: ::mime::Mime = ::mime::APPLICATION_JSON;
       25911  +
::pin_project_lite::pin_project! {
       25912  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       25913  +
    /// [`HttpChecksumRequiredInput`](crate::input::HttpChecksumRequiredInput) using modelled bindings.
       25914  +
    pub struct HttpChecksumRequiredInputFuture {
       25915  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpChecksumRequiredInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       25916  +
    }
       25917  +
}
       25918  +
       25919  +
impl std::future::Future for HttpChecksumRequiredInputFuture {
       25920  +
    type Output = Result<
       25921  +
        crate::input::HttpChecksumRequiredInput,
       25922  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       25923  +
    >;
       25924  +
       25925  +
    fn poll(
       25926  +
        self: std::pin::Pin<&mut Self>,
       25927  +
        cx: &mut std::task::Context<'_>,
       25928  +
    ) -> std::task::Poll<Self::Output> {
       25929  +
        let this = self.project();
       25930  +
        this.inner.as_mut().poll(cx)
       25931  +
    }
       25932  +
}
       25933  +
       25934  +
impl<B>
       25935  +
    ::aws_smithy_http_server::request::FromRequest<
       25936  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       25937  +
        B,
       25938  +
    > for crate::input::HttpChecksumRequiredInput
       25939  +
where
       25940  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       25941  +
    B: 'static,
       25942  +
       25943  +
    B::Data: Send,
       25944  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       25945  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       25946  +
{
       25947  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       25948  +
    type Future = HttpChecksumRequiredInputFuture;
       25949  +
       25950  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       25951  +
        let fut = async move {
       25952  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       25953  +
                request.headers(),
       25954  +
                &CONTENT_TYPE_HTTPCHECKSUMREQUIRED,
       25955  +
            ) {
       25956  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       25957  +
            }
       25958  +
            crate::protocol_serde::shape_http_checksum_required::de_http_checksum_required_http_request(request)
26853  25959   
                            .await
26854         -
                .expect("unable to make an HTTP request");
26855         -
            ::pretty_assertions::assert_eq!(
26856         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26857         -
                http_response.status()
       25960  +
                            .map_err(Into::into)
       25961  +
        };
       25962  +
        use ::futures_util::future::TryFutureExt;
       25963  +
        let fut = fut.map_err(
       25964  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       25965  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       25966  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       25967  +
                    e,
       25968  +
                )
       25969  +
            },
26858  25970   
        );
26859         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26860         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26861         -
                http_response.headers(),
26862         -
                expected_headers,
26863         -
            ));
       25971  +
        HttpChecksumRequiredInputFuture {
       25972  +
            inner: Box::pin(fut),
26864  25973   
        }
26865  25974   
    }
26866         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26867         -
    /// are rejected with a 400 SerializationException
26868         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case8
       25975  +
}
       25976  +
impl
       25977  +
    ::aws_smithy_http_server::response::IntoResponse<
       25978  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       25979  +
    > for crate::output::HttpChecksumRequiredOutput
       25980  +
{
       25981  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       25982  +
        match crate::protocol_serde::shape_http_checksum_required::ser_http_checksum_required_http_response(self) {
       25983  +
                        Ok(response) => response,
       25984  +
                        Err(e) => {
       25985  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       25986  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       25987  +
                        }
       25988  +
                    }
       25989  +
    }
       25990  +
}
       25991  +
       25992  +
#[allow(unreachable_code, unused_variables)]
       25993  +
#[cfg(test)]
       25994  +
mod http_checksum_required_test {
       25995  +
       25996  +
    /// Adds Content-MD5 header
       25997  +
    /// Test ID: RestJsonHttpChecksumRequired
26869  25998   
    #[::tokio::test]
26870         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case8_malformed_request(
26871         -
    ) {
26872         -
        {
       25999  +
    #[::tracing_test::traced_test]
       26000  +
    async fn rest_json_http_checksum_required_request() {
26873  26001   
        #[allow(unused_mut)]
26874  26002   
        let mut http_request = http::Request::builder()
26875         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39Z")
       26003  +
            .uri("/HttpChecksumRequired")
26876  26004   
            .method("POST")
26877         -
                .body(::aws_smithy_http_server::body::Body::empty())
       26005  +
            .header("Content-MD5", "iB0/3YSo7maijL0IGOgA9g==")
       26006  +
            .header("Content-Type", "application/json")
       26007  +
            .body(::aws_smithy_http_server::body::Body::from(
       26008  +
                ::bytes::Bytes::from_static(
       26009  +
                    "{\n    \"foo\":\"base64 encoded md5 checksum\"\n}\n".as_bytes(),
       26010  +
                ),
       26011  +
            ))
26878  26012   
            .unwrap();
26879  26013   
        #[allow(unused_mut)]
26880  26014   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26881  26015   
        let config = crate::service::RestJsonConfig::builder().build();
26882  26016   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26883         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       26017  +
            .http_checksum_required(move |input: crate::input::HttpChecksumRequiredInput| {
26884  26018   
                let sender = sender.clone();
26885  26019   
                async move {
26886         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       26020  +
                    let result = {
       26021  +
                        let expected = crate::input::HttpChecksumRequiredInput {
       26022  +
                            foo: ::std::option::Option::Some(
       26023  +
                                "base64 encoded md5 checksum".to_owned(),
       26024  +
                            ),
       26025  +
                        };
       26026  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26027  +
                        let response = crate::output::HttpChecksumRequiredOutput {
       26028  +
                            foo: ::std::option::Option::None,
       26029  +
                        };
       26030  +
                        response
       26031  +
                    };
26887  26032   
                    sender.send(()).await.expect("receiver dropped early");
26888  26033   
                    result
26889  26034   
                }
26890  26035   
            })
26891  26036   
            .build_unchecked();
26892  26037   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26893  26038   
            .await
26894  26039   
            .expect("unable to make an HTTP request");
26895         -
            ::pretty_assertions::assert_eq!(
26896         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26897         -
                http_response.status()
       26040  +
        assert!(
       26041  +
            receiver.recv().await.is_some(),
       26042  +
            "we expected operation handler to be invoked but it was not entered"
26898  26043   
        );
26899         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26900         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26901         -
                http_response.headers(),
26902         -
                expected_headers,
26903         -
            ));
26904  26044   
    }
       26045  +
}
       26046  +
       26047  +
const CONTENT_TYPE_HOSTWITHPATHOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
       26048  +
::pin_project_lite::pin_project! {
       26049  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       26050  +
    /// [`HostWithPathOperationInput`](crate::input::HostWithPathOperationInput) using modelled bindings.
       26051  +
    pub struct HostWithPathOperationInputFuture {
       26052  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HostWithPathOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
26905  26053   
    }
26906         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26907         -
    /// are rejected with a 400 SerializationException
26908         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case9
26909         -
    #[::tokio::test]
26910         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case9_malformed_request(
       26054  +
}
       26055  +
       26056  +
impl std::future::Future for HostWithPathOperationInputFuture {
       26057  +
    type Output = Result<
       26058  +
        crate::input::HostWithPathOperationInput,
       26059  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       26060  +
    >;
       26061  +
       26062  +
    fn poll(
       26063  +
        self: std::pin::Pin<&mut Self>,
       26064  +
        cx: &mut std::task::Context<'_>,
       26065  +
    ) -> std::task::Poll<Self::Output> {
       26066  +
        let this = self.project();
       26067  +
        this.inner.as_mut().poll(cx)
       26068  +
    }
       26069  +
}
       26070  +
       26071  +
impl<B>
       26072  +
    ::aws_smithy_http_server::request::FromRequest<
       26073  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26074  +
        B,
       26075  +
    > for crate::input::HostWithPathOperationInput
       26076  +
where
       26077  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       26078  +
    B: 'static,
       26079  +
       26080  +
    B::Data: Send,
       26081  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       26082  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       26083  +
{
       26084  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       26085  +
    type Future = HostWithPathOperationInputFuture;
       26086  +
       26087  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       26088  +
        let fut = async move {
       26089  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       26090  +
                request.headers(),
       26091  +
                &CONTENT_TYPE_HOSTWITHPATHOPERATION,
26911  26092   
            ) {
26912         -
        {
26913         -
            #[allow(unused_mut)]
26914         -
            let mut http_request = http::Request::builder()
26915         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16%3A39")
26916         -
                .method("POST")
26917         -
                .body(::aws_smithy_http_server::body::Body::empty())
26918         -
                .unwrap();
26919         -
            #[allow(unused_mut)]
26920         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26921         -
            let config = crate::service::RestJsonConfig::builder().build();
26922         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26923         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
26924         -
                                let sender = sender.clone();
26925         -
                                async move {
26926         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
26927         -
                                    sender.send(()).await.expect("receiver dropped early");
26928         -
                                    result
       26093  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
26929  26094   
            }
26930         -
                            })
26931         -
                            .build_unchecked();
26932         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       26095  +
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_request(request)
26933  26096   
                            .await
26934         -
                .expect("unable to make an HTTP request");
26935         -
            ::pretty_assertions::assert_eq!(
26936         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26937         -
                http_response.status()
       26097  +
                            .map_err(Into::into)
       26098  +
        };
       26099  +
        use ::futures_util::future::TryFutureExt;
       26100  +
        let fut = fut.map_err(
       26101  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       26102  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       26103  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       26104  +
                    e,
       26105  +
                )
       26106  +
            },
26938  26107   
        );
26939         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26940         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26941         -
                http_response.headers(),
26942         -
                expected_headers,
26943         -
            ));
       26108  +
        HostWithPathOperationInputFuture {
       26109  +
            inner: Box::pin(fut),
26944  26110   
        }
26945  26111   
    }
26946         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26947         -
    /// are rejected with a 400 SerializationException
26948         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case10
26949         -
    #[::tokio::test]
26950         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case10_malformed_request(
       26112  +
}
       26113  +
impl
       26114  +
    ::aws_smithy_http_server::response::IntoResponse<
       26115  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26116  +
    > for crate::output::HostWithPathOperationOutput
       26117  +
{
       26118  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26119  +
        match crate::protocol_serde::shape_host_with_path_operation::ser_host_with_path_operation_http_response(self) {
       26120  +
                        Ok(response) => response,
       26121  +
                        Err(e) => {
       26122  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       26123  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26124  +
                        }
       26125  +
                    }
       26126  +
    }
       26127  +
}
       26128  +
       26129  +
const CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
       26130  +
::pin_project_lite::pin_project! {
       26131  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       26132  +
    /// [`EndpointWithHostLabelOperationInput`](crate::input::EndpointWithHostLabelOperationInput) using modelled bindings.
       26133  +
    pub struct EndpointWithHostLabelOperationInputFuture {
       26134  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointWithHostLabelOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       26135  +
    }
       26136  +
}
       26137  +
       26138  +
impl std::future::Future for EndpointWithHostLabelOperationInputFuture {
       26139  +
    type Output = Result<
       26140  +
        crate::input::EndpointWithHostLabelOperationInput,
       26141  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       26142  +
    >;
       26143  +
       26144  +
    fn poll(
       26145  +
        self: std::pin::Pin<&mut Self>,
       26146  +
        cx: &mut std::task::Context<'_>,
       26147  +
    ) -> std::task::Poll<Self::Output> {
       26148  +
        let this = self.project();
       26149  +
        this.inner.as_mut().poll(cx)
       26150  +
    }
       26151  +
}
       26152  +
       26153  +
impl<B>
       26154  +
    ::aws_smithy_http_server::request::FromRequest<
       26155  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26156  +
        B,
       26157  +
    > for crate::input::EndpointWithHostLabelOperationInput
       26158  +
where
       26159  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       26160  +
    B: 'static,
       26161  +
       26162  +
    B::Data: Send,
       26163  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       26164  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       26165  +
{
       26166  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       26167  +
    type Future = EndpointWithHostLabelOperationInputFuture;
       26168  +
       26169  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       26170  +
        let fut = async move {
       26171  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       26172  +
                request.headers(),
       26173  +
                &CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION,
26951  26174   
            ) {
26952         -
        {
       26175  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       26176  +
            }
       26177  +
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_request(request)
       26178  +
                            .await
       26179  +
                            .map_err(Into::into)
       26180  +
        };
       26181  +
        use ::futures_util::future::TryFutureExt;
       26182  +
        let fut = fut.map_err(
       26183  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       26184  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       26185  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       26186  +
                    e,
       26187  +
                )
       26188  +
            },
       26189  +
        );
       26190  +
        EndpointWithHostLabelOperationInputFuture {
       26191  +
            inner: Box::pin(fut),
       26192  +
        }
       26193  +
    }
       26194  +
}
       26195  +
impl
       26196  +
    ::aws_smithy_http_server::response::IntoResponse<
       26197  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26198  +
    > for crate::output::EndpointWithHostLabelOperationOutput
       26199  +
{
       26200  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26201  +
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_response(self) {
       26202  +
                        Ok(response) => response,
       26203  +
                        Err(e) => {
       26204  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       26205  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26206  +
                        }
       26207  +
                    }
       26208  +
    }
       26209  +
}
       26210  +
impl
       26211  +
    ::aws_smithy_http_server::response::IntoResponse<
       26212  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26213  +
    > for crate::error::EndpointWithHostLabelOperationError
       26214  +
{
       26215  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26216  +
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_error(&self) {
       26217  +
            Ok(mut response) => {
       26218  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       26219  +
                response
       26220  +
            },
       26221  +
            Err(e) => {
       26222  +
                ::tracing::error!(error = %e, "failed to serialize response");
       26223  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26224  +
            }
       26225  +
        }
       26226  +
    }
       26227  +
}
       26228  +
       26229  +
#[allow(unreachable_code, unused_variables)]
       26230  +
#[cfg(test)]
       26231  +
mod endpoint_with_host_label_operation_test {
       26232  +
       26233  +
    /// Operations can prepend to the given host if they define the
       26234  +
    /// endpoint trait, and can use the host label trait to define
       26235  +
    /// further customization based on user input.
       26236  +
    /// Test ID: RestJsonEndpointTraitWithHostLabel
       26237  +
    #[::tokio::test]
       26238  +
    #[::tracing_test::traced_test]
       26239  +
    #[should_panic]
       26240  +
    async fn rest_json_endpoint_trait_with_host_label_request() {
26953  26241   
        #[allow(unused_mut)]
26954  26242   
        let mut http_request = http::Request::builder()
26955         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T1639")
       26243  +
            .uri("/EndpointWithHostLabelOperation")
26956  26244   
            .method("POST")
26957         -
                .body(::aws_smithy_http_server::body::Body::empty())
       26245  +
            .body(::aws_smithy_http_server::body::Body::from(
       26246  +
                ::bytes::Bytes::from_static("{\"label\": \"bar\"}".as_bytes()),
       26247  +
            ))
26958  26248   
            .unwrap();
       26249  +
        todo!("endpoint trait not supported yet");
26959  26250   
        #[allow(unused_mut)]
26960  26251   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
26961  26252   
        let config = crate::service::RestJsonConfig::builder().build();
26962  26253   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
26963         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       26254  +
            .endpoint_with_host_label_operation(
       26255  +
                move |input: crate::input::EndpointWithHostLabelOperationInput| {
26964  26256   
                    let sender = sender.clone();
26965  26257   
                    async move {
26966         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       26258  +
                        let result = {
       26259  +
                            let expected = crate::input::EndpointWithHostLabelOperationInput {
       26260  +
                                label: "bar".to_owned(),
       26261  +
                            };
       26262  +
                            ::pretty_assertions::assert_eq!(input, expected);
       26263  +
                            let response = crate::output::EndpointWithHostLabelOperationOutput {};
       26264  +
                            Ok(response)
       26265  +
                        };
26967  26266   
                        sender.send(()).await.expect("receiver dropped early");
26968  26267   
                        result
26969  26268   
                    }
26970         -
                            })
       26269  +
                },
       26270  +
            )
26971  26271   
            .build_unchecked();
26972  26272   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
26973  26273   
            .await
26974  26274   
            .expect("unable to make an HTTP request");
26975         -
            ::pretty_assertions::assert_eq!(
26976         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
26977         -
                http_response.status()
       26275  +
        assert!(
       26276  +
            receiver.recv().await.is_some(),
       26277  +
            "we expected operation handler to be invoked but it was not entered"
26978  26278   
        );
26979         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
26980         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
26981         -
                http_response.headers(),
26982         -
                expected_headers,
26983         -
            ));
26984  26279   
    }
       26280  +
}
       26281  +
       26282  +
const CONTENT_TYPE_ENDPOINTOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
       26283  +
::pin_project_lite::pin_project! {
       26284  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       26285  +
    /// [`EndpointOperationInput`](crate::input::EndpointOperationInput) using modelled bindings.
       26286  +
    pub struct EndpointOperationInputFuture {
       26287  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
26985  26288   
    }
26986         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
26987         -
    /// are rejected with a 400 SerializationException
26988         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case11
26989         -
    #[::tokio::test]
26990         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case11_malformed_request(
       26289  +
}
       26290  +
       26291  +
impl std::future::Future for EndpointOperationInputFuture {
       26292  +
    type Output = Result<
       26293  +
        crate::input::EndpointOperationInput,
       26294  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       26295  +
    >;
       26296  +
       26297  +
    fn poll(
       26298  +
        self: std::pin::Pin<&mut Self>,
       26299  +
        cx: &mut std::task::Context<'_>,
       26300  +
    ) -> std::task::Poll<Self::Output> {
       26301  +
        let this = self.project();
       26302  +
        this.inner.as_mut().poll(cx)
       26303  +
    }
       26304  +
}
       26305  +
       26306  +
impl<B>
       26307  +
    ::aws_smithy_http_server::request::FromRequest<
       26308  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26309  +
        B,
       26310  +
    > for crate::input::EndpointOperationInput
       26311  +
where
       26312  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       26313  +
    B: 'static,
       26314  +
       26315  +
    B::Data: Send,
       26316  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       26317  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       26318  +
{
       26319  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       26320  +
    type Future = EndpointOperationInputFuture;
       26321  +
       26322  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       26323  +
        let fut = async move {
       26324  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       26325  +
                request.headers(),
       26326  +
                &CONTENT_TYPE_ENDPOINTOPERATION,
26991  26327   
            ) {
26992         -
        {
       26328  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       26329  +
            }
       26330  +
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_request(
       26331  +
                request,
       26332  +
            )
       26333  +
            .await
       26334  +
            .map_err(Into::into)
       26335  +
        };
       26336  +
        use ::futures_util::future::TryFutureExt;
       26337  +
        let fut = fut.map_err(
       26338  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       26339  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       26340  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       26341  +
                    e,
       26342  +
                )
       26343  +
            },
       26344  +
        );
       26345  +
        EndpointOperationInputFuture {
       26346  +
            inner: Box::pin(fut),
       26347  +
        }
       26348  +
    }
       26349  +
}
       26350  +
impl
       26351  +
    ::aws_smithy_http_server::response::IntoResponse<
       26352  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26353  +
    > for crate::output::EndpointOperationOutput
       26354  +
{
       26355  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26356  +
        match crate::protocol_serde::shape_endpoint_operation::ser_endpoint_operation_http_response(
       26357  +
            self,
       26358  +
        ) {
       26359  +
            Ok(response) => response,
       26360  +
            Err(e) => {
       26361  +
                ::tracing::error!(error = %e, "failed to serialize response");
       26362  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26363  +
            }
       26364  +
        }
       26365  +
    }
       26366  +
}
       26367  +
       26368  +
#[allow(unreachable_code, unused_variables)]
       26369  +
#[cfg(test)]
       26370  +
mod endpoint_operation_test {
       26371  +
       26372  +
    /// Operations can prepend to the given host if they define the
       26373  +
    /// endpoint trait.
       26374  +
    /// Test ID: RestJsonEndpointTrait
       26375  +
    #[::tokio::test]
       26376  +
    #[::tracing_test::traced_test]
       26377  +
    #[should_panic]
       26378  +
    async fn rest_json_endpoint_trait_request() {
26993  26379   
        #[allow(unused_mut)]
26994  26380   
        let mut http_request = http::Request::builder()
26995         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16Z")
       26381  +
            .uri("/EndpointOperation")
26996  26382   
            .method("POST")
26997         -
                .body(::aws_smithy_http_server::body::Body::empty())
       26383  +
            .body(::aws_smithy_http_server::body::Body::from(
       26384  +
                ::bytes::Bytes::from_static("".as_bytes()),
       26385  +
            ))
26998  26386   
            .unwrap();
       26387  +
        todo!("endpoint trait not supported yet");
26999  26388   
        #[allow(unused_mut)]
27000  26389   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27001  26390   
        let config = crate::service::RestJsonConfig::builder().build();
27002  26391   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27003         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       26392  +
            .endpoint_operation(move |input: crate::input::EndpointOperationInput| {
27004  26393   
                let sender = sender.clone();
27005  26394   
                async move {
27006         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       26395  +
                    let result = {
       26396  +
                        let expected = crate::input::EndpointOperationInput {};
       26397  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26398  +
                        let response = crate::output::EndpointOperationOutput {};
       26399  +
                        response
       26400  +
                    };
27007  26401   
                    sender.send(()).await.expect("receiver dropped early");
27008  26402   
                    result
27009  26403   
                }
27010  26404   
            })
27011  26405   
            .build_unchecked();
27012  26406   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27013  26407   
            .await
27014  26408   
            .expect("unable to make an HTTP request");
27015         -
            ::pretty_assertions::assert_eq!(
27016         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27017         -
                http_response.status()
       26409  +
        assert!(
       26410  +
            receiver.recv().await.is_some(),
       26411  +
            "we expected operation handler to be invoked but it was not entered"
27018  26412   
        );
27019         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27020         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27021         -
                http_response.headers(),
27022         -
                expected_headers,
27023         -
            ));
27024  26413   
    }
       26414  +
}
       26415  +
       26416  +
const CONTENT_TYPE_POSTUNIONWITHJSONNAME: ::mime::Mime = ::mime::APPLICATION_JSON;
       26417  +
::pin_project_lite::pin_project! {
       26418  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       26419  +
    /// [`PostUnionWithJsonNameInput`](crate::input::PostUnionWithJsonNameInput) using modelled bindings.
       26420  +
    pub struct PostUnionWithJsonNameInputFuture {
       26421  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PostUnionWithJsonNameInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
27025  26422   
    }
27026         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
27027         -
    /// are rejected with a 400 SerializationException
27028         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case12
27029         -
    #[::tokio::test]
27030         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case12_malformed_request(
       26423  +
}
       26424  +
       26425  +
impl std::future::Future for PostUnionWithJsonNameInputFuture {
       26426  +
    type Output = Result<
       26427  +
        crate::input::PostUnionWithJsonNameInput,
       26428  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       26429  +
    >;
       26430  +
       26431  +
    fn poll(
       26432  +
        self: std::pin::Pin<&mut Self>,
       26433  +
        cx: &mut std::task::Context<'_>,
       26434  +
    ) -> std::task::Poll<Self::Output> {
       26435  +
        let this = self.project();
       26436  +
        this.inner.as_mut().poll(cx)
       26437  +
    }
       26438  +
}
       26439  +
       26440  +
impl<B>
       26441  +
    ::aws_smithy_http_server::request::FromRequest<
       26442  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26443  +
        B,
       26444  +
    > for crate::input::PostUnionWithJsonNameInput
       26445  +
where
       26446  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       26447  +
    B: 'static,
       26448  +
       26449  +
    B::Data: Send,
       26450  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       26451  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       26452  +
{
       26453  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       26454  +
    type Future = PostUnionWithJsonNameInputFuture;
       26455  +
       26456  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       26457  +
        let fut = async move {
       26458  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       26459  +
                request.headers(),
       26460  +
                &CONTENT_TYPE_POSTUNIONWITHJSONNAME,
27031  26461   
            ) {
27032         -
        {
27033         -
            #[allow(unused_mut)]
27034         -
            let mut http_request = http::Request::builder()
27035         -
                .uri("/MalformedTimestampPathDefault/1996-12-19T16")
27036         -
                .method("POST")
27037         -
                .body(::aws_smithy_http_server::body::Body::empty())
27038         -
                .unwrap();
27039         -
            #[allow(unused_mut)]
27040         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27041         -
            let config = crate::service::RestJsonConfig::builder().build();
27042         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27043         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
27044         -
                                let sender = sender.clone();
27045         -
                                async move {
27046         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
27047         -
                                    sender.send(()).await.expect("receiver dropped early");
27048         -
                                    result
       26462  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
27049  26463   
            }
27050         -
                            })
27051         -
                            .build_unchecked();
27052         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       26464  +
            crate::protocol_serde::shape_post_union_with_json_name::de_post_union_with_json_name_http_request(request)
27053  26465   
                            .await
27054         -
                .expect("unable to make an HTTP request");
27055         -
            ::pretty_assertions::assert_eq!(
27056         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27057         -
                http_response.status()
       26466  +
                            .map_err(Into::into)
       26467  +
        };
       26468  +
        use ::futures_util::future::TryFutureExt;
       26469  +
        let fut = fut.map_err(
       26470  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       26471  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       26472  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       26473  +
                    e,
       26474  +
                )
       26475  +
            },
27058  26476   
        );
27059         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27060         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27061         -
                http_response.headers(),
27062         -
                expected_headers,
27063         -
            ));
       26477  +
        PostUnionWithJsonNameInputFuture {
       26478  +
            inner: Box::pin(fut),
27064  26479   
        }
27065  26480   
    }
27066         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
27067         -
    /// are rejected with a 400 SerializationException
27068         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case13
       26481  +
}
       26482  +
impl
       26483  +
    ::aws_smithy_http_server::response::IntoResponse<
       26484  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26485  +
    > for crate::output::PostUnionWithJsonNameOutput
       26486  +
{
       26487  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26488  +
        match crate::protocol_serde::shape_post_union_with_json_name::ser_post_union_with_json_name_http_response(self) {
       26489  +
                        Ok(response) => response,
       26490  +
                        Err(e) => {
       26491  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       26492  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26493  +
                        }
       26494  +
                    }
       26495  +
    }
       26496  +
}
       26497  +
       26498  +
#[allow(unreachable_code, unused_variables)]
       26499  +
#[cfg(test)]
       26500  +
mod post_union_with_json_name_test {
       26501  +
       26502  +
    /// Tests that jsonName works with union members.
       26503  +
    /// Test ID: PostUnionWithJsonNameRequest1
27069  26504   
    #[::tokio::test]
27070         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case13_malformed_request(
27071         -
    ) {
27072         -
        {
       26505  +
    #[::tracing_test::traced_test]
       26506  +
    async fn post_union_with_json_name_request1_request() {
27073  26507   
        #[allow(unused_mut)]
27074  26508   
        let mut http_request = http::Request::builder()
27075         -
                .uri("/MalformedTimestampPathDefault/1996-12-19%2016%3A39%3A57Z")
       26509  +
            .uri("/PostUnionWithJsonName")
27076  26510   
            .method("POST")
27077         -
                .body(::aws_smithy_http_server::body::Body::empty())
       26511  +
            .header("Content-Type", "application/json")
       26512  +
            .body(::aws_smithy_http_server::body::Body::from(
       26513  +
                ::bytes::Bytes::from_static(
       26514  +
                    "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}".as_bytes(),
       26515  +
                ),
       26516  +
            ))
27078  26517   
            .unwrap();
27079  26518   
        #[allow(unused_mut)]
27080  26519   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27081  26520   
        let config = crate::service::RestJsonConfig::builder().build();
27082  26521   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27083         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       26522  +
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
27084  26523   
                let sender = sender.clone();
27085  26524   
                async move {
27086         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       26525  +
                    let result = {
       26526  +
                        let expected = crate::input::PostUnionWithJsonNameInput {
       26527  +
                            value: ::std::option::Option::Some(
       26528  +
                                crate::model::UnionWithJsonName::Foo("hi".to_owned()),
       26529  +
                            ),
       26530  +
                        };
       26531  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26532  +
                        let response = crate::output::PostUnionWithJsonNameOutput {
       26533  +
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
       26534  +
                        };
       26535  +
                        response
       26536  +
                    };
27087  26537   
                    sender.send(()).await.expect("receiver dropped early");
27088  26538   
                    result
27089  26539   
                }
27090  26540   
            })
27091  26541   
            .build_unchecked();
27092  26542   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27093  26543   
            .await
27094  26544   
            .expect("unable to make an HTTP request");
27095         -
            ::pretty_assertions::assert_eq!(
27096         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27097         -
                http_response.status()
       26545  +
        assert!(
       26546  +
            receiver.recv().await.is_some(),
       26547  +
            "we expected operation handler to be invoked but it was not entered"
27098  26548   
        );
27099         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27100         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27101         -
                http_response.headers(),
27102         -
                expected_headers,
27103         -
            ));
27104         -
        }
27105  26549   
    }
27106         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
27107         -
    /// are rejected with a 400 SerializationException
27108         -
    /// Test ID: RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case14
       26550  +
    /// Tests that jsonName works with union members.
       26551  +
    /// Test ID: PostUnionWithJsonNameRequest2
27109  26552   
    #[::tokio::test]
27110         -
    async fn rest_json_path_timestamp_default_rejects_different8601_formats_case14_malformed_request(
27111         -
    ) {
27112         -
        {
       26553  +
    #[::tracing_test::traced_test]
       26554  +
    async fn post_union_with_json_name_request2_request() {
27113  26555   
        #[allow(unused_mut)]
27114  26556   
        let mut http_request = http::Request::builder()
27115         -
                            .uri("/MalformedTimestampPathDefault/2011-12-03T10%3A15%3A30%2B01%3A00%5BEurope%2FParis%5D")
       26557  +
            .uri("/PostUnionWithJsonName")
27116  26558   
            .method("POST")
27117         -
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
       26559  +
            .header("Content-Type", "application/json")
       26560  +
            .body(::aws_smithy_http_server::body::Body::from(
       26561  +
                ::bytes::Bytes::from_static(
       26562  +
                    "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}".as_bytes(),
       26563  +
                ),
       26564  +
            ))
       26565  +
            .unwrap();
27118  26566   
        #[allow(unused_mut)]
27119  26567   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27120  26568   
        let config = crate::service::RestJsonConfig::builder().build();
27121  26569   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27122         -
                            .malformed_timestamp_path_default(move |input: crate::input::MalformedTimestampPathDefaultInput| {
       26570  +
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
27123  26571   
                let sender = sender.clone();
27124  26572   
                async move {
27125         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathDefaultOutput, crate::error::MalformedTimestampPathDefaultError> };
       26573  +
                    let result = {
       26574  +
                        let expected = crate::input::PostUnionWithJsonNameInput {
       26575  +
                            value: ::std::option::Option::Some(
       26576  +
                                crate::model::UnionWithJsonName::Baz("hi".to_owned()),
       26577  +
                            ),
       26578  +
                        };
       26579  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26580  +
                        let response = crate::output::PostUnionWithJsonNameOutput {
       26581  +
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
       26582  +
                        };
       26583  +
                        response
       26584  +
                    };
27126  26585   
                    sender.send(()).await.expect("receiver dropped early");
27127  26586   
                    result
27128  26587   
                }
27129  26588   
            })
27130  26589   
            .build_unchecked();
27131  26590   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27132  26591   
            .await
27133  26592   
            .expect("unable to make an HTTP request");
27134         -
            ::pretty_assertions::assert_eq!(
27135         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27136         -
                http_response.status()
       26593  +
        assert!(
       26594  +
            receiver.recv().await.is_some(),
       26595  +
            "we expected operation handler to be invoked but it was not entered"
27137  26596   
        );
27138         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27139         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27140         -
                http_response.headers(),
27141         -
                expected_headers,
27142         -
            ));
27143         -
        }
27144  26597   
    }
27145         -
}
27146         -
#[cfg(test)]
27147         -
#[allow(unreachable_code, unused_variables)]
27148         -
mod server_malformed_timestamp_path_epoch_test {
27149         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
27150         -
    /// 400 SerializationException
27151         -
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case0
       26598  +
    /// Tests that jsonName works with union members.
       26599  +
    /// Test ID: PostUnionWithJsonNameRequest3
27152  26600   
    #[::tokio::test]
27153         -
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case0_malformed_request() {
27154         -
        {
       26601  +
    #[::tracing_test::traced_test]
       26602  +
    async fn post_union_with_json_name_request3_request() {
27155  26603   
        #[allow(unused_mut)]
27156  26604   
        let mut http_request = http::Request::builder()
27157         -
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50.52Z")
       26605  +
            .uri("/PostUnionWithJsonName")
27158  26606   
            .method("POST")
27159         -
                .body(::aws_smithy_http_server::body::Body::empty())
       26607  +
            .header("Content-Type", "application/json")
       26608  +
            .body(::aws_smithy_http_server::body::Body::from(
       26609  +
                ::bytes::Bytes::from_static(
       26610  +
                    "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}".as_bytes(),
       26611  +
                ),
       26612  +
            ))
27160  26613   
            .unwrap();
27161  26614   
        #[allow(unused_mut)]
27162  26615   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27163  26616   
        let config = crate::service::RestJsonConfig::builder().build();
27164  26617   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27165         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       26618  +
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
27166  26619   
                let sender = sender.clone();
27167  26620   
                async move {
27168         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       26621  +
                    let result = {
       26622  +
                        let expected = crate::input::PostUnionWithJsonNameInput {
       26623  +
                            value: ::std::option::Option::Some(
       26624  +
                                crate::model::UnionWithJsonName::Bar("hi".to_owned()),
       26625  +
                            ),
       26626  +
                        };
       26627  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26628  +
                        let response = crate::output::PostUnionWithJsonNameOutput {
       26629  +
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
       26630  +
                        };
       26631  +
                        response
       26632  +
                    };
27169  26633   
                    sender.send(()).await.expect("receiver dropped early");
27170  26634   
                    result
27171  26635   
                }
27172  26636   
            })
27173  26637   
            .build_unchecked();
27174  26638   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27175  26639   
            .await
27176  26640   
            .expect("unable to make an HTTP request");
       26641  +
        assert!(
       26642  +
            receiver.recv().await.is_some(),
       26643  +
            "we expected operation handler to be invoked but it was not entered"
       26644  +
        );
       26645  +
    }
       26646  +
    /// Tests that jsonName works with union members.
       26647  +
    /// Test ID: PostUnionWithJsonNameResponse1
       26648  +
    #[::tokio::test]
       26649  +
    #[::tracing_test::traced_test]
       26650  +
    async fn post_union_with_json_name_response1_response() {
       26651  +
        let output = crate::output::PostUnionWithJsonNameOutput {
       26652  +
            value: crate::model::UnionWithJsonName::Foo("hi".to_owned()),
       26653  +
        };
       26654  +
        use ::aws_smithy_http_server::response::IntoResponse;
       26655  +
        let http_response = output.into_response();
27177  26656   
        ::pretty_assertions::assert_eq!(
27178         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       26657  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27179  26658   
            http_response.status()
27180  26659   
        );
27181         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       26660  +
        let expected_headers = [("Content-Type", "application/json")];
27182  26661   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27183  26662   
            http_response.headers(),
27184  26663   
            expected_headers,
27185  26664   
        ));
       26665  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       26666  +
            .await
       26667  +
            .expect("unable to extract body to bytes");
       26668  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       26669  +
            &body,
       26670  +
            "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}",
       26671  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       26672  +
        ));
27186  26673   
    }
27187         -
    }
27188         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
27189         -
    /// 400 SerializationException
27190         -
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case1
       26674  +
    /// Tests that jsonName works with union members.
       26675  +
    /// Test ID: PostUnionWithJsonNameResponse2
27191  26676   
    #[::tokio::test]
27192         -
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case1_malformed_request() {
27193         -
        {
27194         -
            #[allow(unused_mut)]
27195         -
            let mut http_request = http::Request::builder()
27196         -
                .uri("/MalformedTimestampPathEpoch/1985-04-12T23%3A20%3A50Z")
27197         -
                .method("POST")
27198         -
                .body(::aws_smithy_http_server::body::Body::empty())
27199         -
                .unwrap();
27200         -
            #[allow(unused_mut)]
27201         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27202         -
            let config = crate::service::RestJsonConfig::builder().build();
27203         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27204         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
27205         -
                                let sender = sender.clone();
27206         -
                                async move {
27207         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
27208         -
                                    sender.send(()).await.expect("receiver dropped early");
27209         -
                                    result
27210         -
                                }
27211         -
                            })
27212         -
                            .build_unchecked();
27213         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27214         -
                .await
27215         -
                .expect("unable to make an HTTP request");
       26677  +
    #[::tracing_test::traced_test]
       26678  +
    async fn post_union_with_json_name_response2_response() {
       26679  +
        let output = crate::output::PostUnionWithJsonNameOutput {
       26680  +
            value: crate::model::UnionWithJsonName::Baz("hi".to_owned()),
       26681  +
        };
       26682  +
        use ::aws_smithy_http_server::response::IntoResponse;
       26683  +
        let http_response = output.into_response();
27216  26684   
        ::pretty_assertions::assert_eq!(
27217         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       26685  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27218  26686   
            http_response.status()
27219  26687   
        );
27220         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       26688  +
        let expected_headers = [("Content-Type", "application/json")];
27221  26689   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27222  26690   
            http_response.headers(),
27223  26691   
            expected_headers,
27224  26692   
        ));
       26693  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       26694  +
            .await
       26695  +
            .expect("unable to extract body to bytes");
       26696  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       26697  +
            &body,
       26698  +
            "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}",
       26699  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       26700  +
        ));
27225  26701   
    }
27226         -
    }
27227         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
27228         -
    /// 400 SerializationException
27229         -
    /// Test ID: RestJsonPathTimestampEpochRejectsDateTime_case2
       26702  +
    /// Tests that jsonName works with union members.
       26703  +
    /// Test ID: PostUnionWithJsonNameResponse3
27230  26704   
    #[::tokio::test]
27231         -
    async fn rest_json_path_timestamp_epoch_rejects_date_time_case2_malformed_request() {
27232         -
        {
27233         -
            #[allow(unused_mut)]
27234         -
            let mut http_request = http::Request::builder()
27235         -
                .uri("/MalformedTimestampPathEpoch/1996-12-19T16%3A39%3A57-08%3A00")
27236         -
                .method("POST")
27237         -
                .body(::aws_smithy_http_server::body::Body::empty())
27238         -
                .unwrap();
27239         -
            #[allow(unused_mut)]
27240         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27241         -
            let config = crate::service::RestJsonConfig::builder().build();
27242         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27243         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
27244         -
                                let sender = sender.clone();
27245         -
                                async move {
27246         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
27247         -
                                    sender.send(()).await.expect("receiver dropped early");
27248         -
                                    result
27249         -
                                }
27250         -
                            })
27251         -
                            .build_unchecked();
27252         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27253         -
                .await
27254         -
                .expect("unable to make an HTTP request");
       26705  +
    #[::tracing_test::traced_test]
       26706  +
    async fn post_union_with_json_name_response3_response() {
       26707  +
        let output = crate::output::PostUnionWithJsonNameOutput {
       26708  +
            value: crate::model::UnionWithJsonName::Bar("hi".to_owned()),
       26709  +
        };
       26710  +
        use ::aws_smithy_http_server::response::IntoResponse;
       26711  +
        let http_response = output.into_response();
27255  26712   
        ::pretty_assertions::assert_eq!(
27256         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       26713  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27257  26714   
            http_response.status()
27258  26715   
        );
27259         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       26716  +
        let expected_headers = [("Content-Type", "application/json")];
27260  26717   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27261  26718   
            http_response.headers(),
27262  26719   
            expected_headers,
27263  26720   
        ));
       26721  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       26722  +
            .await
       26723  +
            .expect("unable to extract body to bytes");
       26724  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       26725  +
            &body,
       26726  +
            "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}",
       26727  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       26728  +
        ));
27264  26729   
    }
       26730  +
}
       26731  +
       26732  +
const CONTENT_TYPE_POSTPLAYERACTION: ::mime::Mime = ::mime::APPLICATION_JSON;
       26733  +
::pin_project_lite::pin_project! {
       26734  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       26735  +
    /// [`PostPlayerActionInput`](crate::input::PostPlayerActionInput) using modelled bindings.
       26736  +
    pub struct PostPlayerActionInputFuture {
       26737  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PostPlayerActionInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
27265  26738   
    }
27266         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
27267         -
    /// 400 SerializationException
27268         -
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case0
       26739  +
}
       26740  +
       26741  +
impl std::future::Future for PostPlayerActionInputFuture {
       26742  +
    type Output = Result<
       26743  +
        crate::input::PostPlayerActionInput,
       26744  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       26745  +
    >;
       26746  +
       26747  +
    fn poll(
       26748  +
        self: std::pin::Pin<&mut Self>,
       26749  +
        cx: &mut std::task::Context<'_>,
       26750  +
    ) -> std::task::Poll<Self::Output> {
       26751  +
        let this = self.project();
       26752  +
        this.inner.as_mut().poll(cx)
       26753  +
    }
       26754  +
}
       26755  +
       26756  +
impl<B>
       26757  +
    ::aws_smithy_http_server::request::FromRequest<
       26758  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26759  +
        B,
       26760  +
    > for crate::input::PostPlayerActionInput
       26761  +
where
       26762  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       26763  +
    B: 'static,
       26764  +
       26765  +
    B::Data: Send,
       26766  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       26767  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       26768  +
{
       26769  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       26770  +
    type Future = PostPlayerActionInputFuture;
       26771  +
       26772  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       26773  +
        let fut = async move {
       26774  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       26775  +
                request.headers(),
       26776  +
                &CONTENT_TYPE_POSTPLAYERACTION,
       26777  +
            ) {
       26778  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       26779  +
            }
       26780  +
            crate::protocol_serde::shape_post_player_action::de_post_player_action_http_request(
       26781  +
                request,
       26782  +
            )
       26783  +
            .await
       26784  +
            .map_err(Into::into)
       26785  +
        };
       26786  +
        use ::futures_util::future::TryFutureExt;
       26787  +
        let fut = fut.map_err(
       26788  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       26789  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       26790  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       26791  +
                    e,
       26792  +
                )
       26793  +
            },
       26794  +
        );
       26795  +
        PostPlayerActionInputFuture {
       26796  +
            inner: Box::pin(fut),
       26797  +
        }
       26798  +
    }
       26799  +
}
       26800  +
impl
       26801  +
    ::aws_smithy_http_server::response::IntoResponse<
       26802  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26803  +
    > for crate::output::PostPlayerActionOutput
       26804  +
{
       26805  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26806  +
        match crate::protocol_serde::shape_post_player_action::ser_post_player_action_http_response(
       26807  +
            self,
       26808  +
        ) {
       26809  +
            Ok(response) => response,
       26810  +
            Err(e) => {
       26811  +
                ::tracing::error!(error = %e, "failed to serialize response");
       26812  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26813  +
            }
       26814  +
        }
       26815  +
    }
       26816  +
}
       26817  +
       26818  +
#[allow(unreachable_code, unused_variables)]
       26819  +
#[cfg(test)]
       26820  +
mod post_player_action_test {
       26821  +
       26822  +
    /// Unit types in unions are serialized like normal structures in requests.
       26823  +
    /// Test ID: RestJsonInputUnionWithUnitMember
27269  26824   
    #[::tokio::test]
27270         -
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case0_malformed_request() {
27271         -
        {
       26825  +
    #[::tracing_test::traced_test]
       26826  +
    async fn rest_json_input_union_with_unit_member_request() {
27272  26827   
        #[allow(unused_mut)]
27273  26828   
        let mut http_request = http::Request::builder()
27274         -
                .uri("/MalformedTimestampPathEpoch/Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT")
       26829  +
            .uri("/PostPlayerAction")
27275  26830   
            .method("POST")
27276         -
                .body(::aws_smithy_http_server::body::Body::empty())
       26831  +
            .header("Content-Type", "application/json")
       26832  +
            .body(::aws_smithy_http_server::body::Body::from(
       26833  +
                ::bytes::Bytes::from_static(
       26834  +
                    "{\n    \"action\": {\n        \"quit\": {}\n    }\n}".as_bytes(),
       26835  +
                ),
       26836  +
            ))
27277  26837   
            .unwrap();
27278  26838   
        #[allow(unused_mut)]
27279  26839   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27280  26840   
        let config = crate::service::RestJsonConfig::builder().build();
27281  26841   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27282         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       26842  +
            .post_player_action(move |input: crate::input::PostPlayerActionInput| {
27283  26843   
                let sender = sender.clone();
27284  26844   
                async move {
27285         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       26845  +
                    let result = {
       26846  +
                        let expected = crate::input::PostPlayerActionInput {
       26847  +
                            action: ::std::option::Option::Some(crate::model::PlayerAction::Quit),
       26848  +
                        };
       26849  +
                        ::pretty_assertions::assert_eq!(input, expected);
       26850  +
                        let response = crate::output::PostPlayerActionOutput {
       26851  +
                            action: crate::model::PlayerAction::Quit,
       26852  +
                        };
       26853  +
                        response
       26854  +
                    };
27286  26855   
                    sender.send(()).await.expect("receiver dropped early");
27287  26856   
                    result
27288  26857   
                }
27289  26858   
            })
27290  26859   
            .build_unchecked();
27291  26860   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27292  26861   
            .await
27293  26862   
            .expect("unable to make an HTTP request");
       26863  +
        assert!(
       26864  +
            receiver.recv().await.is_some(),
       26865  +
            "we expected operation handler to be invoked but it was not entered"
       26866  +
        );
       26867  +
    }
       26868  +
    /// Unit types in unions are serialized like normal structures in responses.
       26869  +
    /// Test ID: RestJsonOutputUnionWithUnitMember
       26870  +
    #[::tokio::test]
       26871  +
    #[::tracing_test::traced_test]
       26872  +
    async fn rest_json_output_union_with_unit_member_response() {
       26873  +
        let output = crate::output::PostPlayerActionOutput {
       26874  +
            action: crate::model::PlayerAction::Quit,
       26875  +
        };
       26876  +
        use ::aws_smithy_http_server::response::IntoResponse;
       26877  +
        let http_response = output.into_response();
27294  26878   
        ::pretty_assertions::assert_eq!(
27295         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       26879  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27296  26880   
            http_response.status()
27297  26881   
        );
27298         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       26882  +
        let expected_headers = [("Content-Type", "application/json")];
27299  26883   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27300  26884   
            http_response.headers(),
27301  26885   
            expected_headers,
27302  26886   
        ));
       26887  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       26888  +
            .await
       26889  +
            .expect("unable to extract body to bytes");
       26890  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       26891  +
            &body,
       26892  +
            "{\n    \"action\": {\n        \"quit\": {}\n    }\n}",
       26893  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       26894  +
        ));
27303  26895   
    }
27304         -
    }
27305         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
27306         -
    /// 400 SerializationException
27307         -
    /// Test ID: RestJsonPathTimestampEpochRejectsHttpDate_case1
       26896  +
}
       26897  +
       26898  +
const CONTENT_TYPE_JSONUNIONS: ::mime::Mime = ::mime::APPLICATION_JSON;
       26899  +
::pin_project_lite::pin_project! {
       26900  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       26901  +
    /// [`JsonUnionsInput`](crate::input::JsonUnionsInput) using modelled bindings.
       26902  +
    pub struct JsonUnionsInputFuture {
       26903  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonUnionsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       26904  +
    }
       26905  +
}
       26906  +
       26907  +
impl std::future::Future for JsonUnionsInputFuture {
       26908  +
    type Output = Result<
       26909  +
        crate::input::JsonUnionsInput,
       26910  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       26911  +
    >;
       26912  +
       26913  +
    fn poll(
       26914  +
        self: std::pin::Pin<&mut Self>,
       26915  +
        cx: &mut std::task::Context<'_>,
       26916  +
    ) -> std::task::Poll<Self::Output> {
       26917  +
        let this = self.project();
       26918  +
        this.inner.as_mut().poll(cx)
       26919  +
    }
       26920  +
}
       26921  +
       26922  +
impl<B>
       26923  +
    ::aws_smithy_http_server::request::FromRequest<
       26924  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26925  +
        B,
       26926  +
    > for crate::input::JsonUnionsInput
       26927  +
where
       26928  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       26929  +
    B: 'static,
       26930  +
       26931  +
    B::Data: Send,
       26932  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       26933  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       26934  +
{
       26935  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       26936  +
    type Future = JsonUnionsInputFuture;
       26937  +
       26938  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       26939  +
        let fut = async move {
       26940  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       26941  +
                request.headers(),
       26942  +
                &CONTENT_TYPE_JSONUNIONS,
       26943  +
            ) {
       26944  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       26945  +
            }
       26946  +
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request)
       26947  +
                .await
       26948  +
                .map_err(Into::into)
       26949  +
        };
       26950  +
        use ::futures_util::future::TryFutureExt;
       26951  +
        let fut = fut.map_err(
       26952  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       26953  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       26954  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       26955  +
                    e,
       26956  +
                )
       26957  +
            },
       26958  +
        );
       26959  +
        JsonUnionsInputFuture {
       26960  +
            inner: Box::pin(fut),
       26961  +
        }
       26962  +
    }
       26963  +
}
       26964  +
impl
       26965  +
    ::aws_smithy_http_server::response::IntoResponse<
       26966  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26967  +
    > for crate::output::JsonUnionsOutput
       26968  +
{
       26969  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26970  +
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_response(self) {
       26971  +
            Ok(response) => response,
       26972  +
            Err(e) => {
       26973  +
                ::tracing::error!(error = %e, "failed to serialize response");
       26974  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26975  +
            }
       26976  +
        }
       26977  +
    }
       26978  +
}
       26979  +
impl
       26980  +
    ::aws_smithy_http_server::response::IntoResponse<
       26981  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       26982  +
    > for crate::error::JsonUnionsError
       26983  +
{
       26984  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       26985  +
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_error(&self) {
       26986  +
            Ok(mut response) => {
       26987  +
                response.extensions_mut().insert(
       26988  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       26989  +
                );
       26990  +
                response
       26991  +
            }
       26992  +
            Err(e) => {
       26993  +
                ::tracing::error!(error = %e, "failed to serialize response");
       26994  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       26995  +
            }
       26996  +
        }
       26997  +
    }
       26998  +
}
       26999  +
       27000  +
#[allow(unreachable_code, unused_variables)]
       27001  +
#[cfg(test)]
       27002  +
mod json_unions_test {
       27003  +
       27004  +
    /// Serializes a string union value
       27005  +
    /// Test ID: RestJsonSerializeStringUnionValue
27308  27006   
    #[::tokio::test]
27309         -
    async fn rest_json_path_timestamp_epoch_rejects_http_date_case1_malformed_request() {
27310         -
        {
       27007  +
    #[::tracing_test::traced_test]
       27008  +
    async fn rest_json_serialize_string_union_value_request() {
27311  27009   
        #[allow(unused_mut)]
27312  27010   
        let mut http_request = http::Request::builder()
27313         -
                            .uri("/MalformedTimestampPathEpoch/Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT")
27314         -
                            .method("POST")
27315         -
            .body(::aws_smithy_http_server::body::Body::empty()).unwrap();
       27011  +
            .uri("/JsonUnions")
       27012  +
            .method("PUT")
       27013  +
            .header("Content-Type", "application/json")
       27014  +
            .body(::aws_smithy_http_server::body::Body::from(
       27015  +
                ::bytes::Bytes::from_static(
       27016  +
                    "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}".as_bytes(),
       27017  +
                ),
       27018  +
            ))
       27019  +
            .unwrap();
27316  27020   
        #[allow(unused_mut)]
27317  27021   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27318  27022   
        let config = crate::service::RestJsonConfig::builder().build();
27319  27023   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27320         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27024  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27321  27025   
                let sender = sender.clone();
27322  27026   
                async move {
27323         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27027  +
                    let result = {
       27028  +
                        let expected = crate::input::JsonUnionsInput {
       27029  +
                            contents: ::std::option::Option::Some(
       27030  +
                                crate::model::MyUnion::StringValue("foo".to_owned()),
       27031  +
                            ),
       27032  +
                        };
       27033  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27034  +
                        let response = crate::output::JsonUnionsOutput {
       27035  +
                            contents: ::std::option::Option::None,
       27036  +
                        };
       27037  +
                        Ok(response)
       27038  +
                    };
27324  27039   
                    sender.send(()).await.expect("receiver dropped early");
27325  27040   
                    result
27326  27041   
                }
27327  27042   
            })
27328  27043   
            .build_unchecked();
27329  27044   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27330  27045   
            .await
27331  27046   
            .expect("unable to make an HTTP request");
27332         -
            ::pretty_assertions::assert_eq!(
27333         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27334         -
                http_response.status()
       27047  +
        assert!(
       27048  +
            receiver.recv().await.is_some(),
       27049  +
            "we expected operation handler to be invoked but it was not entered"
27335  27050   
        );
27336         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27337         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27338         -
                http_response.headers(),
27339         -
                expected_headers,
27340         -
            ));
27341         -
        }
27342  27051   
    }
27343         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27344         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case0
       27052  +
    /// Serializes a boolean union value
       27053  +
    /// Test ID: RestJsonSerializeBooleanUnionValue
27345  27054   
    #[::tokio::test]
27346         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
27347         -
        {
       27055  +
    #[::tracing_test::traced_test]
       27056  +
    async fn rest_json_serialize_boolean_union_value_request() {
27348  27057   
        #[allow(unused_mut)]
27349  27058   
        let mut http_request = http::Request::builder()
27350         -
                .uri("/MalformedTimestampPathEpoch/true")
27351         -
                .method("POST")
27352         -
                .body(::aws_smithy_http_server::body::Body::empty())
       27059  +
            .uri("/JsonUnions")
       27060  +
            .method("PUT")
       27061  +
            .header("Content-Type", "application/json")
       27062  +
            .body(::aws_smithy_http_server::body::Body::from(
       27063  +
                ::bytes::Bytes::from_static(
       27064  +
                    "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}".as_bytes(),
       27065  +
                ),
       27066  +
            ))
27353  27067   
            .unwrap();
27354  27068   
        #[allow(unused_mut)]
27355  27069   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27356  27070   
        let config = crate::service::RestJsonConfig::builder().build();
27357  27071   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27358         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27072  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27359  27073   
                let sender = sender.clone();
27360  27074   
                async move {
27361         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27075  +
                    let result = {
       27076  +
                        let expected = crate::input::JsonUnionsInput {
       27077  +
                            contents: ::std::option::Option::Some(
       27078  +
                                crate::model::MyUnion::BooleanValue(true),
       27079  +
                            ),
       27080  +
                        };
       27081  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27082  +
                        let response = crate::output::JsonUnionsOutput {
       27083  +
                            contents: ::std::option::Option::None,
       27084  +
                        };
       27085  +
                        Ok(response)
       27086  +
                    };
27362  27087   
                    sender.send(()).await.expect("receiver dropped early");
27363  27088   
                    result
27364  27089   
                }
27365  27090   
            })
27366  27091   
            .build_unchecked();
27367  27092   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27368  27093   
            .await
27369  27094   
            .expect("unable to make an HTTP request");
27370         -
            ::pretty_assertions::assert_eq!(
27371         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27372         -
                http_response.status()
       27095  +
        assert!(
       27096  +
            receiver.recv().await.is_some(),
       27097  +
            "we expected operation handler to be invoked but it was not entered"
27373  27098   
        );
27374         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27375         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27376         -
                http_response.headers(),
27377         -
                expected_headers,
27378         -
            ));
27379  27099   
    }
27380         -
    }
27381         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27382         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case1
       27100  +
    /// Serializes a number union value
       27101  +
    /// Test ID: RestJsonSerializeNumberUnionValue
27383  27102   
    #[::tokio::test]
27384         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
27385         -
        {
       27103  +
    #[::tracing_test::traced_test]
       27104  +
    async fn rest_json_serialize_number_union_value_request() {
27386  27105   
        #[allow(unused_mut)]
27387  27106   
        let mut http_request = http::Request::builder()
27388         -
                .uri("/MalformedTimestampPathEpoch/1515531081ABC")
27389         -
                .method("POST")
27390         -
                .body(::aws_smithy_http_server::body::Body::empty())
       27107  +
            .uri("/JsonUnions")
       27108  +
            .method("PUT")
       27109  +
            .header("Content-Type", "application/json")
       27110  +
            .body(::aws_smithy_http_server::body::Body::from(
       27111  +
                ::bytes::Bytes::from_static(
       27112  +
                    "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}".as_bytes(),
       27113  +
                ),
       27114  +
            ))
27391  27115   
            .unwrap();
27392  27116   
        #[allow(unused_mut)]
27393  27117   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27394  27118   
        let config = crate::service::RestJsonConfig::builder().build();
27395  27119   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27396         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27120  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27397  27121   
                let sender = sender.clone();
27398  27122   
                async move {
27399         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27123  +
                    let result = {
       27124  +
                        let expected = crate::input::JsonUnionsInput {
       27125  +
                            contents: ::std::option::Option::Some(
       27126  +
                                crate::model::MyUnion::NumberValue(1),
       27127  +
                            ),
       27128  +
                        };
       27129  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27130  +
                        let response = crate::output::JsonUnionsOutput {
       27131  +
                            contents: ::std::option::Option::None,
       27132  +
                        };
       27133  +
                        Ok(response)
       27134  +
                    };
27400  27135   
                    sender.send(()).await.expect("receiver dropped early");
27401  27136   
                    result
27402  27137   
                }
27403  27138   
            })
27404  27139   
            .build_unchecked();
27405  27140   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27406  27141   
            .await
27407  27142   
            .expect("unable to make an HTTP request");
27408         -
            ::pretty_assertions::assert_eq!(
27409         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27410         -
                http_response.status()
       27143  +
        assert!(
       27144  +
            receiver.recv().await.is_some(),
       27145  +
            "we expected operation handler to be invoked but it was not entered"
27411  27146   
        );
27412         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27413         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27414         -
                http_response.headers(),
27415         -
                expected_headers,
27416         -
            ));
27417         -
        }
27418  27147   
    }
27419         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27420         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case2
       27148  +
    /// Serializes a blob union value
       27149  +
    /// Test ID: RestJsonSerializeBlobUnionValue
27421  27150   
    #[::tokio::test]
27422         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
27423         -
        {
       27151  +
    #[::tracing_test::traced_test]
       27152  +
    async fn rest_json_serialize_blob_union_value_request() {
27424  27153   
        #[allow(unused_mut)]
27425  27154   
        let mut http_request = http::Request::builder()
27426         -
                .uri("/MalformedTimestampPathEpoch/0x42")
27427         -
                .method("POST")
27428         -
                .body(::aws_smithy_http_server::body::Body::empty())
       27155  +
            .uri("/JsonUnions")
       27156  +
            .method("PUT")
       27157  +
            .header("Content-Type", "application/json")
       27158  +
            .body(::aws_smithy_http_server::body::Body::from(
       27159  +
                ::bytes::Bytes::from_static(
       27160  +
                    "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}".as_bytes(),
       27161  +
                ),
       27162  +
            ))
27429  27163   
            .unwrap();
27430  27164   
        #[allow(unused_mut)]
27431  27165   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27432  27166   
        let config = crate::service::RestJsonConfig::builder().build();
27433  27167   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27434         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27168  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27435  27169   
                let sender = sender.clone();
27436  27170   
                async move {
27437         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27171  +
                    let result = {
       27172  +
                        let expected = crate::input::JsonUnionsInput {
       27173  +
                            contents: ::std::option::Option::Some(
       27174  +
                                crate::model::MyUnion::BlobValue(::aws_smithy_types::Blob::new(
       27175  +
                                    "foo",
       27176  +
                                )),
       27177  +
                            ),
       27178  +
                        };
       27179  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27180  +
                        let response = crate::output::JsonUnionsOutput {
       27181  +
                            contents: ::std::option::Option::None,
       27182  +
                        };
       27183  +
                        Ok(response)
       27184  +
                    };
27438  27185   
                    sender.send(()).await.expect("receiver dropped early");
27439  27186   
                    result
27440  27187   
                }
27441  27188   
            })
27442  27189   
            .build_unchecked();
27443  27190   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27444  27191   
            .await
27445  27192   
            .expect("unable to make an HTTP request");
27446         -
            ::pretty_assertions::assert_eq!(
27447         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27448         -
                http_response.status()
       27193  +
        assert!(
       27194  +
            receiver.recv().await.is_some(),
       27195  +
            "we expected operation handler to be invoked but it was not entered"
27449  27196   
        );
27450         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27451         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27452         -
                http_response.headers(),
27453         -
                expected_headers,
27454         -
            ));
27455  27197   
    }
27456         -
    }
27457         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27458         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case3
       27198  +
    /// Serializes a timestamp union value
       27199  +
    /// Test ID: RestJsonSerializeTimestampUnionValue
27459  27200   
    #[::tokio::test]
27460         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
27461         -
        {
       27201  +
    #[::tracing_test::traced_test]
       27202  +
    async fn rest_json_serialize_timestamp_union_value_request() {
27462  27203   
        #[allow(unused_mut)]
27463  27204   
        let mut http_request = http::Request::builder()
27464         -
                .uri("/MalformedTimestampPathEpoch/1515531081.123.456")
27465         -
                .method("POST")
27466         -
                .body(::aws_smithy_http_server::body::Body::empty())
       27205  +
            .uri("/JsonUnions")
       27206  +
            .method("PUT")
       27207  +
            .header("Content-Type", "application/json")
       27208  +
            .body(::aws_smithy_http_server::body::Body::from(
       27209  +
                ::bytes::Bytes::from_static(
       27210  +
                    "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}"
       27211  +
                        .as_bytes(),
       27212  +
                ),
       27213  +
            ))
27467  27214   
            .unwrap();
27468  27215   
        #[allow(unused_mut)]
27469  27216   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27470  27217   
        let config = crate::service::RestJsonConfig::builder().build();
27471  27218   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27472         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27219  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27473  27220   
                let sender = sender.clone();
27474  27221   
                async move {
27475         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27222  +
                    let result = {
       27223  +
                        let expected = crate::input::JsonUnionsInput {
       27224  +
                            contents: ::std::option::Option::Some(
       27225  +
                                crate::model::MyUnion::TimestampValue(
       27226  +
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
       27227  +
                                        1398796238, 0_f64,
       27228  +
                                    ),
       27229  +
                                ),
       27230  +
                            ),
       27231  +
                        };
       27232  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27233  +
                        let response = crate::output::JsonUnionsOutput {
       27234  +
                            contents: ::std::option::Option::None,
       27235  +
                        };
       27236  +
                        Ok(response)
       27237  +
                    };
27476  27238   
                    sender.send(()).await.expect("receiver dropped early");
27477  27239   
                    result
27478  27240   
                }
27479  27241   
            })
27480  27242   
            .build_unchecked();
27481  27243   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27482  27244   
            .await
27483  27245   
            .expect("unable to make an HTTP request");
27484         -
            ::pretty_assertions::assert_eq!(
27485         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27486         -
                http_response.status()
       27246  +
        assert!(
       27247  +
            receiver.recv().await.is_some(),
       27248  +
            "we expected operation handler to be invoked but it was not entered"
27487  27249   
        );
27488         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27489         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27490         -
                http_response.headers(),
27491         -
                expected_headers,
27492         -
            ));
27493  27250   
    }
27494         -
    }
27495         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27496         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case4
       27251  +
    /// Serializes an enum union value
       27252  +
    /// Test ID: RestJsonSerializeEnumUnionValue
27497  27253   
    #[::tokio::test]
27498         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
27499         -
        {
       27254  +
    #[::tracing_test::traced_test]
       27255  +
    async fn rest_json_serialize_enum_union_value_request() {
27500  27256   
        #[allow(unused_mut)]
27501  27257   
        let mut http_request = http::Request::builder()
27502         -
                .uri("/MalformedTimestampPathEpoch/Infinity")
27503         -
                .method("POST")
27504         -
                .body(::aws_smithy_http_server::body::Body::empty())
       27258  +
            .uri("/JsonUnions")
       27259  +
            .method("PUT")
       27260  +
            .header("Content-Type", "application/json")
       27261  +
            .body(::aws_smithy_http_server::body::Body::from(
       27262  +
                ::bytes::Bytes::from_static(
       27263  +
                    "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}".as_bytes(),
       27264  +
                ),
       27265  +
            ))
27505  27266   
            .unwrap();
27506  27267   
        #[allow(unused_mut)]
27507  27268   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27508  27269   
        let config = crate::service::RestJsonConfig::builder().build();
27509  27270   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27510         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27271  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27511  27272   
                let sender = sender.clone();
27512  27273   
                async move {
27513         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27274  +
                    let result = {
       27275  +
                        let expected = crate::input::JsonUnionsInput {
       27276  +
                            contents: ::std::option::Option::Some(
       27277  +
                                crate::model::MyUnion::EnumValue(
       27278  +
                                    "Foo"
       27279  +
                                        .parse::<crate::model::FooEnum>()
       27280  +
                                        .expect("static value validated to member"),
       27281  +
                                ),
       27282  +
                            ),
       27283  +
                        };
       27284  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27285  +
                        let response = crate::output::JsonUnionsOutput {
       27286  +
                            contents: ::std::option::Option::None,
       27287  +
                        };
       27288  +
                        Ok(response)
       27289  +
                    };
27514  27290   
                    sender.send(()).await.expect("receiver dropped early");
27515  27291   
                    result
27516  27292   
                }
27517  27293   
            })
27518  27294   
            .build_unchecked();
27519  27295   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27520  27296   
            .await
27521  27297   
            .expect("unable to make an HTTP request");
27522         -
            ::pretty_assertions::assert_eq!(
27523         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27524         -
                http_response.status()
       27298  +
        assert!(
       27299  +
            receiver.recv().await.is_some(),
       27300  +
            "we expected operation handler to be invoked but it was not entered"
27525  27301   
        );
27526         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27527         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27528         -
                http_response.headers(),
27529         -
                expected_headers,
27530         -
            ));
27531         -
        }
27532  27302   
    }
27533         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27534         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case5
       27303  +
    /// Serializes a list union value
       27304  +
    /// Test ID: RestJsonSerializeListUnionValue
27535  27305   
    #[::tokio::test]
27536         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
27537         -
        {
       27306  +
    #[::tracing_test::traced_test]
       27307  +
    async fn rest_json_serialize_list_union_value_request() {
27538  27308   
        #[allow(unused_mut)]
27539  27309   
        let mut http_request = http::Request::builder()
27540         -
                .uri("/MalformedTimestampPathEpoch/-Infinity")
27541         -
                .method("POST")
27542         -
                .body(::aws_smithy_http_server::body::Body::empty())
       27310  +
            .uri("/JsonUnions")
       27311  +
            .method("PUT")
       27312  +
            .header("Content-Type", "application/json")
       27313  +
            .body(::aws_smithy_http_server::body::Body::from(
       27314  +
                ::bytes::Bytes::from_static(
       27315  +
                    "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}"
       27316  +
                        .as_bytes(),
       27317  +
                ),
       27318  +
            ))
27543  27319   
            .unwrap();
27544  27320   
        #[allow(unused_mut)]
27545  27321   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27546  27322   
        let config = crate::service::RestJsonConfig::builder().build();
27547  27323   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27548         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27324  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27549  27325   
                let sender = sender.clone();
27550  27326   
                async move {
27551         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27327  +
                    let result = {
       27328  +
                        let expected = crate::input::JsonUnionsInput {
       27329  +
                            contents: ::std::option::Option::Some(
       27330  +
                                crate::model::MyUnion::ListValue(vec![
       27331  +
                                    "foo".to_owned(),
       27332  +
                                    "bar".to_owned(),
       27333  +
                                ]),
       27334  +
                            ),
       27335  +
                        };
       27336  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27337  +
                        let response = crate::output::JsonUnionsOutput {
       27338  +
                            contents: ::std::option::Option::None,
       27339  +
                        };
       27340  +
                        Ok(response)
       27341  +
                    };
27552  27342   
                    sender.send(()).await.expect("receiver dropped early");
27553  27343   
                    result
27554  27344   
                }
27555  27345   
            })
27556  27346   
            .build_unchecked();
27557  27347   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27558  27348   
            .await
27559  27349   
            .expect("unable to make an HTTP request");
27560         -
            ::pretty_assertions::assert_eq!(
27561         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27562         -
                http_response.status()
       27350  +
        assert!(
       27351  +
            receiver.recv().await.is_some(),
       27352  +
            "we expected operation handler to be invoked but it was not entered"
27563  27353   
        );
27564         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27565         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27566         -
                http_response.headers(),
27567         -
                expected_headers,
27568         -
            ));
27569  27354   
    }
27570         -
    }
27571         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
27572         -
    /// Test ID: RestJsonPathTimestampEpochRejectsMalformedValues_case6
       27355  +
    /// Serializes a map union value
       27356  +
    /// Test ID: RestJsonSerializeMapUnionValue
27573  27357   
    #[::tokio::test]
27574         -
    async fn rest_json_path_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
27575         -
        {
       27358  +
    #[::tracing_test::traced_test]
       27359  +
    async fn rest_json_serialize_map_union_value_request() {
27576  27360   
        #[allow(unused_mut)]
27577  27361   
                    let mut http_request = http::Request::builder()
27578         -
                .uri("/MalformedTimestampPathEpoch/NaN")
27579         -
                .method("POST")
27580         -
                .body(::aws_smithy_http_server::body::Body::empty())
27581         -
                .unwrap();
       27362  +
                        .uri("/JsonUnions")
       27363  +
                        .method("PUT")
       27364  +
        .header("Content-Type", "application/json")
       27365  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}".as_bytes()))).unwrap();
27582  27366   
        #[allow(unused_mut)]
27583  27367   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27584  27368   
        let config = crate::service::RestJsonConfig::builder().build();
27585  27369   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27586         -
                            .malformed_timestamp_path_epoch(move |input: crate::input::MalformedTimestampPathEpochInput| {
       27370  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27587  27371   
                let sender = sender.clone();
27588  27372   
                async move {
27589         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathEpochOutput, crate::error::MalformedTimestampPathEpochError> };
       27373  +
                    let result = {
       27374  +
                        let expected = crate::input::JsonUnionsInput {
       27375  +
                            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue(
       27376  +
                                {
       27377  +
                                    let mut ret = ::std::collections::HashMap::new();
       27378  +
                                    ret.insert("foo".to_owned(), "bar".to_owned());
       27379  +
                                    ret.insert("spam".to_owned(), "eggs".to_owned());
       27380  +
                                    ret
       27381  +
                                },
       27382  +
                            )),
       27383  +
                        };
       27384  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27385  +
                        let response = crate::output::JsonUnionsOutput {
       27386  +
                            contents: ::std::option::Option::None,
       27387  +
                        };
       27388  +
                        Ok(response)
       27389  +
                    };
27590  27390   
                    sender.send(()).await.expect("receiver dropped early");
27591  27391   
                    result
27592  27392   
                }
27593  27393   
            })
27594  27394   
            .build_unchecked();
27595  27395   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27596  27396   
            .await
27597  27397   
            .expect("unable to make an HTTP request");
27598         -
            ::pretty_assertions::assert_eq!(
27599         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27600         -
                http_response.status()
       27398  +
        assert!(
       27399  +
            receiver.recv().await.is_some(),
       27400  +
            "we expected operation handler to be invoked but it was not entered"
27601  27401   
        );
27602         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27603         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27604         -
                http_response.headers(),
27605         -
                expected_headers,
27606         -
            ));
27607         -
        }
27608  27402   
    }
27609         -
}
27610         -
#[cfg(test)]
27611         -
#[allow(unreachable_code, unused_variables)]
27612         -
mod server_malformed_timestamp_path_http_date_test {
27613         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
27614         -
    /// 400 SerializationException
27615         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case0
       27403  +
    /// Serializes a structure union value
       27404  +
    /// Test ID: RestJsonSerializeStructureUnionValue
27616  27405   
    #[::tokio::test]
27617         -
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case0_malformed_request() {
27618         -
        {
       27406  +
    #[::tracing_test::traced_test]
       27407  +
    async fn rest_json_serialize_structure_union_value_request() {
27619  27408   
        #[allow(unused_mut)]
27620  27409   
                    let mut http_request = http::Request::builder()
27621         -
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50.52Z")
27622         -
                .method("POST")
27623         -
                .body(::aws_smithy_http_server::body::Body::empty())
27624         -
                .unwrap();
       27410  +
                        .uri("/JsonUnions")
       27411  +
                        .method("PUT")
       27412  +
        .header("Content-Type", "application/json")
       27413  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"contents\": {\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}".as_bytes()))).unwrap();
27625  27414   
        #[allow(unused_mut)]
27626  27415   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27627  27416   
        let config = crate::service::RestJsonConfig::builder().build();
27628  27417   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27629         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
       27418  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27630  27419   
                let sender = sender.clone();
27631  27420   
                async move {
27632         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
       27421  +
                    let result = {
       27422  +
                        let expected = crate::input::JsonUnionsInput {
       27423  +
                            contents: ::std::option::Option::Some(
       27424  +
                                crate::model::MyUnion::StructureValue(
       27425  +
                                    crate::model::GreetingStruct {
       27426  +
                                        hi: ::std::option::Option::Some("hello".to_owned()),
       27427  +
                                    },
       27428  +
                                ),
       27429  +
                            ),
       27430  +
                        };
       27431  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27432  +
                        let response = crate::output::JsonUnionsOutput {
       27433  +
                            contents: ::std::option::Option::None,
       27434  +
                        };
       27435  +
                        Ok(response)
       27436  +
                    };
27633  27437   
                    sender.send(()).await.expect("receiver dropped early");
27634  27438   
                    result
27635  27439   
                }
27636  27440   
            })
27637  27441   
            .build_unchecked();
27638  27442   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27639  27443   
            .await
27640  27444   
            .expect("unable to make an HTTP request");
27641         -
            ::pretty_assertions::assert_eq!(
27642         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
27643         -
                http_response.status()
       27445  +
        assert!(
       27446  +
            receiver.recv().await.is_some(),
       27447  +
            "we expected operation handler to be invoked but it was not entered"
27644  27448   
        );
27645         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
27646         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27647         -
                http_response.headers(),
27648         -
                expected_headers,
27649         -
            ));
27650         -
        }
27651  27449   
    }
27652         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
27653         -
    /// 400 SerializationException
27654         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case1
       27450  +
    /// Serializes a renamed structure union value
       27451  +
    /// Test ID: RestJsonSerializeRenamedStructureUnionValue
27655  27452   
    #[::tokio::test]
27656         -
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case1_malformed_request() {
27657         -
        {
       27453  +
    #[::tracing_test::traced_test]
       27454  +
    async fn rest_json_serialize_renamed_structure_union_value_request() {
27658  27455   
        #[allow(unused_mut)]
27659  27456   
                    let mut http_request = http::Request::builder()
27660         -
                .uri("/MalformedTimestampPathHttpDate/1985-04-12T23%3A20%3A50Z")
27661         -
                .method("POST")
27662         -
                .body(::aws_smithy_http_server::body::Body::empty())
27663         -
                .unwrap();
       27457  +
                        .uri("/JsonUnions")
       27458  +
                        .method("PUT")
       27459  +
        .header("Content-Type", "application/json")
       27460  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"contents\": {\n        \"renamedStructureValue\": {\n            \"salutation\": \"hello!\"\n        }\n    }\n}".as_bytes()))).unwrap();
27664  27461   
        #[allow(unused_mut)]
27665  27462   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27666  27463   
        let config = crate::service::RestJsonConfig::builder().build();
27667  27464   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27668         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
       27465  +
            .json_unions(move |input: crate::input::JsonUnionsInput| {
27669  27466   
                let sender = sender.clone();
27670  27467   
                async move {
27671         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
       27468  +
                    let result = {
       27469  +
                        let expected = crate::input::JsonUnionsInput {
       27470  +
                            contents: ::std::option::Option::Some(
       27471  +
                                crate::model::MyUnion::RenamedStructureValue(
       27472  +
                                    crate::model::RenamedGreeting {
       27473  +
                                        salutation: ::std::option::Option::Some(
       27474  +
                                            "hello!".to_owned(),
       27475  +
                                        ),
       27476  +
                                    },
       27477  +
                                ),
       27478  +
                            ),
       27479  +
                        };
       27480  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27481  +
                        let response = crate::output::JsonUnionsOutput {
       27482  +
                            contents: ::std::option::Option::None,
       27483  +
                        };
       27484  +
                        Ok(response)
       27485  +
                    };
27672  27486   
                    sender.send(()).await.expect("receiver dropped early");
27673  27487   
                    result
27674  27488   
                }
27675  27489   
            })
27676  27490   
            .build_unchecked();
27677  27491   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27678  27492   
            .await
27679  27493   
            .expect("unable to make an HTTP request");
       27494  +
        assert!(
       27495  +
            receiver.recv().await.is_some(),
       27496  +
            "we expected operation handler to be invoked but it was not entered"
       27497  +
        );
       27498  +
    }
       27499  +
    /// Deserializes a string union value
       27500  +
    /// Test ID: RestJsonDeserializeStringUnionValue
       27501  +
    #[::tokio::test]
       27502  +
    #[::tracing_test::traced_test]
       27503  +
    async fn rest_json_deserialize_string_union_value_response() {
       27504  +
        let output = crate::output::JsonUnionsOutput {
       27505  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::StringValue(
       27506  +
                "foo".to_owned(),
       27507  +
            )),
       27508  +
        };
       27509  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27510  +
        let http_response = output.into_response();
27680  27511   
        ::pretty_assertions::assert_eq!(
27681         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27512  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27682  27513   
            http_response.status()
27683  27514   
        );
27684         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27515  +
        let expected_headers = [("Content-Type", "application/json")];
27685  27516   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27686  27517   
            http_response.headers(),
27687  27518   
            expected_headers,
27688  27519   
        ));
       27520  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27521  +
            .await
       27522  +
            .expect("unable to extract body to bytes");
       27523  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       27524  +
            &body,
       27525  +
            "{\n    \"contents\": {\n        \"stringValue\": \"foo\"\n    }\n}",
       27526  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       27527  +
        ));
27689  27528   
    }
27690         -
    }
27691         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
27692         -
    /// 400 SerializationException
27693         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsDateTime_case2
       27529  +
    /// Deserializes a boolean union value
       27530  +
    /// Test ID: RestJsonDeserializeBooleanUnionValue
27694  27531   
    #[::tokio::test]
27695         -
    async fn rest_json_path_timestamp_http_date_rejects_date_time_case2_malformed_request() {
27696         -
        {
27697         -
            #[allow(unused_mut)]
27698         -
            let mut http_request = http::Request::builder()
27699         -
                .uri("/MalformedTimestampPathHttpDate/1996-12-19T16%3A39%3A57-08%3A00")
27700         -
                .method("POST")
27701         -
                .body(::aws_smithy_http_server::body::Body::empty())
27702         -
                .unwrap();
27703         -
            #[allow(unused_mut)]
27704         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27705         -
            let config = crate::service::RestJsonConfig::builder().build();
27706         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27707         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
27708         -
                                let sender = sender.clone();
27709         -
                                async move {
27710         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
27711         -
                                    sender.send(()).await.expect("receiver dropped early");
27712         -
                                    result
27713         -
                                }
27714         -
                            })
27715         -
                            .build_unchecked();
27716         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27717         -
                .await
27718         -
                .expect("unable to make an HTTP request");
       27532  +
    #[::tracing_test::traced_test]
       27533  +
    async fn rest_json_deserialize_boolean_union_value_response() {
       27534  +
        let output = crate::output::JsonUnionsOutput {
       27535  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::BooleanValue(true)),
       27536  +
        };
       27537  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27538  +
        let http_response = output.into_response();
27719  27539   
        ::pretty_assertions::assert_eq!(
27720         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27540  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27721  27541   
            http_response.status()
27722  27542   
        );
27723         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27543  +
        let expected_headers = [("Content-Type", "application/json")];
27724  27544   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27725  27545   
            http_response.headers(),
27726  27546   
            expected_headers,
27727  27547   
        ));
       27548  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27549  +
            .await
       27550  +
            .expect("unable to extract body to bytes");
       27551  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       27552  +
            &body,
       27553  +
            "{\n    \"contents\": {\n        \"booleanValue\": true\n    }\n}",
       27554  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       27555  +
        ));
27728  27556   
    }
27729         -
    }
27730         -
    /// When the format is http-date,  epoch second timestamps are rejected with a
27731         -
    /// 400 SerializationException
27732         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case0
       27557  +
    /// Deserializes a number union value
       27558  +
    /// Test ID: RestJsonDeserializeNumberUnionValue
27733  27559   
    #[::tokio::test]
27734         -
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
27735         -
        {
27736         -
            #[allow(unused_mut)]
27737         -
            let mut http_request = http::Request::builder()
27738         -
                .uri("/MalformedTimestampPathHttpDate/1515531081.1234")
27739         -
                .method("POST")
27740         -
                .body(::aws_smithy_http_server::body::Body::empty())
27741         -
                .unwrap();
27742         -
            #[allow(unused_mut)]
27743         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27744         -
            let config = crate::service::RestJsonConfig::builder().build();
27745         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27746         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
27747         -
                                let sender = sender.clone();
27748         -
                                async move {
27749         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
27750         -
                                    sender.send(()).await.expect("receiver dropped early");
27751         -
                                    result
27752         -
                                }
27753         -
                            })
27754         -
                            .build_unchecked();
27755         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27756         -
                .await
27757         -
                .expect("unable to make an HTTP request");
       27560  +
    #[::tracing_test::traced_test]
       27561  +
    async fn rest_json_deserialize_number_union_value_response() {
       27562  +
        let output = crate::output::JsonUnionsOutput {
       27563  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::NumberValue(1)),
       27564  +
        };
       27565  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27566  +
        let http_response = output.into_response();
27758  27567   
        ::pretty_assertions::assert_eq!(
27759         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27568  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27760  27569   
            http_response.status()
27761  27570   
        );
27762         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27571  +
        let expected_headers = [("Content-Type", "application/json")];
27763  27572   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27764  27573   
            http_response.headers(),
27765  27574   
            expected_headers,
27766  27575   
        ));
       27576  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27577  +
            .await
       27578  +
            .expect("unable to extract body to bytes");
       27579  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       27580  +
            &body,
       27581  +
            "{\n    \"contents\": {\n        \"numberValue\": 1\n    }\n}",
       27582  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       27583  +
        ));
27767  27584   
    }
27768         -
    }
27769         -
    /// When the format is http-date,  epoch second timestamps are rejected with a
27770         -
    /// 400 SerializationException
27771         -
    /// Test ID: RestJsonPathTimestampHttpDateRejectsEpochSeconds_case1
       27585  +
    /// Deserializes a blob union value
       27586  +
    /// Test ID: RestJsonDeserializeBlobUnionValue
27772  27587   
    #[::tokio::test]
27773         -
    async fn rest_json_path_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
27774         -
        {
27775         -
            #[allow(unused_mut)]
27776         -
            let mut http_request = http::Request::builder()
27777         -
                .uri("/MalformedTimestampPathHttpDate/1515531081")
27778         -
                .method("POST")
27779         -
                .body(::aws_smithy_http_server::body::Body::empty())
27780         -
                .unwrap();
27781         -
            #[allow(unused_mut)]
27782         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27783         -
            let config = crate::service::RestJsonConfig::builder().build();
27784         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27785         -
                            .malformed_timestamp_path_http_date(move |input: crate::input::MalformedTimestampPathHttpDateInput| {
27786         -
                                let sender = sender.clone();
27787         -
                                async move {
27788         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampPathHttpDateOutput, crate::error::MalformedTimestampPathHttpDateError> };
27789         -
                                    sender.send(()).await.expect("receiver dropped early");
27790         -
                                    result
27791         -
                                }
27792         -
                            })
27793         -
                            .build_unchecked();
27794         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27795         -
                .await
27796         -
                .expect("unable to make an HTTP request");
       27588  +
    #[::tracing_test::traced_test]
       27589  +
    async fn rest_json_deserialize_blob_union_value_response() {
       27590  +
        let output = crate::output::JsonUnionsOutput {
       27591  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::BlobValue(
       27592  +
                ::aws_smithy_types::Blob::new("foo"),
       27593  +
            )),
       27594  +
        };
       27595  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27596  +
        let http_response = output.into_response();
27797  27597   
        ::pretty_assertions::assert_eq!(
27798         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27598  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27799  27599   
            http_response.status()
27800  27600   
        );
27801         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27601  +
        let expected_headers = [("Content-Type", "application/json")];
27802  27602   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27803  27603   
            http_response.headers(),
27804  27604   
            expected_headers,
27805  27605   
        ));
       27606  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27607  +
            .await
       27608  +
            .expect("unable to extract body to bytes");
       27609  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       27610  +
            &body,
       27611  +
            "{\n    \"contents\": {\n        \"blobValue\": \"Zm9v\"\n    }\n}",
       27612  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       27613  +
        ));
27806  27614   
    }
27807         -
    }
27808         -
}
27809         -
#[cfg(test)]
27810         -
#[allow(unreachable_code, unused_variables)]
27811         -
mod server_malformed_timestamp_query_default_test {
27812         -
    /// By default, IMF-fixdate timestamps are rejected with a
27813         -
    /// 400 SerializationException
27814         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsHttpDate_case0
       27615  +
    /// Deserializes a timestamp union value
       27616  +
    /// Test ID: RestJsonDeserializeTimestampUnionValue
27815  27617   
    #[::tokio::test]
27816         -
    async fn rest_json_query_timestamp_default_rejects_http_date_case0_malformed_request() {
27817         -
        {
27818         -
            #[allow(unused_mut)]
27819         -
            let mut http_request = http::Request::builder()
27820         -
                .uri("/MalformedTimestampQueryDefault")
27821         -
                .method("POST")
27822         -
                .body(::aws_smithy_http_server::body::Body::empty())
27823         -
                .unwrap();
27824         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
27825         -
            #[allow(unused_mut)]
27826         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27827         -
            let config = crate::service::RestJsonConfig::builder().build();
27828         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27829         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
27830         -
                                let sender = sender.clone();
27831         -
                                async move {
27832         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
27833         -
                                    sender.send(()).await.expect("receiver dropped early");
27834         -
                                    result
27835         -
                                }
27836         -
                            })
27837         -
                            .build_unchecked();
27838         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27839         -
                .await
27840         -
                .expect("unable to make an HTTP request");
       27618  +
    #[::tracing_test::traced_test]
       27619  +
    async fn rest_json_deserialize_timestamp_union_value_response() {
       27620  +
        let output = crate::output::JsonUnionsOutput {
       27621  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::TimestampValue(
       27622  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       27623  +
            )),
       27624  +
        };
       27625  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27626  +
        let http_response = output.into_response();
27841  27627   
        ::pretty_assertions::assert_eq!(
27842         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27628  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27843  27629   
            http_response.status()
27844  27630   
        );
27845         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27631  +
        let expected_headers = [("Content-Type", "application/json")];
27846  27632   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27847  27633   
            http_response.headers(),
27848  27634   
            expected_headers,
27849  27635   
        ));
       27636  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27637  +
            .await
       27638  +
            .expect("unable to extract body to bytes");
       27639  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       27640  +
            &body,
       27641  +
            "{\n    \"contents\": {\n        \"timestampValue\": 1398796238\n    }\n}",
       27642  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       27643  +
        ));
27850  27644   
    }
27851         -
    }
27852         -
    /// By default, IMF-fixdate timestamps are rejected with a
27853         -
    /// 400 SerializationException
27854         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsHttpDate_case1
       27645  +
    /// Deserializes an enum union value
       27646  +
    /// Test ID: RestJsonDeserializeEnumUnionValue
27855  27647   
    #[::tokio::test]
27856         -
    async fn rest_json_query_timestamp_default_rejects_http_date_case1_malformed_request() {
27857         -
        {
27858         -
            #[allow(unused_mut)]
27859         -
            let mut http_request = http::Request::builder()
27860         -
                .uri("/MalformedTimestampQueryDefault")
27861         -
                .method("POST")
27862         -
                .body(::aws_smithy_http_server::body::Body::empty())
27863         -
                .unwrap();
27864         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
27865         -
            #[allow(unused_mut)]
27866         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27867         -
            let config = crate::service::RestJsonConfig::builder().build();
27868         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27869         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
27870         -
                                let sender = sender.clone();
27871         -
                                async move {
27872         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
27873         -
                                    sender.send(()).await.expect("receiver dropped early");
27874         -
                                    result
27875         -
                                }
27876         -
                            })
27877         -
                            .build_unchecked();
27878         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27879         -
                .await
27880         -
                .expect("unable to make an HTTP request");
       27648  +
    #[::tracing_test::traced_test]
       27649  +
    async fn rest_json_deserialize_enum_union_value_response() {
       27650  +
        let output = crate::output::JsonUnionsOutput {
       27651  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::EnumValue(
       27652  +
                "Foo"
       27653  +
                    .parse::<crate::model::FooEnum>()
       27654  +
                    .expect("static value validated to member"),
       27655  +
            )),
       27656  +
        };
       27657  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27658  +
        let http_response = output.into_response();
27881  27659   
        ::pretty_assertions::assert_eq!(
27882         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27660  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27883  27661   
            http_response.status()
27884  27662   
        );
27885         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27663  +
        let expected_headers = [("Content-Type", "application/json")];
27886  27664   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27887  27665   
            http_response.headers(),
27888  27666   
            expected_headers,
27889  27667   
        ));
       27668  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27669  +
            .await
       27670  +
            .expect("unable to extract body to bytes");
       27671  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       27672  +
            &body,
       27673  +
            "{\n    \"contents\": {\n        \"enumValue\": \"Foo\"\n    }\n}",
       27674  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       27675  +
        ));
27890  27676   
    }
27891         -
    }
27892         -
    /// By default, epoch second timestamps are rejected with a
27893         -
    /// 400 SerializationException
27894         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case0
       27677  +
    /// Deserializes a list union value
       27678  +
    /// Test ID: RestJsonDeserializeListUnionValue
27895  27679   
    #[::tokio::test]
27896         -
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case0_malformed_request() {
27897         -
        {
27898         -
            #[allow(unused_mut)]
27899         -
            let mut http_request = http::Request::builder()
27900         -
                .uri("/MalformedTimestampQueryDefault")
27901         -
                .method("POST")
27902         -
                .body(::aws_smithy_http_server::body::Body::empty())
27903         -
                .unwrap();
27904         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081.1234"
27905         -
                .parse()
27906         -
                .unwrap();
27907         -
            #[allow(unused_mut)]
27908         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27909         -
            let config = crate::service::RestJsonConfig::builder().build();
27910         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27911         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
27912         -
                                let sender = sender.clone();
27913         -
                                async move {
27914         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
27915         -
                                    sender.send(()).await.expect("receiver dropped early");
27916         -
                                    result
27917         -
                                }
27918         -
                            })
27919         -
                            .build_unchecked();
27920         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27921         -
                .await
27922         -
                .expect("unable to make an HTTP request");
       27680  +
    #[::tracing_test::traced_test]
       27681  +
    async fn rest_json_deserialize_list_union_value_response() {
       27682  +
        let output = crate::output::JsonUnionsOutput {
       27683  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::ListValue(vec![
       27684  +
                "foo".to_owned(),
       27685  +
                "bar".to_owned(),
       27686  +
            ])),
       27687  +
        };
       27688  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27689  +
        let http_response = output.into_response();
27923  27690   
        ::pretty_assertions::assert_eq!(
27924         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27691  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27925  27692   
            http_response.status()
27926  27693   
        );
27927         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27694  +
        let expected_headers = [("Content-Type", "application/json")];
27928  27695   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27929  27696   
            http_response.headers(),
27930  27697   
            expected_headers,
27931  27698   
        ));
       27699  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27700  +
            .await
       27701  +
            .expect("unable to extract body to bytes");
       27702  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       27703  +
            &body,
       27704  +
            "{\n    \"contents\": {\n        \"listValue\": [\"foo\", \"bar\"]\n    }\n}",
       27705  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       27706  +
        ));
27932  27707   
    }
27933         -
    }
27934         -
    /// By default, epoch second timestamps are rejected with a
27935         -
    /// 400 SerializationException
27936         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsEpochSeconds_case1
       27708  +
    /// Deserializes a map union value
       27709  +
    /// Test ID: RestJsonDeserializeMapUnionValue
27937  27710   
    #[::tokio::test]
27938         -
    async fn rest_json_query_timestamp_default_rejects_epoch_seconds_case1_malformed_request() {
27939         -
        {
27940         -
            #[allow(unused_mut)]
27941         -
            let mut http_request = http::Request::builder()
27942         -
                .uri("/MalformedTimestampQueryDefault")
27943         -
                .method("POST")
27944         -
                .body(::aws_smithy_http_server::body::Body::empty())
27945         -
                .unwrap();
27946         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1515531081"
27947         -
                .parse()
27948         -
                .unwrap();
27949         -
            #[allow(unused_mut)]
27950         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27951         -
            let config = crate::service::RestJsonConfig::builder().build();
27952         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27953         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
27954         -
                                let sender = sender.clone();
27955         -
                                async move {
27956         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
27957         -
                                    sender.send(()).await.expect("receiver dropped early");
27958         -
                                    result
27959         -
                                }
27960         -
                            })
27961         -
                            .build_unchecked();
27962         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
27963         -
                .await
27964         -
                .expect("unable to make an HTTP request");
       27711  +
    #[::tracing_test::traced_test]
       27712  +
    async fn rest_json_deserialize_map_union_value_response() {
       27713  +
        let output = crate::output::JsonUnionsOutput {
       27714  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::MapValue({
       27715  +
                let mut ret = ::std::collections::HashMap::new();
       27716  +
                ret.insert("foo".to_owned(), "bar".to_owned());
       27717  +
                ret.insert("spam".to_owned(), "eggs".to_owned());
       27718  +
                ret
       27719  +
            })),
       27720  +
        };
       27721  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27722  +
        let http_response = output.into_response();
27965  27723   
        ::pretty_assertions::assert_eq!(
27966         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27724  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
27967  27725   
            http_response.status()
27968  27726   
        );
27969         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27727  +
        let expected_headers = [("Content-Type", "application/json")];
27970  27728   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
27971  27729   
            http_response.headers(),
27972  27730   
            expected_headers,
27973  27731   
        ));
       27732  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27733  +
            .await
       27734  +
            .expect("unable to extract body to bytes");
       27735  +
        ::aws_smithy_protocol_test::assert_ok(
       27736  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"contents\": {\n        \"mapValue\": {\n            \"foo\": \"bar\",\n            \"spam\": \"eggs\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       27737  +
        );
27974  27738   
    }
27975         -
    }
27976         -
    /// UTC offsets must be rejected with a
27977         -
    /// 400 SerializationException
27978         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsUTCOffsets
       27739  +
    /// Deserializes a structure union value
       27740  +
    /// Test ID: RestJsonDeserializeStructureUnionValue
27979  27741   
    #[::tokio::test]
27980         -
    async fn rest_json_query_timestamp_default_rejects_utc_offsets_malformed_request() {
27981         -
        {
27982         -
            #[allow(unused_mut)]
27983         -
            let mut http_request = http::Request::builder()
27984         -
                .uri("/MalformedTimestampQueryDefault")
27985         -
                .method("POST")
27986         -
                .body(::aws_smithy_http_server::body::Body::empty())
27987         -
                .unwrap();
27988         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=$value:L"
27989         -
                .parse()
27990         -
                .unwrap();
27991         -
            #[allow(unused_mut)]
27992         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
27993         -
            let config = crate::service::RestJsonConfig::builder().build();
27994         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
27995         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
27996         -
                                let sender = sender.clone();
27997         -
                                async move {
27998         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
27999         -
                                    sender.send(()).await.expect("receiver dropped early");
28000         -
                                    result
28001         -
                                }
28002         -
                            })
28003         -
                            .build_unchecked();
28004         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28005         -
                .await
28006         -
                .expect("unable to make an HTTP request");
       27742  +
    #[::tracing_test::traced_test]
       27743  +
    async fn rest_json_deserialize_structure_union_value_response() {
       27744  +
        let output = crate::output::JsonUnionsOutput {
       27745  +
            contents: ::std::option::Option::Some(crate::model::MyUnion::StructureValue(
       27746  +
                crate::model::GreetingStruct {
       27747  +
                    hi: ::std::option::Option::Some("hello".to_owned()),
       27748  +
                },
       27749  +
            )),
       27750  +
        };
       27751  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27752  +
        let http_response = output.into_response();
28007  27753   
        ::pretty_assertions::assert_eq!(
28008         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27754  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28009  27755   
            http_response.status()
28010  27756   
        );
28011         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27757  +
        let expected_headers = [("Content-Type", "application/json")];
28012  27758   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28013  27759   
            http_response.headers(),
28014  27760   
            expected_headers,
28015  27761   
        ));
       27762  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27763  +
            .await
       27764  +
            .expect("unable to extract body to bytes");
       27765  +
        ::aws_smithy_protocol_test::assert_ok(
       27766  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"contents\": {\n        \"structureValue\": {\n            \"hi\": \"hello\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       27767  +
        );
28016  27768   
    }
       27769  +
}
       27770  +
       27771  +
const CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE: ::mime::Mime = ::mime::APPLICATION_JSON;
       27772  +
::pin_project_lite::pin_project! {
       27773  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       27774  +
    /// [`DocumentTypeAsMapValueInput`](crate::input::DocumentTypeAsMapValueInput) using modelled bindings.
       27775  +
    pub struct DocumentTypeAsMapValueInputFuture {
       27776  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DocumentTypeAsMapValueInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
28017  27777   
    }
28018         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28019         -
    /// are rejected with a 400 SerializationException
28020         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case0
28021         -
    #[::tokio::test]
28022         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case0_malformed_request(
28023         -
    ) {
28024         -
        {
28025         -
            #[allow(unused_mut)]
28026         -
            let mut http_request = http::Request::builder()
28027         -
                .uri("/MalformedTimestampQueryDefault")
28028         -
                .method("POST")
28029         -
                .body(::aws_smithy_http_server::body::Body::empty())
28030         -
                .unwrap();
28031         -
            *http_request.uri_mut() =
28032         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00"
28033         -
                    .parse()
28034         -
                    .unwrap();
28035         -
            #[allow(unused_mut)]
28036         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28037         -
            let config = crate::service::RestJsonConfig::builder().build();
28038         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28039         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
28040         -
                                let sender = sender.clone();
28041         -
                                async move {
28042         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
28043         -
                                    sender.send(()).await.expect("receiver dropped early");
28044         -
                                    result
       27778  +
}
       27779  +
       27780  +
impl std::future::Future for DocumentTypeAsMapValueInputFuture {
       27781  +
    type Output = Result<
       27782  +
        crate::input::DocumentTypeAsMapValueInput,
       27783  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       27784  +
    >;
       27785  +
       27786  +
    fn poll(
       27787  +
        self: std::pin::Pin<&mut Self>,
       27788  +
        cx: &mut std::task::Context<'_>,
       27789  +
    ) -> std::task::Poll<Self::Output> {
       27790  +
        let this = self.project();
       27791  +
        this.inner.as_mut().poll(cx)
28045  27792   
    }
28046         -
                            })
28047         -
                            .build_unchecked();
28048         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       27793  +
}
       27794  +
       27795  +
impl<B>
       27796  +
    ::aws_smithy_http_server::request::FromRequest<
       27797  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       27798  +
        B,
       27799  +
    > for crate::input::DocumentTypeAsMapValueInput
       27800  +
where
       27801  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       27802  +
    B: 'static,
       27803  +
       27804  +
    B::Data: Send,
       27805  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       27806  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       27807  +
{
       27808  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       27809  +
    type Future = DocumentTypeAsMapValueInputFuture;
       27810  +
       27811  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       27812  +
        let fut = async move {
       27813  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       27814  +
                request.headers(),
       27815  +
                &CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE,
       27816  +
            ) {
       27817  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       27818  +
            }
       27819  +
            crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value_http_request(request)
28049  27820   
                            .await
28050         -
                .expect("unable to make an HTTP request");
28051         -
            ::pretty_assertions::assert_eq!(
28052         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28053         -
                http_response.status()
       27821  +
                            .map_err(Into::into)
       27822  +
        };
       27823  +
        use ::futures_util::future::TryFutureExt;
       27824  +
        let fut = fut.map_err(
       27825  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       27826  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       27827  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       27828  +
                    e,
       27829  +
                )
       27830  +
            },
28054  27831   
        );
28055         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28056         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28057         -
                http_response.headers(),
28058         -
                expected_headers,
28059         -
            ));
       27832  +
        DocumentTypeAsMapValueInputFuture {
       27833  +
            inner: Box::pin(fut),
28060  27834   
        }
28061  27835   
    }
28062         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28063         -
    /// are rejected with a 400 SerializationException
28064         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case1
       27836  +
}
       27837  +
impl
       27838  +
    ::aws_smithy_http_server::response::IntoResponse<
       27839  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       27840  +
    > for crate::output::DocumentTypeAsMapValueOutput
       27841  +
{
       27842  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       27843  +
        match crate::protocol_serde::shape_document_type_as_map_value::ser_document_type_as_map_value_http_response(self) {
       27844  +
                        Ok(response) => response,
       27845  +
                        Err(e) => {
       27846  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       27847  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       27848  +
                        }
       27849  +
                    }
       27850  +
    }
       27851  +
}
       27852  +
       27853  +
#[allow(unreachable_code, unused_variables)]
       27854  +
#[cfg(test)]
       27855  +
mod document_type_as_map_value_test {
       27856  +
       27857  +
    /// Serializes a map that uses documents as the value.
       27858  +
    /// Test ID: DocumentTypeAsMapValueInput
28065  27859   
    #[::tokio::test]
28066         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case1_malformed_request(
28067         -
    ) {
28068         -
        {
       27860  +
    #[::tracing_test::traced_test]
       27861  +
    async fn document_type_as_map_value_input_request() {
28069  27862   
        #[allow(unused_mut)]
28070  27863   
                    let mut http_request = http::Request::builder()
28071         -
                .uri("/MalformedTimestampQueryDefault")
28072         -
                .method("POST")
28073         -
                .body(::aws_smithy_http_server::body::Body::empty())
28074         -
                .unwrap();
28075         -
            *http_request.uri_mut() =
28076         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57+00Z"
28077         -
                    .parse()
28078         -
                    .unwrap();
       27864  +
                        .uri("/DocumentTypeAsMapValue")
       27865  +
                        .method("PUT")
       27866  +
        .header("Content-Type", "application/json")
       27867  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"docValuedMap\": {\n        \"foo\": { \"f\": 1, \"o\": 2 },\n        \"bar\": [ \"b\", \"a\", \"r\" ],\n        \"baz\": \"BAZ\"\n    }\n}".as_bytes()))).unwrap();
28079  27868   
        #[allow(unused_mut)]
28080  27869   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28081  27870   
        let config = crate::service::RestJsonConfig::builder().build();
28082  27871   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28083         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       27872  +
            .document_type_as_map_value(move |input: crate::input::DocumentTypeAsMapValueInput| {
28084  27873   
                let sender = sender.clone();
28085  27874   
                async move {
28086         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       27875  +
                    let result = {
       27876  +
                        let expected = crate::input::DocumentTypeAsMapValueInput {
       27877  +
                            doc_valued_map: ::std::option::Option::Some({
       27878  +
                                let mut ret = ::std::collections::HashMap::new();
       27879  +
                                ret.insert("foo".to_owned(), {
       27880  +
                                    let json_bytes = br#"{
       27881  +
                                        "f": 1,
       27882  +
                                        "o": 2
       27883  +
                                    }"#;
       27884  +
                                    let mut tokens =
       27885  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       27886  +
                                            .peekable();
       27887  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
       27888  +
                                        &mut tokens,
       27889  +
                                    )
       27890  +
                                    .expect("well formed json")
       27891  +
                                });
       27892  +
                                ret.insert("bar".to_owned(), {
       27893  +
                                    let json_bytes = br#"[
       27894  +
                                        "b",
       27895  +
                                        "a",
       27896  +
                                        "r"
       27897  +
                                    ]"#;
       27898  +
                                    let mut tokens =
       27899  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       27900  +
                                            .peekable();
       27901  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
       27902  +
                                        &mut tokens,
       27903  +
                                    )
       27904  +
                                    .expect("well formed json")
       27905  +
                                });
       27906  +
                                ret.insert("baz".to_owned(), {
       27907  +
                                    let json_bytes = br#""BAZ""#;
       27908  +
                                    let mut tokens =
       27909  +
                                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       27910  +
                                            .peekable();
       27911  +
                                    ::aws_smithy_json::deserialize::token::expect_document(
       27912  +
                                        &mut tokens,
       27913  +
                                    )
       27914  +
                                    .expect("well formed json")
       27915  +
                                });
       27916  +
                                ret
       27917  +
                            }),
       27918  +
                        };
       27919  +
                        ::pretty_assertions::assert_eq!(input, expected);
       27920  +
                        let response = crate::output::DocumentTypeAsMapValueOutput {
       27921  +
                            doc_valued_map: ::std::option::Option::None,
       27922  +
                        };
       27923  +
                        response
       27924  +
                    };
28087  27925   
                    sender.send(()).await.expect("receiver dropped early");
28088  27926   
                    result
28089  27927   
                }
28090  27928   
            })
28091  27929   
            .build_unchecked();
28092  27930   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28093  27931   
            .await
28094  27932   
            .expect("unable to make an HTTP request");
       27933  +
        assert!(
       27934  +
            receiver.recv().await.is_some(),
       27935  +
            "we expected operation handler to be invoked but it was not entered"
       27936  +
        );
       27937  +
    }
       27938  +
    /// Serializes a map that uses documents as the value.
       27939  +
    /// Test ID: DocumentTypeAsMapValueOutput
       27940  +
    #[::tokio::test]
       27941  +
    #[::tracing_test::traced_test]
       27942  +
    async fn document_type_as_map_value_output_response() {
       27943  +
        let output = crate::output::DocumentTypeAsMapValueOutput {
       27944  +
            doc_valued_map: ::std::option::Option::Some({
       27945  +
                let mut ret = ::std::collections::HashMap::new();
       27946  +
                ret.insert("foo".to_owned(), {
       27947  +
                    let json_bytes = br#"{
       27948  +
                                    "f": 1,
       27949  +
                                    "o": 2
       27950  +
                                }"#;
       27951  +
                    let mut tokens =
       27952  +
                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       27953  +
                    ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       27954  +
                        .expect("well formed json")
       27955  +
                });
       27956  +
                ret.insert("bar".to_owned(), {
       27957  +
                    let json_bytes = br#"[
       27958  +
                                    "b",
       27959  +
                                    "a",
       27960  +
                                    "r"
       27961  +
                                ]"#;
       27962  +
                    let mut tokens =
       27963  +
                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       27964  +
                    ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       27965  +
                        .expect("well formed json")
       27966  +
                });
       27967  +
                ret.insert("baz".to_owned(), {
       27968  +
                    let json_bytes = br#""BAZ""#;
       27969  +
                    let mut tokens =
       27970  +
                        ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       27971  +
                    ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       27972  +
                        .expect("well formed json")
       27973  +
                });
       27974  +
                ret
       27975  +
            }),
       27976  +
        };
       27977  +
        use ::aws_smithy_http_server::response::IntoResponse;
       27978  +
        let http_response = output.into_response();
28095  27979   
        ::pretty_assertions::assert_eq!(
28096         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       27980  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28097  27981   
            http_response.status()
28098  27982   
        );
28099         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       27983  +
        let expected_headers = [("Content-Type", "application/json")];
28100  27984   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28101  27985   
            http_response.headers(),
28102  27986   
            expected_headers,
28103  27987   
        ));
       27988  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       27989  +
            .await
       27990  +
            .expect("unable to extract body to bytes");
       27991  +
        ::aws_smithy_protocol_test::assert_ok(
       27992  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"docValuedMap\": {\n        \"foo\": { \"f\": 1, \"o\": 2 },\n        \"bar\": [ \"b\", \"a\", \"r\" ],\n        \"baz\": \"BAZ\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       27993  +
        );
       27994  +
    }
       27995  +
}
       27996  +
       27997  +
const CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
       27998  +
::pin_project_lite::pin_project! {
       27999  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       28000  +
    /// [`DocumentTypeAsPayloadInput`](crate::input::DocumentTypeAsPayloadInput) using modelled bindings.
       28001  +
    pub struct DocumentTypeAsPayloadInputFuture {
       28002  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DocumentTypeAsPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
28104  28003   
    }
       28004  +
}
       28005  +
       28006  +
impl std::future::Future for DocumentTypeAsPayloadInputFuture {
       28007  +
    type Output = Result<
       28008  +
        crate::input::DocumentTypeAsPayloadInput,
       28009  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       28010  +
    >;
       28011  +
       28012  +
    fn poll(
       28013  +
        self: std::pin::Pin<&mut Self>,
       28014  +
        cx: &mut std::task::Context<'_>,
       28015  +
    ) -> std::task::Poll<Self::Output> {
       28016  +
        let this = self.project();
       28017  +
        this.inner.as_mut().poll(cx)
28105  28018   
    }
28106         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28107         -
    /// are rejected with a 400 SerializationException
28108         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case2
28109         -
    #[::tokio::test]
28110         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case2_malformed_request(
       28019  +
}
       28020  +
       28021  +
impl<B>
       28022  +
    ::aws_smithy_http_server::request::FromRequest<
       28023  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       28024  +
        B,
       28025  +
    > for crate::input::DocumentTypeAsPayloadInput
       28026  +
where
       28027  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       28028  +
    B: 'static,
       28029  +
       28030  +
    B::Data: Send,
       28031  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       28032  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       28033  +
{
       28034  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       28035  +
    type Future = DocumentTypeAsPayloadInputFuture;
       28036  +
       28037  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       28038  +
        let fut = async move {
       28039  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       28040  +
                request.headers(),
       28041  +
                &CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD,
28111  28042   
            ) {
28112         -
        {
       28043  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       28044  +
            }
       28045  +
            crate::protocol_serde::shape_document_type_as_payload::de_document_type_as_payload_http_request(request)
       28046  +
                            .await
       28047  +
                            .map_err(Into::into)
       28048  +
        };
       28049  +
        use ::futures_util::future::TryFutureExt;
       28050  +
        let fut = fut.map_err(
       28051  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       28052  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       28053  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       28054  +
                    e,
       28055  +
                )
       28056  +
            },
       28057  +
        );
       28058  +
        DocumentTypeAsPayloadInputFuture {
       28059  +
            inner: Box::pin(fut),
       28060  +
        }
       28061  +
    }
       28062  +
}
       28063  +
impl
       28064  +
    ::aws_smithy_http_server::response::IntoResponse<
       28065  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       28066  +
    > for crate::output::DocumentTypeAsPayloadOutput
       28067  +
{
       28068  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       28069  +
        match crate::protocol_serde::shape_document_type_as_payload::ser_document_type_as_payload_http_response(self) {
       28070  +
                        Ok(response) => response,
       28071  +
                        Err(e) => {
       28072  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       28073  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       28074  +
                        }
       28075  +
                    }
       28076  +
    }
       28077  +
}
       28078  +
       28079  +
#[allow(unreachable_code, unused_variables)]
       28080  +
#[cfg(test)]
       28081  +
mod document_type_as_payload_test {
       28082  +
       28083  +
    /// Serializes a document as the target of the httpPayload trait.
       28084  +
    /// Test ID: DocumentTypeAsPayloadInput
       28085  +
    #[::tokio::test]
       28086  +
    #[::tracing_test::traced_test]
       28087  +
    async fn document_type_as_payload_input_request() {
28113  28088   
        #[allow(unused_mut)]
28114  28089   
        let mut http_request = http::Request::builder()
28115         -
                .uri("/MalformedTimestampQueryDefault")
28116         -
                .method("POST")
28117         -
                .body(::aws_smithy_http_server::body::Body::empty())
28118         -
                .unwrap();
28119         -
            *http_request.uri_mut() =
28120         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39:57"
28121         -
                    .parse()
       28090  +
            .uri("/DocumentTypeAsPayload")
       28091  +
            .method("PUT")
       28092  +
            .header("Content-Type", "application/json")
       28093  +
            .body(::aws_smithy_http_server::body::Body::from(
       28094  +
                ::bytes::Bytes::from_static("{\n    \"foo\": \"bar\"\n}".as_bytes()),
       28095  +
            ))
28122  28096   
            .unwrap();
28123  28097   
        #[allow(unused_mut)]
28124  28098   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28125  28099   
        let config = crate::service::RestJsonConfig::builder().build();
28126  28100   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28127         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       28101  +
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
28128  28102   
                let sender = sender.clone();
28129  28103   
                async move {
28130         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       28104  +
                    let result = {
       28105  +
                        let expected = crate::input::DocumentTypeAsPayloadInput {
       28106  +
                            document_value: ::std::option::Option::Some({
       28107  +
                                let json_bytes = br#"{
       28108  +
                                "foo": "bar"
       28109  +
                            }"#;
       28110  +
                                let mut tokens =
       28111  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28112  +
                                        .peekable();
       28113  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28114  +
                                    .expect("well formed json")
       28115  +
                            }),
       28116  +
                        };
       28117  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28118  +
                        let response = crate::output::DocumentTypeAsPayloadOutput {
       28119  +
                            document_value: ::std::option::Option::Some({
       28120  +
                                let json_bytes = br#"null"#;
       28121  +
                                let mut tokens =
       28122  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28123  +
                                        .peekable();
       28124  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28125  +
                                    .expect("well formed json")
       28126  +
                            }),
       28127  +
                        };
       28128  +
                        response
       28129  +
                    };
28131  28130   
                    sender.send(()).await.expect("receiver dropped early");
28132  28131   
                    result
28133  28132   
                }
28134  28133   
            })
28135  28134   
            .build_unchecked();
28136  28135   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28137  28136   
            .await
28138  28137   
            .expect("unable to make an HTTP request");
28139         -
            ::pretty_assertions::assert_eq!(
28140         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28141         -
                http_response.status()
       28138  +
        assert!(
       28139  +
            receiver.recv().await.is_some(),
       28140  +
            "we expected operation handler to be invoked but it was not entered"
28142  28141   
        );
28143         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28144         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28145         -
                http_response.headers(),
28146         -
                expected_headers,
28147         -
            ));
28148  28142   
    }
28149         -
    }
28150         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28151         -
    /// are rejected with a 400 SerializationException
28152         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case3
       28143  +
    /// Serializes a document as the target of the httpPayload trait using a string.
       28144  +
    /// Test ID: DocumentTypeAsPayloadInputString
28153  28145   
    #[::tokio::test]
28154         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case3_malformed_request(
28155         -
    ) {
28156         -
        {
       28146  +
    #[::tracing_test::traced_test]
       28147  +
    async fn document_type_as_payload_input_string_request() {
28157  28148   
        #[allow(unused_mut)]
28158  28149   
        let mut http_request = http::Request::builder()
28159         -
                .uri("/MalformedTimestampQueryDefault")
28160         -
                .method("POST")
28161         -
                .body(::aws_smithy_http_server::body::Body::empty())
28162         -
                .unwrap();
28163         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T163957"
28164         -
                .parse()
       28150  +
            .uri("/DocumentTypeAsPayload")
       28151  +
            .method("PUT")
       28152  +
            .header("Content-Type", "application/json")
       28153  +
            .body(::aws_smithy_http_server::body::Body::from(
       28154  +
                ::bytes::Bytes::from_static("\"hello\"".as_bytes()),
       28155  +
            ))
28165  28156   
            .unwrap();
28166  28157   
        #[allow(unused_mut)]
28167  28158   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28168  28159   
        let config = crate::service::RestJsonConfig::builder().build();
28169  28160   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28170         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       28161  +
            .document_type_as_payload(move |input: crate::input::DocumentTypeAsPayloadInput| {
28171  28162   
                let sender = sender.clone();
28172  28163   
                async move {
28173         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       28164  +
                    let result = {
       28165  +
                        let expected = crate::input::DocumentTypeAsPayloadInput {
       28166  +
                            document_value: ::std::option::Option::Some({
       28167  +
                                let json_bytes = br#""hello""#;
       28168  +
                                let mut tokens =
       28169  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28170  +
                                        .peekable();
       28171  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28172  +
                                    .expect("well formed json")
       28173  +
                            }),
       28174  +
                        };
       28175  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28176  +
                        let response = crate::output::DocumentTypeAsPayloadOutput {
       28177  +
                            document_value: ::std::option::Option::Some({
       28178  +
                                let json_bytes = br#"null"#;
       28179  +
                                let mut tokens =
       28180  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28181  +
                                        .peekable();
       28182  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28183  +
                                    .expect("well formed json")
       28184  +
                            }),
       28185  +
                        };
       28186  +
                        response
       28187  +
                    };
28174  28188   
                    sender.send(()).await.expect("receiver dropped early");
28175  28189   
                    result
28176  28190   
                }
28177  28191   
            })
28178  28192   
            .build_unchecked();
28179  28193   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28180  28194   
            .await
28181  28195   
            .expect("unable to make an HTTP request");
       28196  +
        assert!(
       28197  +
            receiver.recv().await.is_some(),
       28198  +
            "we expected operation handler to be invoked but it was not entered"
       28199  +
        );
       28200  +
    }
       28201  +
    /// Serializes a document as the target of the httpPayload trait.
       28202  +
    /// Test ID: DocumentTypeAsPayloadOutput
       28203  +
    #[::tokio::test]
       28204  +
    #[::tracing_test::traced_test]
       28205  +
    async fn document_type_as_payload_output_response() {
       28206  +
        let output = crate::output::DocumentTypeAsPayloadOutput {
       28207  +
            document_value: ::std::option::Option::Some({
       28208  +
                let json_bytes = br#"{
       28209  +
                            "foo": "bar"
       28210  +
                        }"#;
       28211  +
                let mut tokens =
       28212  +
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       28213  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28214  +
                    .expect("well formed json")
       28215  +
            }),
       28216  +
        };
       28217  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28218  +
        let http_response = output.into_response();
28182  28219   
        ::pretty_assertions::assert_eq!(
28183         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28220  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28184  28221   
            http_response.status()
28185  28222   
        );
28186         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       28223  +
        let expected_headers = [("Content-Type", "application/json")];
28187  28224   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28188  28225   
            http_response.headers(),
28189  28226   
            expected_headers,
28190  28227   
        ));
       28228  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       28229  +
            .await
       28230  +
            .expect("unable to extract body to bytes");
       28231  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       28232  +
            &body,
       28233  +
            "{\n    \"foo\": \"bar\"\n}",
       28234  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       28235  +
        ));
28191  28236   
    }
28192         -
    }
28193         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28194         -
    /// are rejected with a 400 SerializationException
28195         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case4
       28237  +
    /// Serializes a document as a payload string.
       28238  +
    /// Test ID: DocumentTypeAsPayloadOutputString
28196  28239   
    #[::tokio::test]
28197         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case4_malformed_request(
28198         -
    ) {
28199         -
        {
28200         -
            #[allow(unused_mut)]
28201         -
            let mut http_request = http::Request::builder()
28202         -
                .uri("/MalformedTimestampQueryDefault")
28203         -
                .method("POST")
28204         -
                .body(::aws_smithy_http_server::body::Body::empty())
28205         -
                .unwrap();
28206         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957Z"
28207         -
                .parse()
28208         -
                .unwrap();
28209         -
            #[allow(unused_mut)]
28210         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28211         -
            let config = crate::service::RestJsonConfig::builder().build();
28212         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28213         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
28214         -
                                let sender = sender.clone();
28215         -
                                async move {
28216         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
28217         -
                                    sender.send(()).await.expect("receiver dropped early");
28218         -
                                    result
28219         -
                                }
28220         -
                            })
28221         -
                            .build_unchecked();
28222         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28223         -
                .await
28224         -
                .expect("unable to make an HTTP request");
       28240  +
    #[::tracing_test::traced_test]
       28241  +
    async fn document_type_as_payload_output_string_response() {
       28242  +
        let output = crate::output::DocumentTypeAsPayloadOutput {
       28243  +
            document_value: ::std::option::Option::Some({
       28244  +
                let json_bytes = br#""hello""#;
       28245  +
                let mut tokens =
       28246  +
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       28247  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28248  +
                    .expect("well formed json")
       28249  +
            }),
       28250  +
        };
       28251  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28252  +
        let http_response = output.into_response();
28225  28253   
        ::pretty_assertions::assert_eq!(
28226         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28254  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28227  28255   
            http_response.status()
28228  28256   
        );
28229         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       28257  +
        let expected_headers = [("Content-Type", "application/json")];
28230  28258   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28231  28259   
            http_response.headers(),
28232  28260   
            expected_headers,
28233  28261   
        ));
       28262  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       28263  +
            .await
       28264  +
            .expect("unable to extract body to bytes");
       28265  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       28266  +
            &body,
       28267  +
            "\"hello\"",
       28268  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       28269  +
        ));
28234  28270   
    }
       28271  +
}
       28272  +
       28273  +
const CONTENT_TYPE_DOCUMENTTYPE: ::mime::Mime = ::mime::APPLICATION_JSON;
       28274  +
::pin_project_lite::pin_project! {
       28275  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       28276  +
    /// [`DocumentTypeInput`](crate::input::DocumentTypeInput) using modelled bindings.
       28277  +
    pub struct DocumentTypeInputFuture {
       28278  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DocumentTypeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
28235  28279   
    }
28236         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28237         -
    /// are rejected with a 400 SerializationException
28238         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case5
28239         -
    #[::tokio::test]
28240         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case5_malformed_request(
       28280  +
}
       28281  +
       28282  +
impl std::future::Future for DocumentTypeInputFuture {
       28283  +
    type Output = Result<
       28284  +
        crate::input::DocumentTypeInput,
       28285  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       28286  +
    >;
       28287  +
       28288  +
    fn poll(
       28289  +
        self: std::pin::Pin<&mut Self>,
       28290  +
        cx: &mut std::task::Context<'_>,
       28291  +
    ) -> std::task::Poll<Self::Output> {
       28292  +
        let this = self.project();
       28293  +
        this.inner.as_mut().poll(cx)
       28294  +
    }
       28295  +
}
       28296  +
       28297  +
impl<B>
       28298  +
    ::aws_smithy_http_server::request::FromRequest<
       28299  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       28300  +
        B,
       28301  +
    > for crate::input::DocumentTypeInput
       28302  +
where
       28303  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       28304  +
    B: 'static,
       28305  +
       28306  +
    B::Data: Send,
       28307  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       28308  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       28309  +
{
       28310  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       28311  +
    type Future = DocumentTypeInputFuture;
       28312  +
       28313  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       28314  +
        let fut = async move {
       28315  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       28316  +
                request.headers(),
       28317  +
                &CONTENT_TYPE_DOCUMENTTYPE,
28241  28318   
            ) {
28242         -
        {
28243         -
            #[allow(unused_mut)]
28244         -
            let mut http_request = http::Request::builder()
28245         -
                .uri("/MalformedTimestampQueryDefault")
28246         -
                .method("POST")
28247         -
                .body(::aws_smithy_http_server::body::Body::empty())
28248         -
                .unwrap();
28249         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T163957"
28250         -
                .parse()
28251         -
                .unwrap();
28252         -
            #[allow(unused_mut)]
28253         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28254         -
            let config = crate::service::RestJsonConfig::builder().build();
28255         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28256         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
28257         -
                                let sender = sender.clone();
28258         -
                                async move {
28259         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
28260         -
                                    sender.send(()).await.expect("receiver dropped early");
28261         -
                                    result
       28319  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
28262  28320   
            }
28263         -
                            })
28264         -
                            .build_unchecked();
28265         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       28321  +
            crate::protocol_serde::shape_document_type::de_document_type_http_request(request)
28266  28322   
                .await
28267         -
                .expect("unable to make an HTTP request");
28268         -
            ::pretty_assertions::assert_eq!(
28269         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28270         -
                http_response.status()
       28323  +
                .map_err(Into::into)
       28324  +
        };
       28325  +
        use ::futures_util::future::TryFutureExt;
       28326  +
        let fut = fut.map_err(
       28327  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       28328  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       28329  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       28330  +
                    e,
       28331  +
                )
       28332  +
            },
28271  28333   
        );
28272         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28273         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28274         -
                http_response.headers(),
28275         -
                expected_headers,
28276         -
            ));
       28334  +
        DocumentTypeInputFuture {
       28335  +
            inner: Box::pin(fut),
28277  28336   
        }
28278  28337   
    }
28279         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28280         -
    /// are rejected with a 400 SerializationException
28281         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case6
       28338  +
}
       28339  +
impl
       28340  +
    ::aws_smithy_http_server::response::IntoResponse<
       28341  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       28342  +
    > for crate::output::DocumentTypeOutput
       28343  +
{
       28344  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       28345  +
        match crate::protocol_serde::shape_document_type::ser_document_type_http_response(self) {
       28346  +
            Ok(response) => response,
       28347  +
            Err(e) => {
       28348  +
                ::tracing::error!(error = %e, "failed to serialize response");
       28349  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       28350  +
            }
       28351  +
        }
       28352  +
    }
       28353  +
}
       28354  +
       28355  +
#[allow(unreachable_code, unused_variables)]
       28356  +
#[cfg(test)]
       28357  +
mod document_type_test {
       28358  +
       28359  +
    /// Serializes document types as part of the JSON request payload with no escaping.
       28360  +
    /// Test ID: DocumentTypeInputWithObject
28282  28361   
    #[::tokio::test]
28283         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case6_malformed_request(
28284         -
    ) {
28285         -
        {
       28362  +
    #[::tracing_test::traced_test]
       28363  +
    async fn document_type_input_with_object_request() {
28286  28364   
        #[allow(unused_mut)]
28287  28365   
                    let mut http_request = http::Request::builder()
28288         -
                .uri("/MalformedTimestampQueryDefault")
28289         -
                .method("POST")
28290         -
                .body(::aws_smithy_http_server::body::Body::empty())
28291         -
                .unwrap();
28292         -
            *http_request.uri_mut() =
28293         -
                "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57Z"
28294         -
                    .parse()
28295         -
                    .unwrap();
       28366  +
                        .uri("/DocumentType")
       28367  +
                        .method("PUT")
       28368  +
        .header("Content-Type", "application/json")
       28369  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"stringValue\": \"string\",\n    \"documentValue\": {\n        \"foo\": \"bar\"\n    }\n}".as_bytes()))).unwrap();
28296  28370   
        #[allow(unused_mut)]
28297  28371   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28298  28372   
        let config = crate::service::RestJsonConfig::builder().build();
28299  28373   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28300         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       28374  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
28301  28375   
                let sender = sender.clone();
28302  28376   
                async move {
28303         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       28377  +
                    let result = {
       28378  +
                        let expected = crate::input::DocumentTypeInput {
       28379  +
                            string_value: ::std::option::Option::Some("string".to_owned()),
       28380  +
                            document_value: ::std::option::Option::Some({
       28381  +
                                let json_bytes = br#"{
       28382  +
                                "foo": "bar"
       28383  +
                            }"#;
       28384  +
                                let mut tokens =
       28385  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28386  +
                                        .peekable();
       28387  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28388  +
                                    .expect("well formed json")
       28389  +
                            }),
       28390  +
                        };
       28391  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28392  +
                        let response = crate::output::DocumentTypeOutput {
       28393  +
                            string_value: ::std::option::Option::None,
       28394  +
                            document_value: ::std::option::Option::Some({
       28395  +
                                let json_bytes = br#"null"#;
       28396  +
                                let mut tokens =
       28397  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28398  +
                                        .peekable();
       28399  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28400  +
                                    .expect("well formed json")
       28401  +
                            }),
       28402  +
                        };
       28403  +
                        response
       28404  +
                    };
28304  28405   
                    sender.send(()).await.expect("receiver dropped early");
28305  28406   
                    result
28306  28407   
                }
28307  28408   
            })
28308  28409   
            .build_unchecked();
28309  28410   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28310  28411   
            .await
28311  28412   
            .expect("unable to make an HTTP request");
28312         -
            ::pretty_assertions::assert_eq!(
28313         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28314         -
                http_response.status()
       28413  +
        assert!(
       28414  +
            receiver.recv().await.is_some(),
       28415  +
            "we expected operation handler to be invoked but it was not entered"
28315  28416   
        );
28316         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28317         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28318         -
                http_response.headers(),
28319         -
                expected_headers,
28320         -
            ));
28321         -
        }
28322  28417   
    }
28323         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28324         -
    /// are rejected with a 400 SerializationException
28325         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case7
       28418  +
    /// Serializes document types using a string.
       28419  +
    /// Test ID: DocumentInputWithString
28326  28420   
    #[::tokio::test]
28327         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case7_malformed_request(
28328         -
    ) {
28329         -
        {
       28421  +
    #[::tracing_test::traced_test]
       28422  +
    async fn document_input_with_string_request() {
28330  28423   
        #[allow(unused_mut)]
28331  28424   
        let mut http_request = http::Request::builder()
28332         -
                .uri("/MalformedTimestampQueryDefault")
28333         -
                .method("POST")
28334         -
                .body(::aws_smithy_http_server::body::Body::empty())
28335         -
                .unwrap();
28336         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=19961219T16:39:57"
28337         -
                .parse()
       28425  +
            .uri("/DocumentType")
       28426  +
            .method("PUT")
       28427  +
            .header("Content-Type", "application/json")
       28428  +
            .body(::aws_smithy_http_server::body::Body::from(
       28429  +
                ::bytes::Bytes::from_static(
       28430  +
                    "{\n    \"stringValue\": \"string\",\n    \"documentValue\": \"hello\"\n}"
       28431  +
                        .as_bytes(),
       28432  +
                ),
       28433  +
            ))
28338  28434   
            .unwrap();
28339  28435   
        #[allow(unused_mut)]
28340  28436   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28341  28437   
        let config = crate::service::RestJsonConfig::builder().build();
28342  28438   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28343         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       28439  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
28344  28440   
                let sender = sender.clone();
28345  28441   
                async move {
28346         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       28442  +
                    let result = {
       28443  +
                        let expected = crate::input::DocumentTypeInput {
       28444  +
                            string_value: ::std::option::Option::Some("string".to_owned()),
       28445  +
                            document_value: ::std::option::Option::Some({
       28446  +
                                let json_bytes = br#""hello""#;
       28447  +
                                let mut tokens =
       28448  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28449  +
                                        .peekable();
       28450  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28451  +
                                    .expect("well formed json")
       28452  +
                            }),
       28453  +
                        };
       28454  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28455  +
                        let response = crate::output::DocumentTypeOutput {
       28456  +
                            string_value: ::std::option::Option::None,
       28457  +
                            document_value: ::std::option::Option::Some({
       28458  +
                                let json_bytes = br#"null"#;
       28459  +
                                let mut tokens =
       28460  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28461  +
                                        .peekable();
       28462  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28463  +
                                    .expect("well formed json")
       28464  +
                            }),
       28465  +
                        };
       28466  +
                        response
       28467  +
                    };
28347  28468   
                    sender.send(()).await.expect("receiver dropped early");
28348  28469   
                    result
28349  28470   
                }
28350  28471   
            })
28351  28472   
            .build_unchecked();
28352  28473   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28353  28474   
            .await
28354  28475   
            .expect("unable to make an HTTP request");
28355         -
            ::pretty_assertions::assert_eq!(
28356         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28357         -
                http_response.status()
       28476  +
        assert!(
       28477  +
            receiver.recv().await.is_some(),
       28478  +
            "we expected operation handler to be invoked but it was not entered"
28358  28479   
        );
28359         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28360         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28361         -
                http_response.headers(),
28362         -
                expected_headers,
28363         -
            ));
28364  28480   
    }
28365         -
    }
28366         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28367         -
    /// are rejected with a 400 SerializationException
28368         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case8
       28481  +
    /// Serializes document types using a number.
       28482  +
    /// Test ID: DocumentInputWithNumber
28369  28483   
    #[::tokio::test]
28370         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case8_malformed_request(
28371         -
    ) {
28372         -
        {
       28484  +
    #[::tracing_test::traced_test]
       28485  +
    async fn document_input_with_number_request() {
28373  28486   
        #[allow(unused_mut)]
28374  28487   
        let mut http_request = http::Request::builder()
28375         -
                .uri("/MalformedTimestampQueryDefault")
28376         -
                .method("POST")
28377         -
                .body(::aws_smithy_http_server::body::Body::empty())
28378         -
                .unwrap();
28379         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39Z"
28380         -
                .parse()
       28488  +
            .uri("/DocumentType")
       28489  +
            .method("PUT")
       28490  +
            .header("Content-Type", "application/json")
       28491  +
            .body(::aws_smithy_http_server::body::Body::from(
       28492  +
                ::bytes::Bytes::from_static(
       28493  +
                    "{\n    \"stringValue\": \"string\",\n    \"documentValue\": 10\n}".as_bytes(),
       28494  +
                ),
       28495  +
            ))
28381  28496   
            .unwrap();
28382  28497   
        #[allow(unused_mut)]
28383  28498   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28384  28499   
        let config = crate::service::RestJsonConfig::builder().build();
28385  28500   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28386         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       28501  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
28387  28502   
                let sender = sender.clone();
28388  28503   
                async move {
28389         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       28504  +
                    let result = {
       28505  +
                        let expected = crate::input::DocumentTypeInput {
       28506  +
                            string_value: ::std::option::Option::Some("string".to_owned()),
       28507  +
                            document_value: ::std::option::Option::Some({
       28508  +
                                let json_bytes = br#"10"#;
       28509  +
                                let mut tokens =
       28510  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28511  +
                                        .peekable();
       28512  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28513  +
                                    .expect("well formed json")
       28514  +
                            }),
       28515  +
                        };
       28516  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28517  +
                        let response = crate::output::DocumentTypeOutput {
       28518  +
                            string_value: ::std::option::Option::None,
       28519  +
                            document_value: ::std::option::Option::Some({
       28520  +
                                let json_bytes = br#"null"#;
       28521  +
                                let mut tokens =
       28522  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28523  +
                                        .peekable();
       28524  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28525  +
                                    .expect("well formed json")
       28526  +
                            }),
       28527  +
                        };
       28528  +
                        response
       28529  +
                    };
28390  28530   
                    sender.send(()).await.expect("receiver dropped early");
28391  28531   
                    result
28392  28532   
                }
28393  28533   
            })
28394  28534   
            .build_unchecked();
28395  28535   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28396  28536   
            .await
28397  28537   
            .expect("unable to make an HTTP request");
28398         -
            ::pretty_assertions::assert_eq!(
28399         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28400         -
                http_response.status()
       28538  +
        assert!(
       28539  +
            receiver.recv().await.is_some(),
       28540  +
            "we expected operation handler to be invoked but it was not entered"
28401  28541   
        );
28402         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28403         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28404         -
                http_response.headers(),
28405         -
                expected_headers,
28406         -
            ));
28407  28542   
    }
28408         -
    }
28409         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28410         -
    /// are rejected with a 400 SerializationException
28411         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case9
       28543  +
    /// Serializes document types using a boolean.
       28544  +
    /// Test ID: DocumentInputWithBoolean
28412  28545   
    #[::tokio::test]
28413         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case9_malformed_request(
28414         -
    ) {
28415         -
        {
       28546  +
    #[::tracing_test::traced_test]
       28547  +
    async fn document_input_with_boolean_request() {
28416  28548   
        #[allow(unused_mut)]
28417  28549   
        let mut http_request = http::Request::builder()
28418         -
                .uri("/MalformedTimestampQueryDefault")
28419         -
                .method("POST")
28420         -
                .body(::aws_smithy_http_server::body::Body::empty())
28421         -
                .unwrap();
28422         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16:39"
28423         -
                .parse()
       28550  +
            .uri("/DocumentType")
       28551  +
            .method("PUT")
       28552  +
            .header("Content-Type", "application/json")
       28553  +
            .body(::aws_smithy_http_server::body::Body::from(
       28554  +
                ::bytes::Bytes::from_static(
       28555  +
                    "{\n    \"stringValue\": \"string\",\n    \"documentValue\": true\n}"
       28556  +
                        .as_bytes(),
       28557  +
                ),
       28558  +
            ))
28424  28559   
            .unwrap();
28425  28560   
        #[allow(unused_mut)]
28426  28561   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28427  28562   
        let config = crate::service::RestJsonConfig::builder().build();
28428  28563   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28429         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       28564  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
28430  28565   
                let sender = sender.clone();
28431  28566   
                async move {
28432         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       28567  +
                    let result = {
       28568  +
                        let expected = crate::input::DocumentTypeInput {
       28569  +
                            string_value: ::std::option::Option::Some("string".to_owned()),
       28570  +
                            document_value: ::std::option::Option::Some({
       28571  +
                                let json_bytes = br#"true"#;
       28572  +
                                let mut tokens =
       28573  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28574  +
                                        .peekable();
       28575  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28576  +
                                    .expect("well formed json")
       28577  +
                            }),
       28578  +
                        };
       28579  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28580  +
                        let response = crate::output::DocumentTypeOutput {
       28581  +
                            string_value: ::std::option::Option::None,
       28582  +
                            document_value: ::std::option::Option::Some({
       28583  +
                                let json_bytes = br#"null"#;
       28584  +
                                let mut tokens =
       28585  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28586  +
                                        .peekable();
       28587  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28588  +
                                    .expect("well formed json")
       28589  +
                            }),
       28590  +
                        };
       28591  +
                        response
       28592  +
                    };
28433  28593   
                    sender.send(()).await.expect("receiver dropped early");
28434  28594   
                    result
28435  28595   
                }
28436  28596   
            })
28437  28597   
            .build_unchecked();
28438  28598   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28439  28599   
            .await
28440  28600   
            .expect("unable to make an HTTP request");
28441         -
            ::pretty_assertions::assert_eq!(
28442         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28443         -
                http_response.status()
       28601  +
        assert!(
       28602  +
            receiver.recv().await.is_some(),
       28603  +
            "we expected operation handler to be invoked but it was not entered"
28444  28604   
        );
28445         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28446         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28447         -
                http_response.headers(),
28448         -
                expected_headers,
28449         -
            ));
28450         -
        }
28451  28605   
    }
28452         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28453         -
    /// are rejected with a 400 SerializationException
28454         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case10
       28606  +
    /// Serializes document types using a list.
       28607  +
    /// Test ID: DocumentInputWithList
28455  28608   
    #[::tokio::test]
28456         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case10_malformed_request(
28457         -
    ) {
28458         -
        {
       28609  +
    #[::tracing_test::traced_test]
       28610  +
    async fn document_input_with_list_request() {
28459  28611   
        #[allow(unused_mut)]
28460  28612   
                    let mut http_request = http::Request::builder()
28461         -
                .uri("/MalformedTimestampQueryDefault")
28462         -
                .method("POST")
28463         -
                .body(::aws_smithy_http_server::body::Body::empty())
28464         -
                .unwrap();
28465         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T1639"
28466         -
                .parse()
28467         -
                .unwrap();
       28613  +
                        .uri("/DocumentType")
       28614  +
                        .method("PUT")
       28615  +
        .header("Content-Type", "application/json")
       28616  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"stringValue\": \"string\",\n    \"documentValue\": [\n        true,\n        \"hi\",\n        [\n            1,\n            2\n        ],\n        {\n            \"foo\": {\n                \"baz\": [\n                    3,\n                    4\n                ]\n            }\n        }\n    ]\n}".as_bytes()))).unwrap();
28468  28617   
        #[allow(unused_mut)]
28469  28618   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28470  28619   
        let config = crate::service::RestJsonConfig::builder().build();
28471  28620   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28472         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
       28621  +
            .document_type(move |input: crate::input::DocumentTypeInput| {
28473  28622   
                let sender = sender.clone();
28474  28623   
                async move {
28475         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
       28624  +
                    let result = {
       28625  +
                        let expected = crate::input::DocumentTypeInput {
       28626  +
                            string_value: ::std::option::Option::Some("string".to_owned()),
       28627  +
                            document_value: ::std::option::Option::Some({
       28628  +
                                let json_bytes = br#"[
       28629  +
                                true,
       28630  +
                                "hi",
       28631  +
                                [
       28632  +
                                    1,
       28633  +
                                    2
       28634  +
                                ],
       28635  +
                                {
       28636  +
                                    "foo": {
       28637  +
                                        "baz": [
       28638  +
                                            3,
       28639  +
                                            4
       28640  +
                                        ]
       28641  +
                                    }
       28642  +
                                }
       28643  +
                            ]"#;
       28644  +
                                let mut tokens =
       28645  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28646  +
                                        .peekable();
       28647  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28648  +
                                    .expect("well formed json")
       28649  +
                            }),
       28650  +
                        };
       28651  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28652  +
                        let response = crate::output::DocumentTypeOutput {
       28653  +
                            string_value: ::std::option::Option::None,
       28654  +
                            document_value: ::std::option::Option::Some({
       28655  +
                                let json_bytes = br#"null"#;
       28656  +
                                let mut tokens =
       28657  +
                                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes)
       28658  +
                                        .peekable();
       28659  +
                                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28660  +
                                    .expect("well formed json")
       28661  +
                            }),
       28662  +
                        };
       28663  +
                        response
       28664  +
                    };
28476  28665   
                    sender.send(()).await.expect("receiver dropped early");
28477  28666   
                    result
28478  28667   
                }
28479  28668   
            })
28480  28669   
            .build_unchecked();
28481  28670   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28482  28671   
            .await
28483  28672   
            .expect("unable to make an HTTP request");
       28673  +
        assert!(
       28674  +
            receiver.recv().await.is_some(),
       28675  +
            "we expected operation handler to be invoked but it was not entered"
       28676  +
        );
       28677  +
    }
       28678  +
    /// Serializes documents as part of the JSON response payload with no escaping.
       28679  +
    /// Test ID: DocumentOutput
       28680  +
    #[::tokio::test]
       28681  +
    #[::tracing_test::traced_test]
       28682  +
    async fn document_output_response() {
       28683  +
        let output = crate::output::DocumentTypeOutput {
       28684  +
            string_value: ::std::option::Option::Some("string".to_owned()),
       28685  +
            document_value: ::std::option::Option::Some({
       28686  +
                let json_bytes = br#"{
       28687  +
                            "foo": "bar"
       28688  +
                        }"#;
       28689  +
                let mut tokens =
       28690  +
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       28691  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28692  +
                    .expect("well formed json")
       28693  +
            }),
       28694  +
        };
       28695  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28696  +
        let http_response = output.into_response();
28484  28697   
        ::pretty_assertions::assert_eq!(
28485         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28698  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28486  28699   
            http_response.status()
28487  28700   
        );
28488         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       28701  +
        let expected_headers = [("Content-Type", "application/json")];
28489  28702   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28490  28703   
            http_response.headers(),
28491  28704   
            expected_headers,
28492  28705   
        ));
       28706  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       28707  +
            .await
       28708  +
            .expect("unable to extract body to bytes");
       28709  +
        ::aws_smithy_protocol_test::assert_ok(
       28710  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"stringValue\": \"string\",\n    \"documentValue\": {\n        \"foo\": \"bar\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       28711  +
        );
28493  28712   
    }
28494         -
    }
28495         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28496         -
    /// are rejected with a 400 SerializationException
28497         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case11
       28713  +
    /// Document types can be JSON scalars too.
       28714  +
    /// Test ID: DocumentOutputString
28498  28715   
    #[::tokio::test]
28499         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case11_malformed_request(
28500         -
    ) {
28501         -
        {
28502         -
            #[allow(unused_mut)]
28503         -
            let mut http_request = http::Request::builder()
28504         -
                .uri("/MalformedTimestampQueryDefault")
28505         -
                .method("POST")
28506         -
                .body(::aws_smithy_http_server::body::Body::empty())
28507         -
                .unwrap();
28508         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16Z"
28509         -
                .parse()
28510         -
                .unwrap();
28511         -
            #[allow(unused_mut)]
28512         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28513         -
            let config = crate::service::RestJsonConfig::builder().build();
28514         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28515         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
28516         -
                                let sender = sender.clone();
28517         -
                                async move {
28518         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
28519         -
                                    sender.send(()).await.expect("receiver dropped early");
28520         -
                                    result
28521         -
                                }
28522         -
                            })
28523         -
                            .build_unchecked();
28524         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28525         -
                .await
28526         -
                .expect("unable to make an HTTP request");
       28716  +
    #[::tracing_test::traced_test]
       28717  +
    async fn document_output_string_response() {
       28718  +
        let output = crate::output::DocumentTypeOutput {
       28719  +
            string_value: ::std::option::Option::Some("string".to_owned()),
       28720  +
            document_value: ::std::option::Option::Some({
       28721  +
                let json_bytes = br#""hello""#;
       28722  +
                let mut tokens =
       28723  +
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       28724  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28725  +
                    .expect("well formed json")
       28726  +
            }),
       28727  +
        };
       28728  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28729  +
        let http_response = output.into_response();
28527  28730   
        ::pretty_assertions::assert_eq!(
28528         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28731  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28529  28732   
            http_response.status()
28530  28733   
        );
28531         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       28734  +
        let expected_headers = [("Content-Type", "application/json")];
28532  28735   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28533  28736   
            http_response.headers(),
28534  28737   
            expected_headers,
28535  28738   
        ));
       28739  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       28740  +
            .await
       28741  +
            .expect("unable to extract body to bytes");
       28742  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       28743  +
            &body,
       28744  +
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": \"hello\"\n}",
       28745  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       28746  +
        ));
28536  28747   
    }
28537         -
    }
28538         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28539         -
    /// are rejected with a 400 SerializationException
28540         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case12
       28748  +
    /// Document types can be JSON scalars too.
       28749  +
    /// Test ID: DocumentOutputNumber
28541  28750   
    #[::tokio::test]
28542         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case12_malformed_request(
28543         -
    ) {
28544         -
        {
28545         -
            #[allow(unused_mut)]
28546         -
            let mut http_request = http::Request::builder()
28547         -
                .uri("/MalformedTimestampQueryDefault")
28548         -
                .method("POST")
28549         -
                .body(::aws_smithy_http_server::body::Body::empty())
28550         -
                .unwrap();
28551         -
            *http_request.uri_mut() = "/MalformedTimestampQueryDefault?timestamp=1996-12-19T16"
28552         -
                .parse()
28553         -
                .unwrap();
28554         -
            #[allow(unused_mut)]
28555         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28556         -
            let config = crate::service::RestJsonConfig::builder().build();
28557         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28558         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
28559         -
                                let sender = sender.clone();
28560         -
                                async move {
28561         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
28562         -
                                    sender.send(()).await.expect("receiver dropped early");
28563         -
                                    result
28564         -
                                }
28565         -
                            })
28566         -
                            .build_unchecked();
28567         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28568         -
                .await
28569         -
                .expect("unable to make an HTTP request");
       28751  +
    #[::tracing_test::traced_test]
       28752  +
    async fn document_output_number_response() {
       28753  +
        let output = crate::output::DocumentTypeOutput {
       28754  +
            string_value: ::std::option::Option::Some("string".to_owned()),
       28755  +
            document_value: ::std::option::Option::Some({
       28756  +
                let json_bytes = br#"10"#;
       28757  +
                let mut tokens =
       28758  +
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       28759  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28760  +
                    .expect("well formed json")
       28761  +
            }),
       28762  +
        };
       28763  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28764  +
        let http_response = output.into_response();
28570  28765   
        ::pretty_assertions::assert_eq!(
28571         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28766  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28572  28767   
            http_response.status()
28573  28768   
        );
28574         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       28769  +
        let expected_headers = [("Content-Type", "application/json")];
28575  28770   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28576  28771   
            http_response.headers(),
28577  28772   
            expected_headers,
28578  28773   
        ));
       28774  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       28775  +
            .await
       28776  +
            .expect("unable to extract body to bytes");
       28777  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       28778  +
            &body,
       28779  +
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": 10\n}",
       28780  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       28781  +
        ));
28579  28782   
    }
28580         -
    }
28581         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28582         -
    /// are rejected with a 400 SerializationException
28583         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case13
       28783  +
    /// Document types can be JSON scalars too.
       28784  +
    /// Test ID: DocumentOutputBoolean
28584  28785   
    #[::tokio::test]
28585         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case13_malformed_request(
28586         -
    ) {
28587         -
        {
28588         -
            #[allow(unused_mut)]
28589         -
            let mut http_request = http::Request::builder()
28590         -
                .uri("/MalformedTimestampQueryDefault")
28591         -
                .method("POST")
28592         -
                .body(::aws_smithy_http_server::body::Body::empty())
28593         -
                .unwrap();
28594         -
            *http_request.uri_mut() =
28595         -
                "/MalformedTimestampQueryDefault?timestamp=1996-12-19%2016:39:57Z"
28596         -
                    .parse()
28597         -
                    .unwrap();
28598         -
            #[allow(unused_mut)]
28599         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28600         -
            let config = crate::service::RestJsonConfig::builder().build();
28601         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28602         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
28603         -
                                let sender = sender.clone();
28604         -
                                async move {
28605         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
28606         -
                                    sender.send(()).await.expect("receiver dropped early");
28607         -
                                    result
28608         -
                                }
28609         -
                            })
28610         -
                            .build_unchecked();
28611         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28612         -
                .await
28613         -
                .expect("unable to make an HTTP request");
       28786  +
    #[::tracing_test::traced_test]
       28787  +
    async fn document_output_boolean_response() {
       28788  +
        let output = crate::output::DocumentTypeOutput {
       28789  +
            string_value: ::std::option::Option::Some("string".to_owned()),
       28790  +
            document_value: ::std::option::Option::Some({
       28791  +
                let json_bytes = br#"false"#;
       28792  +
                let mut tokens =
       28793  +
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       28794  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28795  +
                    .expect("well formed json")
       28796  +
            }),
       28797  +
        };
       28798  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28799  +
        let http_response = output.into_response();
28614  28800   
        ::pretty_assertions::assert_eq!(
28615         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28801  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28616  28802   
            http_response.status()
28617  28803   
        );
28618         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       28804  +
        let expected_headers = [("Content-Type", "application/json")];
28619  28805   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28620  28806   
            http_response.headers(),
28621  28807   
            expected_headers,
28622  28808   
        ));
       28809  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       28810  +
            .await
       28811  +
            .expect("unable to extract body to bytes");
       28812  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       28813  +
            &body,
       28814  +
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": false\n}",
       28815  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       28816  +
        ));
28623  28817   
    }
28624         -
    }
28625         -
    /// By default, maybe-valid ISO-8601 date-times not conforming to RFC 3339
28626         -
    /// are rejected with a 400 SerializationException
28627         -
    /// Test ID: RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case14
       28818  +
    /// Document types can be JSON arrays.
       28819  +
    /// Test ID: DocumentOutputArray
28628  28820   
    #[::tokio::test]
28629         -
    async fn rest_json_query_timestamp_default_rejects_different8601_formats_case14_malformed_request(
28630         -
    ) {
28631         -
        {
28632         -
            #[allow(unused_mut)]
28633         -
            let mut http_request = http::Request::builder()
28634         -
                .uri("/MalformedTimestampQueryDefault")
28635         -
                .method("POST")
28636         -
                .body(::aws_smithy_http_server::body::Body::empty())
28637         -
                .unwrap();
28638         -
            *http_request.uri_mut() =
28639         -
                "/MalformedTimestampQueryDefault?timestamp=2011-12-03T10:15:30+01:00[Europe/Paris]"
28640         -
                    .parse()
28641         -
                    .unwrap();
28642         -
            #[allow(unused_mut)]
28643         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28644         -
            let config = crate::service::RestJsonConfig::builder().build();
28645         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28646         -
                            .malformed_timestamp_query_default(move |input: crate::input::MalformedTimestampQueryDefaultInput| {
28647         -
                                let sender = sender.clone();
28648         -
                                async move {
28649         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryDefaultOutput, crate::error::MalformedTimestampQueryDefaultError> };
28650         -
                                    sender.send(()).await.expect("receiver dropped early");
28651         -
                                    result
28652         -
                                }
28653         -
                            })
28654         -
                            .build_unchecked();
28655         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28656         -
                .await
28657         -
                .expect("unable to make an HTTP request");
       28821  +
    #[::tracing_test::traced_test]
       28822  +
    async fn document_output_array_response() {
       28823  +
        let output = crate::output::DocumentTypeOutput {
       28824  +
            string_value: ::std::option::Option::Some("string".to_owned()),
       28825  +
            document_value: ::std::option::Option::Some({
       28826  +
                let json_bytes = br#"[
       28827  +
                            true,
       28828  +
                            false
       28829  +
                        ]"#;
       28830  +
                let mut tokens =
       28831  +
                    ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
       28832  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens)
       28833  +
                    .expect("well formed json")
       28834  +
            }),
       28835  +
        };
       28836  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28837  +
        let http_response = output.into_response();
28658  28838   
        ::pretty_assertions::assert_eq!(
28659         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28839  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28660  28840   
            http_response.status()
28661  28841   
        );
28662         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       28842  +
        let expected_headers = [("Content-Type", "application/json")];
28663  28843   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28664  28844   
            http_response.headers(),
28665  28845   
            expected_headers,
28666  28846   
        ));
       28847  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       28848  +
            .await
       28849  +
            .expect("unable to extract body to bytes");
       28850  +
        ::aws_smithy_protocol_test::assert_ok(
       28851  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"stringValue\": \"string\",\n    \"documentValue\": [\n        true,\n        false\n    ]\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       28852  +
        );
28667  28853   
    }
       28854  +
}
       28855  +
       28856  +
const CONTENT_TYPE_JSONBLOBS: ::mime::Mime = ::mime::APPLICATION_JSON;
       28857  +
::pin_project_lite::pin_project! {
       28858  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       28859  +
    /// [`JsonBlobsInput`](crate::input::JsonBlobsInput) using modelled bindings.
       28860  +
    pub struct JsonBlobsInputFuture {
       28861  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonBlobsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
28668  28862   
    }
28669  28863   
}
28670         -
#[cfg(test)]
       28864  +
       28865  +
impl std::future::Future for JsonBlobsInputFuture {
       28866  +
    type Output = Result<
       28867  +
        crate::input::JsonBlobsInput,
       28868  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       28869  +
    >;
       28870  +
       28871  +
    fn poll(
       28872  +
        self: std::pin::Pin<&mut Self>,
       28873  +
        cx: &mut std::task::Context<'_>,
       28874  +
    ) -> std::task::Poll<Self::Output> {
       28875  +
        let this = self.project();
       28876  +
        this.inner.as_mut().poll(cx)
       28877  +
    }
       28878  +
}
       28879  +
       28880  +
impl<B>
       28881  +
    ::aws_smithy_http_server::request::FromRequest<
       28882  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       28883  +
        B,
       28884  +
    > for crate::input::JsonBlobsInput
       28885  +
where
       28886  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       28887  +
    B: 'static,
       28888  +
       28889  +
    B::Data: Send,
       28890  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       28891  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       28892  +
{
       28893  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       28894  +
    type Future = JsonBlobsInputFuture;
       28895  +
       28896  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       28897  +
        let fut = async move {
       28898  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       28899  +
                request.headers(),
       28900  +
                &CONTENT_TYPE_JSONBLOBS,
       28901  +
            ) {
       28902  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       28903  +
            }
       28904  +
            crate::protocol_serde::shape_json_blobs::de_json_blobs_http_request(request)
       28905  +
                .await
       28906  +
                .map_err(Into::into)
       28907  +
        };
       28908  +
        use ::futures_util::future::TryFutureExt;
       28909  +
        let fut = fut.map_err(
       28910  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       28911  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       28912  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       28913  +
                    e,
       28914  +
                )
       28915  +
            },
       28916  +
        );
       28917  +
        JsonBlobsInputFuture {
       28918  +
            inner: Box::pin(fut),
       28919  +
        }
       28920  +
    }
       28921  +
}
       28922  +
impl
       28923  +
    ::aws_smithy_http_server::response::IntoResponse<
       28924  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       28925  +
    > for crate::output::JsonBlobsOutput
       28926  +
{
       28927  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       28928  +
        match crate::protocol_serde::shape_json_blobs::ser_json_blobs_http_response(self) {
       28929  +
            Ok(response) => response,
       28930  +
            Err(e) => {
       28931  +
                ::tracing::error!(error = %e, "failed to serialize response");
       28932  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       28933  +
            }
       28934  +
        }
       28935  +
    }
       28936  +
}
       28937  +
28671  28938   
#[allow(unreachable_code, unused_variables)]
28672         -
mod server_malformed_timestamp_query_epoch_test {
28673         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
28674         -
    /// 400 SerializationException
28675         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case0
       28939  +
#[cfg(test)]
       28940  +
mod json_blobs_test {
       28941  +
       28942  +
    /// Blobs are base64 encoded
       28943  +
    /// Test ID: RestJsonJsonBlobs
28676  28944   
    #[::tokio::test]
28677         -
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case0_malformed_request() {
28678         -
        {
       28945  +
    #[::tracing_test::traced_test]
       28946  +
    async fn rest_json_json_blobs_request() {
28679  28947   
        #[allow(unused_mut)]
28680  28948   
        let mut http_request = http::Request::builder()
28681         -
                .uri("/MalformedTimestampQueryEpoch")
       28949  +
            .uri("/JsonBlobs")
28682  28950   
            .method("POST")
28683         -
                .body(::aws_smithy_http_server::body::Body::empty())
28684         -
                .unwrap();
28685         -
            *http_request.uri_mut() =
28686         -
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50.52Z"
28687         -
                    .parse()
       28951  +
            .header("Content-Type", "application/json")
       28952  +
            .body(::aws_smithy_http_server::body::Body::from(
       28953  +
                ::bytes::Bytes::from_static("{\n    \"data\": \"dmFsdWU=\"\n}".as_bytes()),
       28954  +
            ))
28688  28955   
            .unwrap();
28689  28956   
        #[allow(unused_mut)]
28690  28957   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28691  28958   
        let config = crate::service::RestJsonConfig::builder().build();
28692  28959   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28693         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       28960  +
            .json_blobs(move |input: crate::input::JsonBlobsInput| {
28694  28961   
                let sender = sender.clone();
28695  28962   
                async move {
28696         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
       28963  +
                    let result = {
       28964  +
                        let expected = crate::input::JsonBlobsInput {
       28965  +
                            data: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
       28966  +
                                "value",
       28967  +
                            )),
       28968  +
                        };
       28969  +
                        ::pretty_assertions::assert_eq!(input, expected);
       28970  +
                        let response = crate::output::JsonBlobsOutput {
       28971  +
                            data: ::std::option::Option::None,
       28972  +
                        };
       28973  +
                        response
       28974  +
                    };
28697  28975   
                    sender.send(()).await.expect("receiver dropped early");
28698  28976   
                    result
28699  28977   
                }
28700  28978   
            })
28701  28979   
            .build_unchecked();
28702  28980   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28703  28981   
            .await
28704  28982   
            .expect("unable to make an HTTP request");
       28983  +
        assert!(
       28984  +
            receiver.recv().await.is_some(),
       28985  +
            "we expected operation handler to be invoked but it was not entered"
       28986  +
        );
       28987  +
    }
       28988  +
    /// Blobs are base64 encoded
       28989  +
    /// Test ID: RestJsonJsonBlobs
       28990  +
    #[::tokio::test]
       28991  +
    #[::tracing_test::traced_test]
       28992  +
    async fn rest_json_json_blobs_response() {
       28993  +
        let output = crate::output::JsonBlobsOutput {
       28994  +
            data: ::std::option::Option::Some(::aws_smithy_types::Blob::new("value")),
       28995  +
        };
       28996  +
        use ::aws_smithy_http_server::response::IntoResponse;
       28997  +
        let http_response = output.into_response();
28705  28998   
        ::pretty_assertions::assert_eq!(
28706         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       28999  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28707  29000   
            http_response.status()
28708  29001   
        );
28709         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       29002  +
        let expected_headers = [("Content-Type", "application/json")];
28710  29003   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28711  29004   
            http_response.headers(),
28712  29005   
            expected_headers,
28713  29006   
        ));
       29007  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       29008  +
            .await
       29009  +
            .expect("unable to extract body to bytes");
       29010  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       29011  +
            &body,
       29012  +
            "{\n    \"data\": \"dmFsdWU=\"\n}",
       29013  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       29014  +
        ));
28714  29015   
    }
       29016  +
}
       29017  +
       29018  +
const CONTENT_TYPE_SPARSEJSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
       29019  +
::pin_project_lite::pin_project! {
       29020  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       29021  +
    /// [`SparseJsonMapsInput`](crate::input::SparseJsonMapsInput) using modelled bindings.
       29022  +
    pub struct SparseJsonMapsInputFuture {
       29023  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SparseJsonMapsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
28715  29024   
    }
28716         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
28717         -
    /// 400 SerializationException
28718         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case1
28719         -
    #[::tokio::test]
28720         -
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case1_malformed_request() {
       29025  +
}
       29026  +
       29027  +
impl std::future::Future for SparseJsonMapsInputFuture {
       29028  +
    type Output = Result<
       29029  +
        crate::input::SparseJsonMapsInput,
       29030  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       29031  +
    >;
       29032  +
       29033  +
    fn poll(
       29034  +
        self: std::pin::Pin<&mut Self>,
       29035  +
        cx: &mut std::task::Context<'_>,
       29036  +
    ) -> std::task::Poll<Self::Output> {
       29037  +
        let this = self.project();
       29038  +
        this.inner.as_mut().poll(cx)
       29039  +
    }
       29040  +
}
       29041  +
       29042  +
impl<B>
       29043  +
    ::aws_smithy_http_server::request::FromRequest<
       29044  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       29045  +
        B,
       29046  +
    > for crate::input::SparseJsonMapsInput
       29047  +
where
       29048  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       29049  +
    B: 'static,
       29050  +
       29051  +
    B::Data: Send,
       29052  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       29053  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       29054  +
{
       29055  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       29056  +
    type Future = SparseJsonMapsInputFuture;
       29057  +
       29058  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       29059  +
        let fut = async move {
       29060  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       29061  +
                request.headers(),
       29062  +
                &CONTENT_TYPE_SPARSEJSONMAPS,
       29063  +
            ) {
       29064  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       29065  +
            }
       29066  +
            crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps_http_request(request)
       29067  +
                .await
       29068  +
                .map_err(Into::into)
       29069  +
        };
       29070  +
        use ::futures_util::future::TryFutureExt;
       29071  +
        let fut = fut.map_err(
       29072  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       29073  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       29074  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       29075  +
                    e,
       29076  +
                )
       29077  +
            },
       29078  +
        );
       29079  +
        SparseJsonMapsInputFuture {
       29080  +
            inner: Box::pin(fut),
       29081  +
        }
       29082  +
    }
       29083  +
}
       29084  +
impl
       29085  +
    ::aws_smithy_http_server::response::IntoResponse<
       29086  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       29087  +
    > for crate::output::SparseJsonMapsOutput
       29088  +
{
       29089  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       29090  +
        match crate::protocol_serde::shape_sparse_json_maps::ser_sparse_json_maps_http_response(
       29091  +
            self,
       29092  +
        ) {
       29093  +
            Ok(response) => response,
       29094  +
            Err(e) => {
       29095  +
                ::tracing::error!(error = %e, "failed to serialize response");
       29096  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       29097  +
            }
       29098  +
        }
       29099  +
    }
       29100  +
}
       29101  +
impl
       29102  +
    ::aws_smithy_http_server::response::IntoResponse<
       29103  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       29104  +
    > for crate::error::SparseJsonMapsError
       29105  +
{
       29106  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       29107  +
        match crate::protocol_serde::shape_sparse_json_maps::ser_sparse_json_maps_http_error(&self)
28721  29108   
        {
       29109  +
            Ok(mut response) => {
       29110  +
                response.extensions_mut().insert(
       29111  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       29112  +
                );
       29113  +
                response
       29114  +
            }
       29115  +
            Err(e) => {
       29116  +
                ::tracing::error!(error = %e, "failed to serialize response");
       29117  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       29118  +
            }
       29119  +
        }
       29120  +
    }
       29121  +
}
       29122  +
       29123  +
#[allow(unreachable_code, unused_variables)]
       29124  +
#[cfg(test)]
       29125  +
mod sparse_json_maps_test {
       29126  +
       29127  +
    /// Serializes JSON maps
       29128  +
    /// Test ID: RestJsonSparseJsonMaps
       29129  +
    #[::tokio::test]
       29130  +
    #[::tracing_test::traced_test]
       29131  +
    async fn rest_json_sparse_json_maps_request() {
28722  29132   
        #[allow(unused_mut)]
28723  29133   
                    let mut http_request = http::Request::builder()
28724         -
                .uri("/MalformedTimestampQueryEpoch")
       29134  +
                        .uri("/SparseJsonMaps")
28725  29135   
                        .method("POST")
28726         -
                .body(::aws_smithy_http_server::body::Body::empty())
28727         -
                .unwrap();
28728         -
            *http_request.uri_mut() =
28729         -
                "/MalformedTimestampQueryEpoch?timestamp=1985-04-12T23%3A20%3A50Z"
28730         -
                    .parse()
28731         -
                    .unwrap();
       29136  +
        .header("Content-Type", "application/json")
       29137  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}".as_bytes()))).unwrap();
28732  29138   
        #[allow(unused_mut)]
28733  29139   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28734  29140   
        let config = crate::service::RestJsonConfig::builder().build();
28735  29141   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28736         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       29142  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
28737  29143   
                let sender = sender.clone();
28738  29144   
                async move {
28739         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
       29145  +
                    let result = {
       29146  +
                        let expected = crate::input::SparseJsonMapsInput {
       29147  +
                            sparse_struct_map: ::std::option::Option::Some({
       29148  +
                                let mut ret = ::std::collections::HashMap::new();
       29149  +
                                ret.insert(
       29150  +
                                    "foo".to_owned(),
       29151  +
                                    ::std::option::Option::Some(crate::model::GreetingStruct {
       29152  +
                                        hi: ::std::option::Option::Some("there".to_owned()),
       29153  +
                                    }),
       29154  +
                                );
       29155  +
                                ret.insert(
       29156  +
                                    "baz".to_owned(),
       29157  +
                                    ::std::option::Option::Some(crate::model::GreetingStruct {
       29158  +
                                        hi: ::std::option::Option::Some("bye".to_owned()),
       29159  +
                                    }),
       29160  +
                                );
       29161  +
                                ret
       29162  +
                            }),
       29163  +
                            sparse_number_map: ::std::option::Option::None,
       29164  +
                            sparse_boolean_map: ::std::option::Option::None,
       29165  +
                            sparse_string_map: ::std::option::Option::None,
       29166  +
                            sparse_set_map: ::std::option::Option::None,
       29167  +
                        };
       29168  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29169  +
                        let response = crate::output::SparseJsonMapsOutput {
       29170  +
                            sparse_struct_map: ::std::option::Option::None,
       29171  +
                            sparse_number_map: ::std::option::Option::None,
       29172  +
                            sparse_boolean_map: ::std::option::Option::None,
       29173  +
                            sparse_string_map: ::std::option::Option::None,
       29174  +
                            sparse_set_map: ::std::option::Option::None,
       29175  +
                        };
       29176  +
                        Ok(response)
       29177  +
                    };
28740  29178   
                    sender.send(()).await.expect("receiver dropped early");
28741  29179   
                    result
28742  29180   
                }
28743  29181   
            })
28744  29182   
            .build_unchecked();
28745  29183   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28746  29184   
            .await
28747  29185   
            .expect("unable to make an HTTP request");
28748         -
            ::pretty_assertions::assert_eq!(
28749         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28750         -
                http_response.status()
       29186  +
        assert!(
       29187  +
            receiver.recv().await.is_some(),
       29188  +
            "we expected operation handler to be invoked but it was not entered"
28751  29189   
        );
28752         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28753         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28754         -
                http_response.headers(),
28755         -
                expected_headers,
28756         -
            ));
28757         -
        }
28758  29190   
    }
28759         -
    /// When the format is epoch-seconds, RFC3339 timestamps are rejected with a
28760         -
    /// 400 SerializationException
28761         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsDateTime_case2
       29191  +
    /// Serializes JSON map values in sparse maps
       29192  +
    /// Test ID: RestJsonSerializesSparseNullMapValues
28762  29193   
    #[::tokio::test]
28763         -
    async fn rest_json_query_timestamp_epoch_rejects_date_time_case2_malformed_request() {
28764         -
        {
       29194  +
    #[::tracing_test::traced_test]
       29195  +
    async fn rest_json_serializes_sparse_null_map_values_request() {
28765  29196   
        #[allow(unused_mut)]
28766  29197   
                    let mut http_request = http::Request::builder()
28767         -
                .uri("/MalformedTimestampQueryEpoch")
       29198  +
                        .uri("/SparseJsonMaps")
28768  29199   
                        .method("POST")
28769         -
                .body(::aws_smithy_http_server::body::Body::empty())
28770         -
                .unwrap();
28771         -
            *http_request.uri_mut() =
28772         -
                "/MalformedTimestampQueryEpoch?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
28773         -
                    .parse()
28774         -
                    .unwrap();
       29200  +
        .header("Content-Type", "application/json")
       29201  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseBooleanMap\": {\n        \"x\": null\n    },\n    \"sparseNumberMap\": {\n        \"x\": null\n    },\n    \"sparseStringMap\": {\n        \"x\": null\n    },\n    \"sparseStructMap\": {\n        \"x\": null\n    }\n}".as_bytes()))).unwrap();
28775  29202   
        #[allow(unused_mut)]
28776  29203   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28777  29204   
        let config = crate::service::RestJsonConfig::builder().build();
28778  29205   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28779         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       29206  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
28780  29207   
                let sender = sender.clone();
28781  29208   
                async move {
28782         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
       29209  +
                    let result = {
       29210  +
                        let expected = crate::input::SparseJsonMapsInput {
       29211  +
                            sparse_boolean_map: ::std::option::Option::Some({
       29212  +
                                let mut ret = ::std::collections::HashMap::new();
       29213  +
                                ret.insert("x".to_owned(), ::std::option::Option::None);
       29214  +
                                ret
       29215  +
                            }),
       29216  +
                            sparse_number_map: ::std::option::Option::Some({
       29217  +
                                let mut ret = ::std::collections::HashMap::new();
       29218  +
                                ret.insert("x".to_owned(), ::std::option::Option::None);
       29219  +
                                ret
       29220  +
                            }),
       29221  +
                            sparse_string_map: ::std::option::Option::Some({
       29222  +
                                let mut ret = ::std::collections::HashMap::new();
       29223  +
                                ret.insert("x".to_owned(), ::std::option::Option::None);
       29224  +
                                ret
       29225  +
                            }),
       29226  +
                            sparse_struct_map: ::std::option::Option::Some({
       29227  +
                                let mut ret = ::std::collections::HashMap::new();
       29228  +
                                ret.insert("x".to_owned(), ::std::option::Option::None);
       29229  +
                                ret
       29230  +
                            }),
       29231  +
                            sparse_set_map: ::std::option::Option::None,
       29232  +
                        };
       29233  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29234  +
                        let response = crate::output::SparseJsonMapsOutput {
       29235  +
                            sparse_struct_map: ::std::option::Option::None,
       29236  +
                            sparse_number_map: ::std::option::Option::None,
       29237  +
                            sparse_boolean_map: ::std::option::Option::None,
       29238  +
                            sparse_string_map: ::std::option::Option::None,
       29239  +
                            sparse_set_map: ::std::option::Option::None,
       29240  +
                        };
       29241  +
                        Ok(response)
       29242  +
                    };
28783  29243   
                    sender.send(()).await.expect("receiver dropped early");
28784  29244   
                    result
28785  29245   
                }
28786  29246   
            })
28787  29247   
            .build_unchecked();
28788  29248   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28789  29249   
            .await
28790  29250   
            .expect("unable to make an HTTP request");
28791         -
            ::pretty_assertions::assert_eq!(
28792         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28793         -
                http_response.status()
       29251  +
        assert!(
       29252  +
            receiver.recv().await.is_some(),
       29253  +
            "we expected operation handler to be invoked but it was not entered"
28794  29254   
        );
28795         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28796         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28797         -
                http_response.headers(),
28798         -
                expected_headers,
28799         -
            ));
28800  29255   
    }
28801         -
    }
28802         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
28803         -
    /// 400 SerializationException
28804         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case0
       29256  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       29257  +
    /// Test ID: RestJsonSerializesZeroValuesInSparseMaps
28805  29258   
    #[::tokio::test]
28806         -
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case0_malformed_request() {
28807         -
        {
       29259  +
    #[::tracing_test::traced_test]
       29260  +
    async fn rest_json_serializes_zero_values_in_sparse_maps_request() {
28808  29261   
        #[allow(unused_mut)]
28809  29262   
                    let mut http_request = http::Request::builder()
28810         -
                .uri("/MalformedTimestampQueryEpoch")
       29263  +
                        .uri("/SparseJsonMaps")
28811  29264   
                        .method("POST")
28812         -
                .body(::aws_smithy_http_server::body::Body::empty())
28813         -
                .unwrap();
28814         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Tue%2C%2029%20Apr%202014%2018%3A30%3A38%20GMT".parse().unwrap();
       29265  +
        .header("Content-Type", "application/json")
       29266  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseNumberMap\": {\n        \"x\": 0\n    },\n    \"sparseBooleanMap\": {\n        \"x\": false\n    }\n}".as_bytes()))).unwrap();
28815  29267   
        #[allow(unused_mut)]
28816  29268   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28817  29269   
        let config = crate::service::RestJsonConfig::builder().build();
28818  29270   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28819         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       29271  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
28820  29272   
                let sender = sender.clone();
28821  29273   
                async move {
28822         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
       29274  +
                    let result = {
       29275  +
                        let expected = crate::input::SparseJsonMapsInput {
       29276  +
                            sparse_number_map: ::std::option::Option::Some({
       29277  +
                                let mut ret = ::std::collections::HashMap::new();
       29278  +
                                ret.insert("x".to_owned(), ::std::option::Option::Some(0));
       29279  +
                                ret
       29280  +
                            }),
       29281  +
                            sparse_boolean_map: ::std::option::Option::Some({
       29282  +
                                let mut ret = ::std::collections::HashMap::new();
       29283  +
                                ret.insert("x".to_owned(), ::std::option::Option::Some(false));
       29284  +
                                ret
       29285  +
                            }),
       29286  +
                            sparse_struct_map: ::std::option::Option::None,
       29287  +
                            sparse_string_map: ::std::option::Option::None,
       29288  +
                            sparse_set_map: ::std::option::Option::None,
       29289  +
                        };
       29290  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29291  +
                        let response = crate::output::SparseJsonMapsOutput {
       29292  +
                            sparse_struct_map: ::std::option::Option::None,
       29293  +
                            sparse_number_map: ::std::option::Option::None,
       29294  +
                            sparse_boolean_map: ::std::option::Option::None,
       29295  +
                            sparse_string_map: ::std::option::Option::None,
       29296  +
                            sparse_set_map: ::std::option::Option::None,
       29297  +
                        };
       29298  +
                        Ok(response)
       29299  +
                    };
28823  29300   
                    sender.send(()).await.expect("receiver dropped early");
28824  29301   
                    result
28825  29302   
                }
28826  29303   
            })
28827  29304   
            .build_unchecked();
28828  29305   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28829  29306   
            .await
28830  29307   
            .expect("unable to make an HTTP request");
28831         -
            ::pretty_assertions::assert_eq!(
28832         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28833         -
                http_response.status()
       29308  +
        assert!(
       29309  +
            receiver.recv().await.is_some(),
       29310  +
            "we expected operation handler to be invoked but it was not entered"
28834  29311   
        );
28835         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28836         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28837         -
                http_response.headers(),
28838         -
                expected_headers,
28839         -
            ));
28840  29312   
    }
28841         -
    }
28842         -
    /// When the format is epoch-seconds, IMF-fixdate timestamps are rejected with a
28843         -
    /// 400 SerializationException
28844         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsHttpDate_case1
       29313  +
    /// A request that contains a sparse map of sets
       29314  +
    /// Test ID: RestJsonSerializesSparseSetMap
28845  29315   
    #[::tokio::test]
28846         -
    async fn rest_json_query_timestamp_epoch_rejects_http_date_case1_malformed_request() {
28847         -
        {
       29316  +
    #[::tracing_test::traced_test]
       29317  +
    async fn rest_json_serializes_sparse_set_map_request() {
28848  29318   
        #[allow(unused_mut)]
28849  29319   
                    let mut http_request = http::Request::builder()
28850         -
                .uri("/MalformedTimestampQueryEpoch")
       29320  +
                        .uri("/SparseJsonMaps")
28851  29321   
                        .method("POST")
28852         -
                .body(::aws_smithy_http_server::body::Body::empty())
28853         -
                .unwrap();
28854         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Sun%2C%2002%20Jan%202000%2020%3A34%3A56.000%20GMT".parse().unwrap();
       29322  +
        .header("Content-Type", "application/json")
       29323  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}".as_bytes()))).unwrap();
28855  29324   
        #[allow(unused_mut)]
28856  29325   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28857  29326   
        let config = crate::service::RestJsonConfig::builder().build();
28858  29327   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28859         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       29328  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
28860  29329   
                let sender = sender.clone();
28861  29330   
                async move {
28862         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
       29331  +
                    let result = {
       29332  +
                        let expected = crate::input::SparseJsonMapsInput {
       29333  +
                            sparse_set_map: ::std::option::Option::Some({
       29334  +
                                let mut ret = ::std::collections::HashMap::new();
       29335  +
                                ret.insert(
       29336  +
                                    "x".to_owned(),
       29337  +
                                    ::std::option::Option::Some(
       29338  +
                                        vec![].try_into().expect("this is only used in tests"),
       29339  +
                                    ),
       29340  +
                                );
       29341  +
                                ret.insert(
       29342  +
                                    "y".to_owned(),
       29343  +
                                    ::std::option::Option::Some(
       29344  +
                                        vec!["a".to_owned(), "b".to_owned()]
       29345  +
                                            .try_into()
       29346  +
                                            .expect("this is only used in tests"),
       29347  +
                                    ),
       29348  +
                                );
       29349  +
                                ret
       29350  +
                            }),
       29351  +
                            sparse_struct_map: ::std::option::Option::None,
       29352  +
                            sparse_number_map: ::std::option::Option::None,
       29353  +
                            sparse_boolean_map: ::std::option::Option::None,
       29354  +
                            sparse_string_map: ::std::option::Option::None,
       29355  +
                        };
       29356  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29357  +
                        let response = crate::output::SparseJsonMapsOutput {
       29358  +
                            sparse_struct_map: ::std::option::Option::None,
       29359  +
                            sparse_number_map: ::std::option::Option::None,
       29360  +
                            sparse_boolean_map: ::std::option::Option::None,
       29361  +
                            sparse_string_map: ::std::option::Option::None,
       29362  +
                            sparse_set_map: ::std::option::Option::None,
       29363  +
                        };
       29364  +
                        Ok(response)
       29365  +
                    };
28863  29366   
                    sender.send(()).await.expect("receiver dropped early");
28864  29367   
                    result
28865  29368   
                }
28866  29369   
            })
28867  29370   
            .build_unchecked();
28868  29371   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28869  29372   
            .await
28870  29373   
            .expect("unable to make an HTTP request");
28871         -
            ::pretty_assertions::assert_eq!(
28872         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28873         -
                http_response.status()
       29374  +
        assert!(
       29375  +
            receiver.recv().await.is_some(),
       29376  +
            "we expected operation handler to be invoked but it was not entered"
28874  29377   
        );
28875         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28876         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28877         -
                http_response.headers(),
28878         -
                expected_headers,
28879         -
            ));
28880         -
        }
28881  29378   
    }
28882         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
28883         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case0
       29379  +
    /// A request that contains a sparse map of sets.
       29380  +
    /// Test ID: RestJsonSerializesSparseSetMapAndRetainsNull
28884  29381   
    #[::tokio::test]
28885         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case0_malformed_request() {
28886         -
        {
       29382  +
    #[::tracing_test::traced_test]
       29383  +
    async fn rest_json_serializes_sparse_set_map_and_retains_null_request() {
28887  29384   
        #[allow(unused_mut)]
28888  29385   
                    let mut http_request = http::Request::builder()
28889         -
                .uri("/MalformedTimestampQueryEpoch")
       29386  +
                        .uri("/SparseJsonMaps")
28890  29387   
                        .method("POST")
28891         -
                .body(::aws_smithy_http_server::body::Body::empty())
28892         -
                .unwrap();
28893         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=true"
28894         -
                .parse()
28895         -
                .unwrap();
       29388  +
        .header("Content-Type", "application/json")
       29389  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"],\n        \"z\": null\n    }\n}".as_bytes()))).unwrap();
28896  29390   
        #[allow(unused_mut)]
28897  29391   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28898  29392   
        let config = crate::service::RestJsonConfig::builder().build();
28899  29393   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28900         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
       29394  +
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
28901  29395   
                let sender = sender.clone();
28902  29396   
                async move {
28903         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
       29397  +
                    let result = {
       29398  +
                        let expected = crate::input::SparseJsonMapsInput {
       29399  +
                            sparse_set_map: ::std::option::Option::Some({
       29400  +
                                let mut ret = ::std::collections::HashMap::new();
       29401  +
                                ret.insert(
       29402  +
                                    "x".to_owned(),
       29403  +
                                    ::std::option::Option::Some(
       29404  +
                                        vec![].try_into().expect("this is only used in tests"),
       29405  +
                                    ),
       29406  +
                                );
       29407  +
                                ret.insert(
       29408  +
                                    "y".to_owned(),
       29409  +
                                    ::std::option::Option::Some(
       29410  +
                                        vec!["a".to_owned(), "b".to_owned()]
       29411  +
                                            .try_into()
       29412  +
                                            .expect("this is only used in tests"),
       29413  +
                                    ),
       29414  +
                                );
       29415  +
                                ret.insert("z".to_owned(), ::std::option::Option::None);
       29416  +
                                ret
       29417  +
                            }),
       29418  +
                            sparse_struct_map: ::std::option::Option::None,
       29419  +
                            sparse_number_map: ::std::option::Option::None,
       29420  +
                            sparse_boolean_map: ::std::option::Option::None,
       29421  +
                            sparse_string_map: ::std::option::Option::None,
       29422  +
                        };
       29423  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29424  +
                        let response = crate::output::SparseJsonMapsOutput {
       29425  +
                            sparse_struct_map: ::std::option::Option::None,
       29426  +
                            sparse_number_map: ::std::option::Option::None,
       29427  +
                            sparse_boolean_map: ::std::option::Option::None,
       29428  +
                            sparse_string_map: ::std::option::Option::None,
       29429  +
                            sparse_set_map: ::std::option::Option::None,
       29430  +
                        };
       29431  +
                        Ok(response)
       29432  +
                    };
28904  29433   
                    sender.send(()).await.expect("receiver dropped early");
28905  29434   
                    result
28906  29435   
                }
28907  29436   
            })
28908  29437   
            .build_unchecked();
28909  29438   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28910  29439   
            .await
28911  29440   
            .expect("unable to make an HTTP request");
28912         -
            ::pretty_assertions::assert_eq!(
28913         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
28914         -
                http_response.status()
       29441  +
        assert!(
       29442  +
            receiver.recv().await.is_some(),
       29443  +
            "we expected operation handler to be invoked but it was not entered"
28915  29444   
        );
28916         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
28917         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28918         -
                http_response.headers(),
28919         -
                expected_headers,
28920         -
            ));
28921  29445   
    }
28922         -
    }
28923         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
28924         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case1
       29446  +
    /// Deserializes JSON maps
       29447  +
    /// Test ID: RestJsonSparseJsonMaps
28925  29448   
    #[::tokio::test]
28926         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case1_malformed_request() {
28927         -
        {
28928         -
            #[allow(unused_mut)]
28929         -
            let mut http_request = http::Request::builder()
28930         -
                .uri("/MalformedTimestampQueryEpoch")
28931         -
                .method("POST")
28932         -
                .body(::aws_smithy_http_server::body::Body::empty())
28933         -
                .unwrap();
28934         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081ABC"
28935         -
                .parse()
28936         -
                .unwrap();
28937         -
            #[allow(unused_mut)]
28938         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28939         -
            let config = crate::service::RestJsonConfig::builder().build();
28940         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28941         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
28942         -
                                let sender = sender.clone();
28943         -
                                async move {
28944         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
28945         -
                                    sender.send(()).await.expect("receiver dropped early");
28946         -
                                    result
28947         -
                                }
28948         -
                            })
28949         -
                            .build_unchecked();
28950         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28951         -
                .await
28952         -
                .expect("unable to make an HTTP request");
       29449  +
    #[::tracing_test::traced_test]
       29450  +
    async fn rest_json_sparse_json_maps_response() {
       29451  +
        let output = crate::output::SparseJsonMapsOutput {
       29452  +
            sparse_struct_map: ::std::option::Option::Some({
       29453  +
                let mut ret = ::std::collections::HashMap::new();
       29454  +
                ret.insert(
       29455  +
                    "foo".to_owned(),
       29456  +
                    ::std::option::Option::Some(crate::model::GreetingStruct {
       29457  +
                        hi: ::std::option::Option::Some("there".to_owned()),
       29458  +
                    }),
       29459  +
                );
       29460  +
                ret.insert(
       29461  +
                    "baz".to_owned(),
       29462  +
                    ::std::option::Option::Some(crate::model::GreetingStruct {
       29463  +
                        hi: ::std::option::Option::Some("bye".to_owned()),
       29464  +
                    }),
       29465  +
                );
       29466  +
                ret
       29467  +
            }),
       29468  +
            sparse_number_map: ::std::option::Option::None,
       29469  +
            sparse_boolean_map: ::std::option::Option::None,
       29470  +
            sparse_string_map: ::std::option::Option::None,
       29471  +
            sparse_set_map: ::std::option::Option::None,
       29472  +
        };
       29473  +
        use ::aws_smithy_http_server::response::IntoResponse;
       29474  +
        let http_response = output.into_response();
28953  29475   
        ::pretty_assertions::assert_eq!(
28954         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       29476  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28955  29477   
            http_response.status()
28956  29478   
        );
28957         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       29479  +
        let expected_headers = [("Content-Type", "application/json")];
28958  29480   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
28959  29481   
            http_response.headers(),
28960  29482   
            expected_headers,
28961  29483   
        ));
       29484  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       29485  +
            .await
       29486  +
            .expect("unable to extract body to bytes");
       29487  +
        ::aws_smithy_protocol_test::assert_ok(
       29488  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n   }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       29489  +
        );
28962  29490   
    }
28963         -
    }
28964         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
28965         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case2
       29491  +
    /// Deserializes null JSON map values
       29492  +
    /// Test ID: RestJsonDeserializesSparseNullMapValues
28966  29493   
    #[::tokio::test]
28967         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case2_malformed_request() {
28968         -
        {
28969         -
            #[allow(unused_mut)]
28970         -
            let mut http_request = http::Request::builder()
28971         -
                .uri("/MalformedTimestampQueryEpoch")
28972         -
                .method("POST")
28973         -
                .body(::aws_smithy_http_server::body::Body::empty())
28974         -
                .unwrap();
28975         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=0x42"
28976         -
                .parse()
28977         -
                .unwrap();
28978         -
            #[allow(unused_mut)]
28979         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
28980         -
            let config = crate::service::RestJsonConfig::builder().build();
28981         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
28982         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
28983         -
                                let sender = sender.clone();
28984         -
                                async move {
28985         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
28986         -
                                    sender.send(()).await.expect("receiver dropped early");
28987         -
                                    result
28988         -
                                }
28989         -
                            })
28990         -
                            .build_unchecked();
28991         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
28992         -
                .await
28993         -
                .expect("unable to make an HTTP request");
       29494  +
    #[::tracing_test::traced_test]
       29495  +
    async fn rest_json_deserializes_sparse_null_map_values_response() {
       29496  +
        let output = crate::output::SparseJsonMapsOutput {
       29497  +
            sparse_boolean_map: ::std::option::Option::Some({
       29498  +
                let mut ret = ::std::collections::HashMap::new();
       29499  +
                ret.insert("x".to_owned(), ::std::option::Option::None);
       29500  +
                ret
       29501  +
            }),
       29502  +
            sparse_number_map: ::std::option::Option::Some({
       29503  +
                let mut ret = ::std::collections::HashMap::new();
       29504  +
                ret.insert("x".to_owned(), ::std::option::Option::None);
       29505  +
                ret
       29506  +
            }),
       29507  +
            sparse_string_map: ::std::option::Option::Some({
       29508  +
                let mut ret = ::std::collections::HashMap::new();
       29509  +
                ret.insert("x".to_owned(), ::std::option::Option::None);
       29510  +
                ret
       29511  +
            }),
       29512  +
            sparse_struct_map: ::std::option::Option::Some({
       29513  +
                let mut ret = ::std::collections::HashMap::new();
       29514  +
                ret.insert("x".to_owned(), ::std::option::Option::None);
       29515  +
                ret
       29516  +
            }),
       29517  +
            sparse_set_map: ::std::option::Option::None,
       29518  +
        };
       29519  +
        use ::aws_smithy_http_server::response::IntoResponse;
       29520  +
        let http_response = output.into_response();
28994  29521   
        ::pretty_assertions::assert_eq!(
28995         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       29522  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
28996  29523   
            http_response.status()
28997  29524   
        );
28998         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       29525  +
        let expected_headers = [("Content-Type", "application/json")];
28999  29526   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29000  29527   
            http_response.headers(),
29001  29528   
            expected_headers,
29002  29529   
        ));
       29530  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       29531  +
            .await
       29532  +
            .expect("unable to extract body to bytes");
       29533  +
        ::aws_smithy_protocol_test::assert_ok(
       29534  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseBooleanMap\": {\n        \"x\": null\n    },\n    \"sparseNumberMap\": {\n        \"x\": null\n    },\n    \"sparseStringMap\": {\n        \"x\": null\n    },\n    \"sparseStructMap\": {\n        \"x\": null\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       29535  +
        );
29003  29536   
    }
29004         -
    }
29005         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29006         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case3
       29537  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       29538  +
    /// Test ID: RestJsonDeserializesZeroValuesInSparseMaps
29007  29539   
    #[::tokio::test]
29008         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case3_malformed_request() {
29009         -
        {
29010         -
            #[allow(unused_mut)]
29011         -
            let mut http_request = http::Request::builder()
29012         -
                .uri("/MalformedTimestampQueryEpoch")
29013         -
                .method("POST")
29014         -
                .body(::aws_smithy_http_server::body::Body::empty())
29015         -
                .unwrap();
29016         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=1515531081.123.456"
29017         -
                .parse()
29018         -
                .unwrap();
29019         -
            #[allow(unused_mut)]
29020         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29021         -
            let config = crate::service::RestJsonConfig::builder().build();
29022         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29023         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
29024         -
                                let sender = sender.clone();
29025         -
                                async move {
29026         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
29027         -
                                    sender.send(()).await.expect("receiver dropped early");
29028         -
                                    result
29029         -
                                }
29030         -
                            })
29031         -
                            .build_unchecked();
29032         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29033         -
                .await
29034         -
                .expect("unable to make an HTTP request");
       29540  +
    #[::tracing_test::traced_test]
       29541  +
    async fn rest_json_deserializes_zero_values_in_sparse_maps_response() {
       29542  +
        let output = crate::output::SparseJsonMapsOutput {
       29543  +
            sparse_number_map: ::std::option::Option::Some({
       29544  +
                let mut ret = ::std::collections::HashMap::new();
       29545  +
                ret.insert("x".to_owned(), ::std::option::Option::Some(0));
       29546  +
                ret
       29547  +
            }),
       29548  +
            sparse_boolean_map: ::std::option::Option::Some({
       29549  +
                let mut ret = ::std::collections::HashMap::new();
       29550  +
                ret.insert("x".to_owned(), ::std::option::Option::Some(false));
       29551  +
                ret
       29552  +
            }),
       29553  +
            sparse_struct_map: ::std::option::Option::None,
       29554  +
            sparse_string_map: ::std::option::Option::None,
       29555  +
            sparse_set_map: ::std::option::Option::None,
       29556  +
        };
       29557  +
        use ::aws_smithy_http_server::response::IntoResponse;
       29558  +
        let http_response = output.into_response();
29035  29559   
        ::pretty_assertions::assert_eq!(
29036         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       29560  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29037  29561   
            http_response.status()
29038  29562   
        );
29039         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       29563  +
        let expected_headers = [("Content-Type", "application/json")];
29040  29564   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29041  29565   
            http_response.headers(),
29042  29566   
            expected_headers,
29043  29567   
        ));
       29568  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       29569  +
            .await
       29570  +
            .expect("unable to extract body to bytes");
       29571  +
        ::aws_smithy_protocol_test::assert_ok(
       29572  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseNumberMap\": {\n        \"x\": 0\n    },\n    \"sparseBooleanMap\": {\n        \"x\": false\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       29573  +
        );
29044  29574   
    }
29045         -
    }
29046         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29047         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case4
       29575  +
    /// A response that contains a sparse map of sets
       29576  +
    /// Test ID: RestJsonDeserializesSparseSetMap
29048  29577   
    #[::tokio::test]
29049         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case4_malformed_request() {
29050         -
        {
29051         -
            #[allow(unused_mut)]
29052         -
            let mut http_request = http::Request::builder()
29053         -
                .uri("/MalformedTimestampQueryEpoch")
29054         -
                .method("POST")
29055         -
                .body(::aws_smithy_http_server::body::Body::empty())
29056         -
                .unwrap();
29057         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=Infinity"
29058         -
                .parse()
29059         -
                .unwrap();
29060         -
            #[allow(unused_mut)]
29061         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29062         -
            let config = crate::service::RestJsonConfig::builder().build();
29063         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29064         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
29065         -
                                let sender = sender.clone();
29066         -
                                async move {
29067         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
29068         -
                                    sender.send(()).await.expect("receiver dropped early");
29069         -
                                    result
29070         -
                                }
29071         -
                            })
29072         -
                            .build_unchecked();
29073         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29074         -
                .await
29075         -
                .expect("unable to make an HTTP request");
       29578  +
    #[::tracing_test::traced_test]
       29579  +
    async fn rest_json_deserializes_sparse_set_map_response() {
       29580  +
        let output = crate::output::SparseJsonMapsOutput {
       29581  +
            sparse_set_map: ::std::option::Option::Some({
       29582  +
                let mut ret = ::std::collections::HashMap::new();
       29583  +
                ret.insert(
       29584  +
                    "x".to_owned(),
       29585  +
                    ::std::option::Option::Some(
       29586  +
                        vec![].try_into().expect("this is only used in tests"),
       29587  +
                    ),
       29588  +
                );
       29589  +
                ret.insert(
       29590  +
                    "y".to_owned(),
       29591  +
                    ::std::option::Option::Some(
       29592  +
                        vec!["a".to_owned(), "b".to_owned()]
       29593  +
                            .try_into()
       29594  +
                            .expect("this is only used in tests"),
       29595  +
                    ),
       29596  +
                );
       29597  +
                ret
       29598  +
            }),
       29599  +
            sparse_struct_map: ::std::option::Option::None,
       29600  +
            sparse_number_map: ::std::option::Option::None,
       29601  +
            sparse_boolean_map: ::std::option::Option::None,
       29602  +
            sparse_string_map: ::std::option::Option::None,
       29603  +
        };
       29604  +
        use ::aws_smithy_http_server::response::IntoResponse;
       29605  +
        let http_response = output.into_response();
29076  29606   
        ::pretty_assertions::assert_eq!(
29077         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       29607  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29078  29608   
            http_response.status()
29079  29609   
        );
29080         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       29610  +
        let expected_headers = [("Content-Type", "application/json")];
29081  29611   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29082  29612   
            http_response.headers(),
29083  29613   
            expected_headers,
29084  29614   
        ));
       29615  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       29616  +
            .await
       29617  +
            .expect("unable to extract body to bytes");
       29618  +
        ::aws_smithy_protocol_test::assert_ok(
       29619  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       29620  +
        );
29085  29621   
    }
29086         -
    }
29087         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29088         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case5
       29622  +
    /// A response that contains a sparse map of sets.
       29623  +
    /// Test ID: RestJsonDeserializesSparseSetMapAndRetainsNull
29089  29624   
    #[::tokio::test]
29090         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case5_malformed_request() {
29091         -
        {
29092         -
            #[allow(unused_mut)]
29093         -
            let mut http_request = http::Request::builder()
29094         -
                .uri("/MalformedTimestampQueryEpoch")
29095         -
                .method("POST")
29096         -
                .body(::aws_smithy_http_server::body::Body::empty())
29097         -
                .unwrap();
29098         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=-Infinity"
29099         -
                .parse()
29100         -
                .unwrap();
29101         -
            #[allow(unused_mut)]
29102         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29103         -
            let config = crate::service::RestJsonConfig::builder().build();
29104         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29105         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
29106         -
                                let sender = sender.clone();
29107         -
                                async move {
29108         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
29109         -
                                    sender.send(()).await.expect("receiver dropped early");
29110         -
                                    result
29111         -
                                }
29112         -
                            })
29113         -
                            .build_unchecked();
29114         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29115         -
                .await
29116         -
                .expect("unable to make an HTTP request");
       29625  +
    #[::tracing_test::traced_test]
       29626  +
    async fn rest_json_deserializes_sparse_set_map_and_retains_null_response() {
       29627  +
        let output = crate::output::SparseJsonMapsOutput {
       29628  +
            sparse_set_map: ::std::option::Option::Some({
       29629  +
                let mut ret = ::std::collections::HashMap::new();
       29630  +
                ret.insert(
       29631  +
                    "x".to_owned(),
       29632  +
                    ::std::option::Option::Some(
       29633  +
                        vec![].try_into().expect("this is only used in tests"),
       29634  +
                    ),
       29635  +
                );
       29636  +
                ret.insert(
       29637  +
                    "y".to_owned(),
       29638  +
                    ::std::option::Option::Some(
       29639  +
                        vec!["a".to_owned(), "b".to_owned()]
       29640  +
                            .try_into()
       29641  +
                            .expect("this is only used in tests"),
       29642  +
                    ),
       29643  +
                );
       29644  +
                ret.insert("z".to_owned(), ::std::option::Option::None);
       29645  +
                ret
       29646  +
            }),
       29647  +
            sparse_struct_map: ::std::option::Option::None,
       29648  +
            sparse_number_map: ::std::option::Option::None,
       29649  +
            sparse_boolean_map: ::std::option::Option::None,
       29650  +
            sparse_string_map: ::std::option::Option::None,
       29651  +
        };
       29652  +
        use ::aws_smithy_http_server::response::IntoResponse;
       29653  +
        let http_response = output.into_response();
29117  29654   
        ::pretty_assertions::assert_eq!(
29118         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       29655  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29119  29656   
            http_response.status()
29120  29657   
        );
29121         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       29658  +
        let expected_headers = [("Content-Type", "application/json")];
29122  29659   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29123  29660   
            http_response.headers(),
29124  29661   
            expected_headers,
29125  29662   
        ));
       29663  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       29664  +
            .await
       29665  +
            .expect("unable to extract body to bytes");
       29666  +
        ::aws_smithy_protocol_test::assert_ok(
       29667  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"],\n        \"z\": null\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       29668  +
        );
29126  29669   
    }
       29670  +
}
       29671  +
       29672  +
const CONTENT_TYPE_JSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
       29673  +
::pin_project_lite::pin_project! {
       29674  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       29675  +
    /// [`JsonMapsInput`](crate::input::JsonMapsInput) using modelled bindings.
       29676  +
    pub struct JsonMapsInputFuture {
       29677  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonMapsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
29127  29678   
    }
29128         -
    /// Invalid values for epoch seconds are rejected with a 400 SerializationException
29129         -
    /// Test ID: RestJsonQueryTimestampEpochRejectsMalformedValues_case6
29130         -
    #[::tokio::test]
29131         -
    async fn rest_json_query_timestamp_epoch_rejects_malformed_values_case6_malformed_request() {
29132         -
        {
29133         -
            #[allow(unused_mut)]
29134         -
            let mut http_request = http::Request::builder()
29135         -
                .uri("/MalformedTimestampQueryEpoch")
29136         -
                .method("POST")
29137         -
                .body(::aws_smithy_http_server::body::Body::empty())
29138         -
                .unwrap();
29139         -
            *http_request.uri_mut() = "/MalformedTimestampQueryEpoch?timestamp=NaN"
29140         -
                .parse()
29141         -
                .unwrap();
29142         -
            #[allow(unused_mut)]
29143         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29144         -
            let config = crate::service::RestJsonConfig::builder().build();
29145         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29146         -
                            .malformed_timestamp_query_epoch(move |input: crate::input::MalformedTimestampQueryEpochInput| {
29147         -
                                let sender = sender.clone();
29148         -
                                async move {
29149         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryEpochOutput, crate::error::MalformedTimestampQueryEpochError> };
29150         -
                                    sender.send(()).await.expect("receiver dropped early");
29151         -
                                    result
       29679  +
}
       29680  +
       29681  +
impl std::future::Future for JsonMapsInputFuture {
       29682  +
    type Output = Result<
       29683  +
        crate::input::JsonMapsInput,
       29684  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       29685  +
    >;
       29686  +
       29687  +
    fn poll(
       29688  +
        self: std::pin::Pin<&mut Self>,
       29689  +
        cx: &mut std::task::Context<'_>,
       29690  +
    ) -> std::task::Poll<Self::Output> {
       29691  +
        let this = self.project();
       29692  +
        this.inner.as_mut().poll(cx)
29152  29693   
    }
29153         -
                            })
29154         -
                            .build_unchecked();
29155         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       29694  +
}
       29695  +
       29696  +
impl<B>
       29697  +
    ::aws_smithy_http_server::request::FromRequest<
       29698  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       29699  +
        B,
       29700  +
    > for crate::input::JsonMapsInput
       29701  +
where
       29702  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       29703  +
    B: 'static,
       29704  +
       29705  +
    B::Data: Send,
       29706  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       29707  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       29708  +
{
       29709  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       29710  +
    type Future = JsonMapsInputFuture;
       29711  +
       29712  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       29713  +
        let fut = async move {
       29714  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       29715  +
                request.headers(),
       29716  +
                &CONTENT_TYPE_JSONMAPS,
       29717  +
            ) {
       29718  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       29719  +
            }
       29720  +
            crate::protocol_serde::shape_json_maps::de_json_maps_http_request(request)
29156  29721   
                .await
29157         -
                .expect("unable to make an HTTP request");
29158         -
            ::pretty_assertions::assert_eq!(
29159         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29160         -
                http_response.status()
       29722  +
                .map_err(Into::into)
       29723  +
        };
       29724  +
        use ::futures_util::future::TryFutureExt;
       29725  +
        let fut = fut.map_err(
       29726  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       29727  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       29728  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       29729  +
                    e,
       29730  +
                )
       29731  +
            },
29161  29732   
        );
29162         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29163         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29164         -
                http_response.headers(),
29165         -
                expected_headers,
29166         -
            ));
       29733  +
        JsonMapsInputFuture {
       29734  +
            inner: Box::pin(fut),
29167  29735   
        }
29168  29736   
    }
29169  29737   
}
29170         -
#[cfg(test)]
29171         -
#[allow(unreachable_code, unused_variables)]
29172         -
mod server_malformed_timestamp_query_http_date_test {
29173         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
29174         -
    /// 400 SerializationException
29175         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case0
29176         -
    #[::tokio::test]
29177         -
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case0_malformed_request() {
29178         -
        {
29179         -
            #[allow(unused_mut)]
29180         -
            let mut http_request = http::Request::builder()
29181         -
                .uri("/MalformedTimestampQueryHttpDate")
29182         -
                .method("POST")
29183         -
                .body(::aws_smithy_http_server::body::Body::empty())
29184         -
                .unwrap();
29185         -
            *http_request.uri_mut() =
29186         -
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50.52Z"
29187         -
                    .parse()
29188         -
                    .unwrap();
29189         -
            #[allow(unused_mut)]
29190         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29191         -
            let config = crate::service::RestJsonConfig::builder().build();
29192         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29193         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
29194         -
                                let sender = sender.clone();
29195         -
                                async move {
29196         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
29197         -
                                    sender.send(()).await.expect("receiver dropped early");
29198         -
                                    result
       29738  +
impl
       29739  +
    ::aws_smithy_http_server::response::IntoResponse<
       29740  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       29741  +
    > for crate::output::JsonMapsOutput
       29742  +
{
       29743  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       29744  +
        match crate::protocol_serde::shape_json_maps::ser_json_maps_http_response(self) {
       29745  +
            Ok(response) => response,
       29746  +
            Err(e) => {
       29747  +
                ::tracing::error!(error = %e, "failed to serialize response");
       29748  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
29199  29749   
            }
29200         -
                            })
29201         -
                            .build_unchecked();
29202         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29203         -
                .await
29204         -
                .expect("unable to make an HTTP request");
29205         -
            ::pretty_assertions::assert_eq!(
29206         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29207         -
                http_response.status()
       29750  +
        }
       29751  +
    }
       29752  +
}
       29753  +
impl
       29754  +
    ::aws_smithy_http_server::response::IntoResponse<
       29755  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       29756  +
    > for crate::error::JsonMapsError
       29757  +
{
       29758  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       29759  +
        match crate::protocol_serde::shape_json_maps::ser_json_maps_http_error(&self) {
       29760  +
            Ok(mut response) => {
       29761  +
                response.extensions_mut().insert(
       29762  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
29208  29763   
                );
29209         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29210         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29211         -
                http_response.headers(),
29212         -
                expected_headers,
29213         -
            ));
       29764  +
                response
       29765  +
            }
       29766  +
            Err(e) => {
       29767  +
                ::tracing::error!(error = %e, "failed to serialize response");
       29768  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
29214  29769   
            }
29215  29770   
        }
29216         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
29217         -
    /// 400 SerializationException
29218         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case1
       29771  +
    }
       29772  +
}
       29773  +
       29774  +
#[allow(unreachable_code, unused_variables)]
       29775  +
#[cfg(test)]
       29776  +
mod json_maps_test {
       29777  +
       29778  +
    /// Serializes JSON maps
       29779  +
    /// Test ID: RestJsonJsonMaps
29219  29780   
    #[::tokio::test]
29220         -
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case1_malformed_request() {
29221         -
        {
       29781  +
    #[::tracing_test::traced_test]
       29782  +
    async fn rest_json_json_maps_request() {
29222  29783   
        #[allow(unused_mut)]
29223  29784   
                    let mut http_request = http::Request::builder()
29224         -
                .uri("/MalformedTimestampQueryHttpDate")
       29785  +
                        .uri("/JsonMaps")
29225  29786   
                        .method("POST")
29226         -
                .body(::aws_smithy_http_server::body::Body::empty())
29227         -
                .unwrap();
29228         -
            *http_request.uri_mut() =
29229         -
                "/MalformedTimestampQueryHttpDate?timestamp=1985-04-12T23%3A20%3A50Z"
29230         -
                    .parse()
29231         -
                    .unwrap();
       29787  +
        .header("Content-Type", "application/json")
       29788  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"denseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}".as_bytes()))).unwrap();
29232  29789   
        #[allow(unused_mut)]
29233  29790   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29234  29791   
        let config = crate::service::RestJsonConfig::builder().build();
29235  29792   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29236         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       29793  +
            .json_maps(move |input: crate::input::JsonMapsInput| {
29237  29794   
                let sender = sender.clone();
29238  29795   
                async move {
29239         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
       29796  +
                    let result = {
       29797  +
                        let expected = crate::input::JsonMapsInput {
       29798  +
                            dense_struct_map: ::std::option::Option::Some({
       29799  +
                                let mut ret = ::std::collections::HashMap::new();
       29800  +
                                ret.insert(
       29801  +
                                    "foo".to_owned(),
       29802  +
                                    crate::model::GreetingStruct {
       29803  +
                                        hi: ::std::option::Option::Some("there".to_owned()),
       29804  +
                                    },
       29805  +
                                );
       29806  +
                                ret.insert(
       29807  +
                                    "baz".to_owned(),
       29808  +
                                    crate::model::GreetingStruct {
       29809  +
                                        hi: ::std::option::Option::Some("bye".to_owned()),
       29810  +
                                    },
       29811  +
                                );
       29812  +
                                ret
       29813  +
                            }),
       29814  +
                            dense_number_map: ::std::option::Option::None,
       29815  +
                            dense_boolean_map: ::std::option::Option::None,
       29816  +
                            dense_string_map: ::std::option::Option::None,
       29817  +
                            dense_set_map: ::std::option::Option::None,
       29818  +
                        };
       29819  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29820  +
                        let response = crate::output::JsonMapsOutput {
       29821  +
                            dense_struct_map: ::std::option::Option::None,
       29822  +
                            dense_number_map: ::std::option::Option::None,
       29823  +
                            dense_boolean_map: ::std::option::Option::None,
       29824  +
                            dense_string_map: ::std::option::Option::None,
       29825  +
                            dense_set_map: ::std::option::Option::None,
       29826  +
                        };
       29827  +
                        Ok(response)
       29828  +
                    };
29240  29829   
                    sender.send(()).await.expect("receiver dropped early");
29241  29830   
                    result
29242  29831   
                }
29243  29832   
            })
29244  29833   
            .build_unchecked();
29245  29834   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29246  29835   
            .await
29247  29836   
            .expect("unable to make an HTTP request");
29248         -
            ::pretty_assertions::assert_eq!(
29249         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29250         -
                http_response.status()
       29837  +
        assert!(
       29838  +
            receiver.recv().await.is_some(),
       29839  +
            "we expected operation handler to be invoked but it was not entered"
29251  29840   
        );
29252         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29253         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29254         -
                http_response.headers(),
29255         -
                expected_headers,
29256         -
            ));
29257  29841   
    }
29258         -
    }
29259         -
    /// When the format is http-date, RFC3339 timestamps are rejected with a
29260         -
    /// 400 SerializationException
29261         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsDateTime_case2
       29842  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       29843  +
    /// Test ID: RestJsonSerializesZeroValuesInMaps
29262  29844   
    #[::tokio::test]
29263         -
    async fn rest_json_query_timestamp_http_date_rejects_date_time_case2_malformed_request() {
29264         -
        {
       29845  +
    #[::tracing_test::traced_test]
       29846  +
    async fn rest_json_serializes_zero_values_in_maps_request() {
29265  29847   
        #[allow(unused_mut)]
29266  29848   
                    let mut http_request = http::Request::builder()
29267         -
                .uri("/MalformedTimestampQueryHttpDate")
       29849  +
                        .uri("/JsonMaps")
29268  29850   
                        .method("POST")
29269         -
                .body(::aws_smithy_http_server::body::Body::empty())
29270         -
                .unwrap();
29271         -
            *http_request.uri_mut() =
29272         -
                "/MalformedTimestampQueryHttpDate?timestamp=1996-12-19T16%3A39%3A57-08%3A00"
29273         -
                    .parse()
29274         -
                    .unwrap();
       29851  +
        .header("Content-Type", "application/json")
       29852  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"denseNumberMap\": {\n        \"x\": 0\n    },\n    \"denseBooleanMap\": {\n        \"x\": false\n    }\n}".as_bytes()))).unwrap();
29275  29853   
        #[allow(unused_mut)]
29276  29854   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29277  29855   
        let config = crate::service::RestJsonConfig::builder().build();
29278  29856   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29279         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       29857  +
            .json_maps(move |input: crate::input::JsonMapsInput| {
29280  29858   
                let sender = sender.clone();
29281  29859   
                async move {
29282         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
       29860  +
                    let result = {
       29861  +
                        let expected = crate::input::JsonMapsInput {
       29862  +
                            dense_number_map: ::std::option::Option::Some({
       29863  +
                                let mut ret = ::std::collections::HashMap::new();
       29864  +
                                ret.insert("x".to_owned(), 0);
       29865  +
                                ret
       29866  +
                            }),
       29867  +
                            dense_boolean_map: ::std::option::Option::Some({
       29868  +
                                let mut ret = ::std::collections::HashMap::new();
       29869  +
                                ret.insert("x".to_owned(), false);
       29870  +
                                ret
       29871  +
                            }),
       29872  +
                            dense_struct_map: ::std::option::Option::None,
       29873  +
                            dense_string_map: ::std::option::Option::None,
       29874  +
                            dense_set_map: ::std::option::Option::None,
       29875  +
                        };
       29876  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29877  +
                        let response = crate::output::JsonMapsOutput {
       29878  +
                            dense_struct_map: ::std::option::Option::None,
       29879  +
                            dense_number_map: ::std::option::Option::None,
       29880  +
                            dense_boolean_map: ::std::option::Option::None,
       29881  +
                            dense_string_map: ::std::option::Option::None,
       29882  +
                            dense_set_map: ::std::option::Option::None,
       29883  +
                        };
       29884  +
                        Ok(response)
       29885  +
                    };
29283  29886   
                    sender.send(()).await.expect("receiver dropped early");
29284  29887   
                    result
29285  29888   
                }
29286  29889   
            })
29287  29890   
            .build_unchecked();
29288  29891   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29289  29892   
            .await
29290  29893   
            .expect("unable to make an HTTP request");
29291         -
            ::pretty_assertions::assert_eq!(
29292         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29293         -
                http_response.status()
       29894  +
        assert!(
       29895  +
            receiver.recv().await.is_some(),
       29896  +
            "we expected operation handler to be invoked but it was not entered"
29294  29897   
        );
29295         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29296         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29297         -
                http_response.headers(),
29298         -
                expected_headers,
29299         -
            ));
29300         -
        }
29301  29898   
    }
29302         -
    /// When the format is http-date, epoch second timestamps are rejected with a
29303         -
    /// 400 SerializationException
29304         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case0
       29899  +
    /// A request that contains a dense map of sets.
       29900  +
    /// Test ID: RestJsonSerializesDenseSetMap
29305  29901   
    #[::tokio::test]
29306         -
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case0_malformed_request() {
29307         -
        {
       29902  +
    #[::tracing_test::traced_test]
       29903  +
    async fn rest_json_serializes_dense_set_map_request() {
29308  29904   
        #[allow(unused_mut)]
29309  29905   
                    let mut http_request = http::Request::builder()
29310         -
                .uri("/MalformedTimestampQueryHttpDate")
       29906  +
                        .uri("/JsonMaps")
29311  29907   
                        .method("POST")
29312         -
                .body(::aws_smithy_http_server::body::Body::empty())
29313         -
                .unwrap();
29314         -
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081.1234"
29315         -
                .parse()
29316         -
                .unwrap();
       29908  +
        .header("Content-Type", "application/json")
       29909  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"denseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}".as_bytes()))).unwrap();
29317  29910   
        #[allow(unused_mut)]
29318  29911   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29319  29912   
        let config = crate::service::RestJsonConfig::builder().build();
29320  29913   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29321         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
       29914  +
            .json_maps(move |input: crate::input::JsonMapsInput| {
29322  29915   
                let sender = sender.clone();
29323  29916   
                async move {
29324         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
       29917  +
                    let result = {
       29918  +
                        let expected = crate::input::JsonMapsInput {
       29919  +
                            dense_set_map: ::std::option::Option::Some({
       29920  +
                                let mut ret = ::std::collections::HashMap::new();
       29921  +
                                ret.insert(
       29922  +
                                    "x".to_owned(),
       29923  +
                                    vec![].try_into().expect("this is only used in tests"),
       29924  +
                                );
       29925  +
                                ret.insert(
       29926  +
                                    "y".to_owned(),
       29927  +
                                    vec!["a".to_owned(), "b".to_owned()]
       29928  +
                                        .try_into()
       29929  +
                                        .expect("this is only used in tests"),
       29930  +
                                );
       29931  +
                                ret
       29932  +
                            }),
       29933  +
                            dense_struct_map: ::std::option::Option::None,
       29934  +
                            dense_number_map: ::std::option::Option::None,
       29935  +
                            dense_boolean_map: ::std::option::Option::None,
       29936  +
                            dense_string_map: ::std::option::Option::None,
       29937  +
                        };
       29938  +
                        ::pretty_assertions::assert_eq!(input, expected);
       29939  +
                        let response = crate::output::JsonMapsOutput {
       29940  +
                            dense_struct_map: ::std::option::Option::None,
       29941  +
                            dense_number_map: ::std::option::Option::None,
       29942  +
                            dense_boolean_map: ::std::option::Option::None,
       29943  +
                            dense_string_map: ::std::option::Option::None,
       29944  +
                            dense_set_map: ::std::option::Option::None,
       29945  +
                        };
       29946  +
                        Ok(response)
       29947  +
                    };
29325  29948   
                    sender.send(()).await.expect("receiver dropped early");
29326  29949   
                    result
29327  29950   
                }
29328  29951   
            })
29329  29952   
            .build_unchecked();
29330  29953   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29331  29954   
            .await
29332  29955   
            .expect("unable to make an HTTP request");
       29956  +
        assert!(
       29957  +
            receiver.recv().await.is_some(),
       29958  +
            "we expected operation handler to be invoked but it was not entered"
       29959  +
        );
       29960  +
    }
       29961  +
    /// Deserializes JSON maps
       29962  +
    /// Test ID: RestJsonJsonMaps
       29963  +
    #[::tokio::test]
       29964  +
    #[::tracing_test::traced_test]
       29965  +
    async fn rest_json_json_maps_response() {
       29966  +
        let output = crate::output::JsonMapsOutput {
       29967  +
            dense_struct_map: ::std::option::Option::Some({
       29968  +
                let mut ret = ::std::collections::HashMap::new();
       29969  +
                ret.insert(
       29970  +
                    "foo".to_owned(),
       29971  +
                    crate::model::GreetingStruct {
       29972  +
                        hi: ::std::option::Option::Some("there".to_owned()),
       29973  +
                    },
       29974  +
                );
       29975  +
                ret.insert(
       29976  +
                    "baz".to_owned(),
       29977  +
                    crate::model::GreetingStruct {
       29978  +
                        hi: ::std::option::Option::Some("bye".to_owned()),
       29979  +
                    },
       29980  +
                );
       29981  +
                ret
       29982  +
            }),
       29983  +
            dense_number_map: ::std::option::Option::None,
       29984  +
            dense_boolean_map: ::std::option::Option::None,
       29985  +
            dense_string_map: ::std::option::Option::None,
       29986  +
            dense_set_map: ::std::option::Option::None,
       29987  +
        };
       29988  +
        use ::aws_smithy_http_server::response::IntoResponse;
       29989  +
        let http_response = output.into_response();
29333  29990   
        ::pretty_assertions::assert_eq!(
29334         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       29991  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29335  29992   
            http_response.status()
29336  29993   
        );
29337         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       29994  +
        let expected_headers = [("Content-Type", "application/json")];
29338  29995   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29339  29996   
            http_response.headers(),
29340  29997   
            expected_headers,
29341  29998   
        ));
       29999  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       30000  +
            .await
       30001  +
            .expect("unable to extract body to bytes");
       30002  +
        ::aws_smithy_protocol_test::assert_ok(
       30003  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"denseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       30004  +
        );
29342  30005   
    }
29343         -
    }
29344         -
    /// When the format is http-date, epoch second timestamps are rejected with a
29345         -
    /// 400 SerializationException
29346         -
    /// Test ID: RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case1
       30006  +
    /// Ensure that 0 and false are sent over the wire in all maps and lists
       30007  +
    /// Test ID: RestJsonDeserializesZeroValuesInMaps
29347  30008   
    #[::tokio::test]
29348         -
    async fn rest_json_query_timestamp_http_date_rejects_epoch_seconds_case1_malformed_request() {
29349         -
        {
29350         -
            #[allow(unused_mut)]
29351         -
            let mut http_request = http::Request::builder()
29352         -
                .uri("/MalformedTimestampQueryHttpDate")
29353         -
                .method("POST")
29354         -
                .body(::aws_smithy_http_server::body::Body::empty())
29355         -
                .unwrap();
29356         -
            *http_request.uri_mut() = "/MalformedTimestampQueryHttpDate?timestamp=1515531081"
29357         -
                .parse()
29358         -
                .unwrap();
29359         -
            #[allow(unused_mut)]
29360         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29361         -
            let config = crate::service::RestJsonConfig::builder().build();
29362         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29363         -
                            .malformed_timestamp_query_http_date(move |input: crate::input::MalformedTimestampQueryHttpDateInput| {
29364         -
                                let sender = sender.clone();
29365         -
                                async move {
29366         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedTimestampQueryHttpDateOutput, crate::error::MalformedTimestampQueryHttpDateError> };
29367         -
                                    sender.send(()).await.expect("receiver dropped early");
29368         -
                                    result
29369         -
                                }
29370         -
                            })
29371         -
                            .build_unchecked();
29372         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29373         -
                .await
29374         -
                .expect("unable to make an HTTP request");
       30009  +
    #[::tracing_test::traced_test]
       30010  +
    async fn rest_json_deserializes_zero_values_in_maps_response() {
       30011  +
        let output = crate::output::JsonMapsOutput {
       30012  +
            dense_number_map: ::std::option::Option::Some({
       30013  +
                let mut ret = ::std::collections::HashMap::new();
       30014  +
                ret.insert("x".to_owned(), 0);
       30015  +
                ret
       30016  +
            }),
       30017  +
            dense_boolean_map: ::std::option::Option::Some({
       30018  +
                let mut ret = ::std::collections::HashMap::new();
       30019  +
                ret.insert("x".to_owned(), false);
       30020  +
                ret
       30021  +
            }),
       30022  +
            dense_struct_map: ::std::option::Option::None,
       30023  +
            dense_string_map: ::std::option::Option::None,
       30024  +
            dense_set_map: ::std::option::Option::None,
       30025  +
        };
       30026  +
        use ::aws_smithy_http_server::response::IntoResponse;
       30027  +
        let http_response = output.into_response();
29375  30028   
        ::pretty_assertions::assert_eq!(
29376         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       30029  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29377  30030   
            http_response.status()
29378  30031   
        );
29379         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       30032  +
        let expected_headers = [("Content-Type", "application/json")];
29380  30033   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29381  30034   
            http_response.headers(),
29382  30035   
            expected_headers,
29383  30036   
        ));
       30037  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       30038  +
            .await
       30039  +
            .expect("unable to extract body to bytes");
       30040  +
        ::aws_smithy_protocol_test::assert_ok(
       30041  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"denseNumberMap\": {\n        \"x\": 0\n    },\n    \"denseBooleanMap\": {\n        \"x\": false\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       30042  +
        );
29384  30043   
    }
29385         -
    }
29386         -
}
29387         -
#[cfg(test)]
29388         -
#[allow(unreachable_code, unused_variables)]
29389         -
mod server_malformed_union_test {
29390         -
    /// When the union has multiple fields set, the response should be a 400
29391         -
    /// SerializationException.
29392         -
    /// Test ID: RestJsonMalformedUnionMultipleFieldsSet
       30044  +
    /// A response that contains a dense map of sets.
       30045  +
    /// Test ID: RestJsonDeserializesDenseSetMap
29393  30046   
    #[::tokio::test]
29394         -
    async fn rest_json_malformed_union_multiple_fields_set_malformed_request() {
29395         -
        {
29396         -
            #[allow(unused_mut)]
29397         -
            let mut http_request = http::Request::builder()
29398         -
                .uri("/MalformedUnion")
29399         -
                .method("POST")
29400         -
                .header("content-type", "application/json")
29401         -
                .body(::aws_smithy_http_server::body::Body::from(
29402         -
                    ::bytes::Bytes::from_static(
29403         -
                        "{ \"union\" : { \"int\": 2, \"string\": \"three\" } }".as_bytes(),
29404         -
                    ),
29405         -
                ))
29406         -
                .unwrap();
29407         -
            #[allow(unused_mut)]
29408         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29409         -
            let config = crate::service::RestJsonConfig::builder().build();
29410         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29411         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
29412         -
                                let sender = sender.clone();
29413         -
                                async move {
29414         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
29415         -
                                    sender.send(()).await.expect("receiver dropped early");
29416         -
                                    result
29417         -
                                }
29418         -
                            })
29419         -
                            .build_unchecked();
29420         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29421         -
                .await
29422         -
                .expect("unable to make an HTTP request");
       30047  +
    #[::tracing_test::traced_test]
       30048  +
    async fn rest_json_deserializes_dense_set_map_response() {
       30049  +
        let output = crate::output::JsonMapsOutput {
       30050  +
            dense_set_map: ::std::option::Option::Some({
       30051  +
                let mut ret = ::std::collections::HashMap::new();
       30052  +
                ret.insert(
       30053  +
                    "x".to_owned(),
       30054  +
                    vec![].try_into().expect("this is only used in tests"),
       30055  +
                );
       30056  +
                ret.insert(
       30057  +
                    "y".to_owned(),
       30058  +
                    vec!["a".to_owned(), "b".to_owned()]
       30059  +
                        .try_into()
       30060  +
                        .expect("this is only used in tests"),
       30061  +
                );
       30062  +
                ret
       30063  +
            }),
       30064  +
            dense_struct_map: ::std::option::Option::None,
       30065  +
            dense_number_map: ::std::option::Option::None,
       30066  +
            dense_boolean_map: ::std::option::Option::None,
       30067  +
            dense_string_map: ::std::option::Option::None,
       30068  +
        };
       30069  +
        use ::aws_smithy_http_server::response::IntoResponse;
       30070  +
        let http_response = output.into_response();
29423  30071   
        ::pretty_assertions::assert_eq!(
29424         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       30072  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29425  30073   
            http_response.status()
29426  30074   
        );
29427         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       30075  +
        let expected_headers = [("Content-Type", "application/json")];
29428  30076   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29429  30077   
            http_response.headers(),
29430  30078   
            expected_headers,
29431  30079   
        ));
       30080  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       30081  +
            .await
       30082  +
            .expect("unable to extract body to bytes");
       30083  +
        ::aws_smithy_protocol_test::assert_ok(
       30084  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"denseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       30085  +
        );
       30086  +
    }
       30087  +
}
       30088  +
       30089  +
const CONTENT_TYPE_SPARSEJSONLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
       30090  +
::pin_project_lite::pin_project! {
       30091  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       30092  +
    /// [`SparseJsonListsInput`](crate::input::SparseJsonListsInput) using modelled bindings.
       30093  +
    pub struct SparseJsonListsInputFuture {
       30094  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SparseJsonListsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
29432  30095   
    }
       30096  +
}
       30097  +
       30098  +
impl std::future::Future for SparseJsonListsInputFuture {
       30099  +
    type Output = Result<
       30100  +
        crate::input::SparseJsonListsInput,
       30101  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       30102  +
    >;
       30103  +
       30104  +
    fn poll(
       30105  +
        self: std::pin::Pin<&mut Self>,
       30106  +
        cx: &mut std::task::Context<'_>,
       30107  +
    ) -> std::task::Poll<Self::Output> {
       30108  +
        let this = self.project();
       30109  +
        this.inner.as_mut().poll(cx)
29433  30110   
    }
29434         -
    /// When the union has multiple fields set, even when only one is modeled,
29435         -
    /// the response should be a 400 SerializationException.
29436         -
    /// Test ID: RestJsonMalformedUnionKnownAndUnknownFieldsSet
       30111  +
}
       30112  +
       30113  +
impl<B>
       30114  +
    ::aws_smithy_http_server::request::FromRequest<
       30115  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30116  +
        B,
       30117  +
    > for crate::input::SparseJsonListsInput
       30118  +
where
       30119  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       30120  +
    B: 'static,
       30121  +
       30122  +
    B::Data: Send,
       30123  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       30124  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       30125  +
{
       30126  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       30127  +
    type Future = SparseJsonListsInputFuture;
       30128  +
       30129  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       30130  +
        let fut = async move {
       30131  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       30132  +
                request.headers(),
       30133  +
                &CONTENT_TYPE_SPARSEJSONLISTS,
       30134  +
            ) {
       30135  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       30136  +
            }
       30137  +
            crate::protocol_serde::shape_sparse_json_lists::de_sparse_json_lists_http_request(
       30138  +
                request,
       30139  +
            )
       30140  +
            .await
       30141  +
            .map_err(Into::into)
       30142  +
        };
       30143  +
        use ::futures_util::future::TryFutureExt;
       30144  +
        let fut = fut.map_err(
       30145  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       30146  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       30147  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       30148  +
                    e,
       30149  +
                )
       30150  +
            },
       30151  +
        );
       30152  +
        SparseJsonListsInputFuture {
       30153  +
            inner: Box::pin(fut),
       30154  +
        }
       30155  +
    }
       30156  +
}
       30157  +
impl
       30158  +
    ::aws_smithy_http_server::response::IntoResponse<
       30159  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30160  +
    > for crate::output::SparseJsonListsOutput
       30161  +
{
       30162  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       30163  +
        match crate::protocol_serde::shape_sparse_json_lists::ser_sparse_json_lists_http_response(
       30164  +
            self,
       30165  +
        ) {
       30166  +
            Ok(response) => response,
       30167  +
            Err(e) => {
       30168  +
                ::tracing::error!(error = %e, "failed to serialize response");
       30169  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       30170  +
            }
       30171  +
        }
       30172  +
    }
       30173  +
}
       30174  +
       30175  +
#[allow(unreachable_code, unused_variables)]
       30176  +
#[cfg(test)]
       30177  +
mod sparse_json_lists_test {
       30178  +
       30179  +
    /// Serializes null values in sparse lists
       30180  +
    /// Test ID: RestJsonSparseListsSerializeNull
29437  30181   
    #[::tokio::test]
29438         -
    async fn rest_json_malformed_union_known_and_unknown_fields_set_malformed_request() {
29439         -
        {
       30182  +
    #[::tracing_test::traced_test]
       30183  +
    async fn rest_json_sparse_lists_serialize_null_request() {
29440  30184   
        #[allow(unused_mut)]
29441  30185   
        let mut http_request = http::Request::builder()
29442         -
                .uri("/MalformedUnion")
29443         -
                .method("POST")
29444         -
                .header("content-type", "application/json")
       30186  +
            .uri("/SparseJsonLists")
       30187  +
            .method("PUT")
       30188  +
            .header("Content-Type", "application/json")
29445  30189   
            .body(::aws_smithy_http_server::body::Body::from(
29446  30190   
                ::bytes::Bytes::from_static(
29447         -
                        "{ \"union\" : { \"int\": 2, \"unknownField\": \"three\" } }".as_bytes(),
       30191  +
                    "{\n    \"sparseStringList\": [\n        null,\n        \"hi\"\n    ]\n}"
       30192  +
                        .as_bytes(),
29448  30193   
                ),
29449  30194   
            ))
29450  30195   
            .unwrap();
29451  30196   
        #[allow(unused_mut)]
29452  30197   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29453  30198   
        let config = crate::service::RestJsonConfig::builder().build();
29454  30199   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29455         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       30200  +
            .sparse_json_lists(move |input: crate::input::SparseJsonListsInput| {
29456  30201   
                let sender = sender.clone();
29457  30202   
                async move {
29458         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       30203  +
                    let result = {
       30204  +
                        let expected = crate::input::SparseJsonListsInput {
       30205  +
                            sparse_string_list: ::std::option::Option::Some(vec![
       30206  +
                                ::std::option::Option::None,
       30207  +
                                ::std::option::Option::Some("hi".to_owned()),
       30208  +
                            ]),
       30209  +
                        };
       30210  +
                        ::pretty_assertions::assert_eq!(input, expected);
       30211  +
                        let response = crate::output::SparseJsonListsOutput {
       30212  +
                            sparse_string_list: ::std::option::Option::None,
       30213  +
                        };
       30214  +
                        response
       30215  +
                    };
29459  30216   
                    sender.send(()).await.expect("receiver dropped early");
29460  30217   
                    result
29461  30218   
                }
29462  30219   
            })
29463  30220   
            .build_unchecked();
29464  30221   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29465  30222   
            .await
29466  30223   
            .expect("unable to make an HTTP request");
       30224  +
        assert!(
       30225  +
            receiver.recv().await.is_some(),
       30226  +
            "we expected operation handler to be invoked but it was not entered"
       30227  +
        );
       30228  +
    }
       30229  +
    /// Serializes null values in sparse lists
       30230  +
    /// Test ID: RestJsonSparseListsSerializeNull
       30231  +
    #[::tokio::test]
       30232  +
    #[::tracing_test::traced_test]
       30233  +
    async fn rest_json_sparse_lists_serialize_null_response() {
       30234  +
        let output = crate::output::SparseJsonListsOutput {
       30235  +
            sparse_string_list: ::std::option::Option::Some(vec![
       30236  +
                ::std::option::Option::None,
       30237  +
                ::std::option::Option::Some("hi".to_owned()),
       30238  +
            ]),
       30239  +
        };
       30240  +
        use ::aws_smithy_http_server::response::IntoResponse;
       30241  +
        let http_response = output.into_response();
29467  30242   
        ::pretty_assertions::assert_eq!(
29468         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       30243  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29469  30244   
            http_response.status()
29470  30245   
        );
29471         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       30246  +
        let expected_headers = [("Content-Type", "application/json")];
29472  30247   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29473  30248   
            http_response.headers(),
29474  30249   
            expected_headers,
29475  30250   
        ));
       30251  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       30252  +
            .await
       30253  +
            .expect("unable to extract body to bytes");
       30254  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       30255  +
            &body,
       30256  +
            "{\n    \"sparseStringList\": [\n        null,\n        \"hi\"\n    ]\n}",
       30257  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       30258  +
        ));
29476  30259   
    }
       30260  +
}
       30261  +
       30262  +
const CONTENT_TYPE_JSONLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
       30263  +
::pin_project_lite::pin_project! {
       30264  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       30265  +
    /// [`JsonListsInput`](crate::input::JsonListsInput) using modelled bindings.
       30266  +
    pub struct JsonListsInputFuture {
       30267  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonListsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
29477  30268   
    }
29478         -
    /// When the union has no fields set, the response should be a 400
29479         -
    /// SerializationException.
29480         -
    /// Test ID: RestJsonMalformedUnionNoFieldsSet
       30269  +
}
       30270  +
       30271  +
impl std::future::Future for JsonListsInputFuture {
       30272  +
    type Output = Result<
       30273  +
        crate::input::JsonListsInput,
       30274  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       30275  +
    >;
       30276  +
       30277  +
    fn poll(
       30278  +
        self: std::pin::Pin<&mut Self>,
       30279  +
        cx: &mut std::task::Context<'_>,
       30280  +
    ) -> std::task::Poll<Self::Output> {
       30281  +
        let this = self.project();
       30282  +
        this.inner.as_mut().poll(cx)
       30283  +
    }
       30284  +
}
       30285  +
       30286  +
impl<B>
       30287  +
    ::aws_smithy_http_server::request::FromRequest<
       30288  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30289  +
        B,
       30290  +
    > for crate::input::JsonListsInput
       30291  +
where
       30292  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       30293  +
    B: 'static,
       30294  +
       30295  +
    B::Data: Send,
       30296  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       30297  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       30298  +
{
       30299  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       30300  +
    type Future = JsonListsInputFuture;
       30301  +
       30302  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       30303  +
        let fut = async move {
       30304  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       30305  +
                request.headers(),
       30306  +
                &CONTENT_TYPE_JSONLISTS,
       30307  +
            ) {
       30308  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       30309  +
            }
       30310  +
            crate::protocol_serde::shape_json_lists::de_json_lists_http_request(request)
       30311  +
                .await
       30312  +
                .map_err(Into::into)
       30313  +
        };
       30314  +
        use ::futures_util::future::TryFutureExt;
       30315  +
        let fut = fut.map_err(
       30316  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       30317  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       30318  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       30319  +
                    e,
       30320  +
                )
       30321  +
            },
       30322  +
        );
       30323  +
        JsonListsInputFuture {
       30324  +
            inner: Box::pin(fut),
       30325  +
        }
       30326  +
    }
       30327  +
}
       30328  +
impl
       30329  +
    ::aws_smithy_http_server::response::IntoResponse<
       30330  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30331  +
    > for crate::output::JsonListsOutput
       30332  +
{
       30333  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       30334  +
        match crate::protocol_serde::shape_json_lists::ser_json_lists_http_response(self) {
       30335  +
            Ok(response) => response,
       30336  +
            Err(e) => {
       30337  +
                ::tracing::error!(error = %e, "failed to serialize response");
       30338  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       30339  +
            }
       30340  +
        }
       30341  +
    }
       30342  +
}
       30343  +
impl
       30344  +
    ::aws_smithy_http_server::response::IntoResponse<
       30345  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30346  +
    > for crate::error::JsonListsError
       30347  +
{
       30348  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       30349  +
        match crate::protocol_serde::shape_json_lists::ser_json_lists_http_error(&self) {
       30350  +
            Ok(mut response) => {
       30351  +
                response.extensions_mut().insert(
       30352  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       30353  +
                );
       30354  +
                response
       30355  +
            }
       30356  +
            Err(e) => {
       30357  +
                ::tracing::error!(error = %e, "failed to serialize response");
       30358  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       30359  +
            }
       30360  +
        }
       30361  +
    }
       30362  +
}
       30363  +
       30364  +
#[allow(unreachable_code, unused_variables)]
       30365  +
#[cfg(test)]
       30366  +
mod json_lists_test {
       30367  +
       30368  +
    /// Serializes JSON lists
       30369  +
    /// Test ID: RestJsonLists
29481  30370   
    #[::tokio::test]
29482         -
    async fn rest_json_malformed_union_no_fields_set_malformed_request() {
29483         -
        {
       30371  +
    #[::tracing_test::traced_test]
       30372  +
    async fn rest_json_lists_request() {
29484  30373   
        #[allow(unused_mut)]
29485  30374   
                    let mut http_request = http::Request::builder()
29486         -
                .uri("/MalformedUnion")
29487         -
                .method("POST")
29488         -
                .header("content-type", "application/json")
29489         -
                .body(::aws_smithy_http_server::body::Body::from(
29490         -
                    ::bytes::Bytes::from_static("{ \"union\" : { \"int\": null } }".as_bytes()),
29491         -
                ))
29492         -
                .unwrap();
       30375  +
                        .uri("/JsonLists")
       30376  +
                        .method("PUT")
       30377  +
        .header("Content-Type", "application/json")
       30378  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"stringList\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"stringSet\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"integerList\": [\n        1,\n        2\n    ],\n    \"booleanList\": [\n        true,\n        false\n    ],\n    \"timestampList\": [\n        1398796238,\n        1398796238\n    ],\n    \"enumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"intEnumList\": [\n        1,\n        2\n    ],\n    \"nestedStringList\": [\n        [\n            \"foo\",\n            \"bar\"\n        ],\n        [\n            \"baz\",\n            \"qux\"\n        ]\n    ],\n    \"myStructureList\": [\n        {\n            \"value\": \"1\",\n            \"other\": \"2\"\n        },\n        {\n            \"value\": \"3\",\n            \"other\": \"4\"\n        }\n    ]\n}".as_bytes()))).unwrap();
29493  30379   
        #[allow(unused_mut)]
29494  30380   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29495  30381   
        let config = crate::service::RestJsonConfig::builder().build();
29496  30382   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29497         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       30383  +
            .json_lists(move |input: crate::input::JsonListsInput| {
29498  30384   
                let sender = sender.clone();
29499  30385   
                async move {
29500         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       30386  +
                    let result = {
       30387  +
                        let expected = crate::input::JsonListsInput {
       30388  +
                            string_list: ::std::option::Option::Some(vec![
       30389  +
                                "foo".to_owned(),
       30390  +
                                "bar".to_owned(),
       30391  +
                            ]),
       30392  +
                            string_set: ::std::option::Option::Some(
       30393  +
                                vec!["foo".to_owned(), "bar".to_owned()]
       30394  +
                                    .try_into()
       30395  +
                                    .expect("this is only used in tests"),
       30396  +
                            ),
       30397  +
                            integer_list: ::std::option::Option::Some(vec![1, 2]),
       30398  +
                            boolean_list: ::std::option::Option::Some(vec![true, false]),
       30399  +
                            timestamp_list: ::std::option::Option::Some(vec![
       30400  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       30401  +
                                    1398796238, 0_f64,
       30402  +
                                ),
       30403  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       30404  +
                                    1398796238, 0_f64,
       30405  +
                                ),
       30406  +
                            ]),
       30407  +
                            enum_list: ::std::option::Option::Some(vec![
       30408  +
                                "Foo"
       30409  +
                                    .parse::<crate::model::FooEnum>()
       30410  +
                                    .expect("static value validated to member"),
       30411  +
                                "0".parse::<crate::model::FooEnum>()
       30412  +
                                    .expect("static value validated to member"),
       30413  +
                            ]),
       30414  +
                            int_enum_list: ::std::option::Option::Some(vec![1, 2]),
       30415  +
                            nested_string_list: ::std::option::Option::Some(vec![
       30416  +
                                vec!["foo".to_owned(), "bar".to_owned()],
       30417  +
                                vec!["baz".to_owned(), "qux".to_owned()],
       30418  +
                            ]),
       30419  +
                            structure_list: ::std::option::Option::Some(vec![
       30420  +
                                crate::model::StructureListMember {
       30421  +
                                    a: ::std::option::Option::Some("1".to_owned()),
       30422  +
                                    b: ::std::option::Option::Some("2".to_owned()),
       30423  +
                                },
       30424  +
                                crate::model::StructureListMember {
       30425  +
                                    a: ::std::option::Option::Some("3".to_owned()),
       30426  +
                                    b: ::std::option::Option::Some("4".to_owned()),
       30427  +
                                },
       30428  +
                            ]),
       30429  +
                        };
       30430  +
                        ::pretty_assertions::assert_eq!(input, expected);
       30431  +
                        let response = crate::output::JsonListsOutput {
       30432  +
                            string_list: ::std::option::Option::None,
       30433  +
                            string_set: ::std::option::Option::None,
       30434  +
                            integer_list: ::std::option::Option::None,
       30435  +
                            boolean_list: ::std::option::Option::None,
       30436  +
                            timestamp_list: ::std::option::Option::None,
       30437  +
                            enum_list: ::std::option::Option::None,
       30438  +
                            int_enum_list: ::std::option::Option::None,
       30439  +
                            nested_string_list: ::std::option::Option::None,
       30440  +
                            structure_list: ::std::option::Option::None,
       30441  +
                        };
       30442  +
                        Ok(response)
       30443  +
                    };
29501  30444   
                    sender.send(()).await.expect("receiver dropped early");
29502  30445   
                    result
29503  30446   
                }
29504  30447   
            })
29505  30448   
            .build_unchecked();
29506  30449   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29507  30450   
            .await
29508  30451   
            .expect("unable to make an HTTP request");
29509         -
            ::pretty_assertions::assert_eq!(
29510         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
29511         -
                http_response.status()
       30452  +
        assert!(
       30453  +
            receiver.recv().await.is_some(),
       30454  +
            "we expected operation handler to be invoked but it was not entered"
29512  30455   
        );
29513         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
29514         -
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29515         -
                http_response.headers(),
29516         -
                expected_headers,
29517         -
            ));
29518         -
        }
29519  30456   
    }
29520         -
    /// When the union value is actually an array, the response should be a 400
29521         -
    /// SerializationException.
29522         -
    /// Test ID: RestJsonMalformedUnionValueIsArray
       30457  +
    /// Serializes empty JSON lists
       30458  +
    /// Test ID: RestJsonListsEmpty
29523  30459   
    #[::tokio::test]
29524         -
    async fn rest_json_malformed_union_value_is_array_malformed_request() {
29525         -
        {
       30460  +
    #[::tracing_test::traced_test]
       30461  +
    async fn rest_json_lists_empty_request() {
29526  30462   
        #[allow(unused_mut)]
29527  30463   
        let mut http_request = http::Request::builder()
29528         -
                .uri("/MalformedUnion")
29529         -
                .method("POST")
29530         -
                .header("content-type", "application/json")
       30464  +
            .uri("/JsonLists")
       30465  +
            .method("PUT")
       30466  +
            .header("Content-Type", "application/json")
29531  30467   
            .body(::aws_smithy_http_server::body::Body::from(
29532         -
                    ::bytes::Bytes::from_static("{ \"union\" : [\"int\"] }".as_bytes()),
       30468  +
                ::bytes::Bytes::from_static("{\n    \"stringList\": []\n}".as_bytes()),
29533  30469   
            ))
29534  30470   
            .unwrap();
29535  30471   
        #[allow(unused_mut)]
29536  30472   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29537  30473   
        let config = crate::service::RestJsonConfig::builder().build();
29538  30474   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29539         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
       30475  +
            .json_lists(move |input: crate::input::JsonListsInput| {
29540  30476   
                let sender = sender.clone();
29541  30477   
                async move {
29542         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
       30478  +
                    let result = {
       30479  +
                        let expected = crate::input::JsonListsInput {
       30480  +
                            string_list: ::std::option::Option::Some(vec![]),
       30481  +
                            string_set: ::std::option::Option::None,
       30482  +
                            integer_list: ::std::option::Option::None,
       30483  +
                            boolean_list: ::std::option::Option::None,
       30484  +
                            timestamp_list: ::std::option::Option::None,
       30485  +
                            enum_list: ::std::option::Option::None,
       30486  +
                            int_enum_list: ::std::option::Option::None,
       30487  +
                            nested_string_list: ::std::option::Option::None,
       30488  +
                            structure_list: ::std::option::Option::None,
       30489  +
                        };
       30490  +
                        ::pretty_assertions::assert_eq!(input, expected);
       30491  +
                        let response = crate::output::JsonListsOutput {
       30492  +
                            string_list: ::std::option::Option::None,
       30493  +
                            string_set: ::std::option::Option::None,
       30494  +
                            integer_list: ::std::option::Option::None,
       30495  +
                            boolean_list: ::std::option::Option::None,
       30496  +
                            timestamp_list: ::std::option::Option::None,
       30497  +
                            enum_list: ::std::option::Option::None,
       30498  +
                            int_enum_list: ::std::option::Option::None,
       30499  +
                            nested_string_list: ::std::option::Option::None,
       30500  +
                            structure_list: ::std::option::Option::None,
       30501  +
                        };
       30502  +
                        Ok(response)
       30503  +
                    };
29543  30504   
                    sender.send(()).await.expect("receiver dropped early");
29544  30505   
                    result
29545  30506   
                }
29546  30507   
            })
29547  30508   
            .build_unchecked();
29548  30509   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29549  30510   
            .await
29550  30511   
            .expect("unable to make an HTTP request");
       30512  +
        assert!(
       30513  +
            receiver.recv().await.is_some(),
       30514  +
            "we expected operation handler to be invoked but it was not entered"
       30515  +
        );
       30516  +
    }
       30517  +
    /// Serializes JSON lists
       30518  +
    /// Test ID: RestJsonLists
       30519  +
    #[::tokio::test]
       30520  +
    #[::tracing_test::traced_test]
       30521  +
    async fn rest_json_lists_response() {
       30522  +
        let output = crate::output::JsonListsOutput {
       30523  +
            string_list: ::std::option::Option::Some(vec!["foo".to_owned(), "bar".to_owned()]),
       30524  +
            string_set: ::std::option::Option::Some(
       30525  +
                vec!["foo".to_owned(), "bar".to_owned()]
       30526  +
                    .try_into()
       30527  +
                    .expect("this is only used in tests"),
       30528  +
            ),
       30529  +
            integer_list: ::std::option::Option::Some(vec![1, 2]),
       30530  +
            boolean_list: ::std::option::Option::Some(vec![true, false]),
       30531  +
            timestamp_list: ::std::option::Option::Some(vec![
       30532  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       30533  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       30534  +
            ]),
       30535  +
            enum_list: ::std::option::Option::Some(vec![
       30536  +
                "Foo"
       30537  +
                    .parse::<crate::model::FooEnum>()
       30538  +
                    .expect("static value validated to member"),
       30539  +
                "0".parse::<crate::model::FooEnum>()
       30540  +
                    .expect("static value validated to member"),
       30541  +
            ]),
       30542  +
            int_enum_list: ::std::option::Option::Some(vec![1, 2]),
       30543  +
            nested_string_list: ::std::option::Option::Some(vec![
       30544  +
                vec!["foo".to_owned(), "bar".to_owned()],
       30545  +
                vec!["baz".to_owned(), "qux".to_owned()],
       30546  +
            ]),
       30547  +
            structure_list: ::std::option::Option::Some(vec![
       30548  +
                crate::model::StructureListMember {
       30549  +
                    a: ::std::option::Option::Some("1".to_owned()),
       30550  +
                    b: ::std::option::Option::Some("2".to_owned()),
       30551  +
                },
       30552  +
                crate::model::StructureListMember {
       30553  +
                    a: ::std::option::Option::Some("3".to_owned()),
       30554  +
                    b: ::std::option::Option::Some("4".to_owned()),
       30555  +
                },
       30556  +
            ]),
       30557  +
        };
       30558  +
        use ::aws_smithy_http_server::response::IntoResponse;
       30559  +
        let http_response = output.into_response();
29551  30560   
        ::pretty_assertions::assert_eq!(
29552         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       30561  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29553  30562   
            http_response.status()
29554  30563   
        );
29555         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       30564  +
        let expected_headers = [("Content-Type", "application/json")];
29556  30565   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29557  30566   
            http_response.headers(),
29558  30567   
            expected_headers,
29559  30568   
        ));
       30569  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       30570  +
            .await
       30571  +
            .expect("unable to extract body to bytes");
       30572  +
        ::aws_smithy_protocol_test::assert_ok(
       30573  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"stringList\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"stringSet\": [\n        \"foo\",\n        \"bar\"\n    ],\n    \"integerList\": [\n        1,\n        2\n    ],\n    \"booleanList\": [\n        true,\n        false\n    ],\n    \"timestampList\": [\n        1398796238,\n        1398796238\n    ],\n    \"enumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"intEnumList\": [\n        1,\n        2\n    ],\n    \"nestedStringList\": [\n        [\n            \"foo\",\n            \"bar\"\n        ],\n        [\n            \"baz\",\n            \"qux\"\n        ]\n    ],\n    \"myStructureList\": [\n        {\n            \"value\": \"1\",\n            \"other\": \"2\"\n        },\n        {\n            \"value\": \"3\",\n            \"other\": \"4\"\n        }\n    ]\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       30574  +
        );
29560  30575   
    }
29561         -
    }
29562         -
    /// When an unknown union member is received, the response should be a 400
29563         -
    /// SerializationException.
29564         -
    /// Test ID: RestJsonMalformedUnionUnknownMember
       30576  +
    /// Serializes empty JSON lists
       30577  +
    /// Test ID: RestJsonListsEmpty
29565  30578   
    #[::tokio::test]
29566         -
    async fn rest_json_malformed_union_unknown_member_malformed_request() {
29567         -
        {
29568         -
            #[allow(unused_mut)]
29569         -
            let mut http_request = http::Request::builder()
29570         -
                .uri("/MalformedUnion")
29571         -
                .method("POST")
29572         -
                .header("content-type", "application/json")
29573         -
                .body(::aws_smithy_http_server::body::Body::from(
29574         -
                    ::bytes::Bytes::from_static(
29575         -
                        "{\n    \"union\": {\n        \"unknown\": \"hello\"\n    }\n}".as_bytes(),
29576         -
                    ),
29577         -
                ))
29578         -
                .unwrap();
29579         -
            #[allow(unused_mut)]
29580         -
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29581         -
            let config = crate::service::RestJsonConfig::builder().build();
29582         -
            let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29583         -
                            .malformed_union(move |input: crate::input::MalformedUnionInput| {
29584         -
                                let sender = sender.clone();
29585         -
                                async move {
29586         -
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as crate::output::MalformedUnionOutput };
29587         -
                                    sender.send(()).await.expect("receiver dropped early");
29588         -
                                    result
29589         -
                                }
29590         -
                            })
29591         -
                            .build_unchecked();
29592         -
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29593         -
                .await
29594         -
                .expect("unable to make an HTTP request");
       30579  +
    #[::tracing_test::traced_test]
       30580  +
    async fn rest_json_lists_empty_response() {
       30581  +
        let output = crate::output::JsonListsOutput {
       30582  +
            string_list: ::std::option::Option::Some(vec![]),
       30583  +
            string_set: ::std::option::Option::None,
       30584  +
            integer_list: ::std::option::Option::None,
       30585  +
            boolean_list: ::std::option::Option::None,
       30586  +
            timestamp_list: ::std::option::Option::None,
       30587  +
            enum_list: ::std::option::Option::None,
       30588  +
            int_enum_list: ::std::option::Option::None,
       30589  +
            nested_string_list: ::std::option::Option::None,
       30590  +
            structure_list: ::std::option::Option::None,
       30591  +
        };
       30592  +
        use ::aws_smithy_http_server::response::IntoResponse;
       30593  +
        let http_response = output.into_response();
29595  30594   
        ::pretty_assertions::assert_eq!(
29596         -
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       30595  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29597  30596   
            http_response.status()
29598  30597   
        );
29599         -
            let expected_headers = [("x-amzn-errortype", "SerializationException")];
       30598  +
        let expected_headers = [("Content-Type", "application/json")];
29600  30599   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29601  30600   
            http_response.headers(),
29602  30601   
            expected_headers,
29603  30602   
        ));
       30603  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       30604  +
            .await
       30605  +
            .expect("unable to extract body to bytes");
       30606  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       30607  +
            &body,
       30608  +
            "{\n    \"stringList\": []\n}",
       30609  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       30610  +
        ));
29604  30611   
    }
       30612  +
}
       30613  +
       30614  +
const CONTENT_TYPE_RECURSIVESHAPES: ::mime::Mime = ::mime::APPLICATION_JSON;
       30615  +
::pin_project_lite::pin_project! {
       30616  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       30617  +
    /// [`RecursiveShapesInput`](crate::input::RecursiveShapesInput) using modelled bindings.
       30618  +
    pub struct RecursiveShapesInputFuture {
       30619  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RecursiveShapesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
29605  30620   
    }
29606  30621   
}
29607         -
#[cfg(test)]
       30622  +
       30623  +
impl std::future::Future for RecursiveShapesInputFuture {
       30624  +
    type Output = Result<
       30625  +
        crate::input::RecursiveShapesInput,
       30626  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       30627  +
    >;
       30628  +
       30629  +
    fn poll(
       30630  +
        self: std::pin::Pin<&mut Self>,
       30631  +
        cx: &mut std::task::Context<'_>,
       30632  +
    ) -> std::task::Poll<Self::Output> {
       30633  +
        let this = self.project();
       30634  +
        this.inner.as_mut().poll(cx)
       30635  +
    }
       30636  +
}
       30637  +
       30638  +
impl<B>
       30639  +
    ::aws_smithy_http_server::request::FromRequest<
       30640  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30641  +
        B,
       30642  +
    > for crate::input::RecursiveShapesInput
       30643  +
where
       30644  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       30645  +
    B: 'static,
       30646  +
       30647  +
    B::Data: Send,
       30648  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       30649  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       30650  +
{
       30651  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       30652  +
    type Future = RecursiveShapesInputFuture;
       30653  +
       30654  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       30655  +
        let fut = async move {
       30656  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       30657  +
                request.headers(),
       30658  +
                &CONTENT_TYPE_RECURSIVESHAPES,
       30659  +
            ) {
       30660  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       30661  +
            }
       30662  +
            crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes_http_request(request)
       30663  +
                .await
       30664  +
                .map_err(Into::into)
       30665  +
        };
       30666  +
        use ::futures_util::future::TryFutureExt;
       30667  +
        let fut = fut.map_err(
       30668  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       30669  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       30670  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       30671  +
                    e,
       30672  +
                )
       30673  +
            },
       30674  +
        );
       30675  +
        RecursiveShapesInputFuture {
       30676  +
            inner: Box::pin(fut),
       30677  +
        }
       30678  +
    }
       30679  +
}
       30680  +
impl
       30681  +
    ::aws_smithy_http_server::response::IntoResponse<
       30682  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30683  +
    > for crate::output::RecursiveShapesOutput
       30684  +
{
       30685  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       30686  +
        match crate::protocol_serde::shape_recursive_shapes::ser_recursive_shapes_http_response(
       30687  +
            self,
       30688  +
        ) {
       30689  +
            Ok(response) => response,
       30690  +
            Err(e) => {
       30691  +
                ::tracing::error!(error = %e, "failed to serialize response");
       30692  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       30693  +
            }
       30694  +
        }
       30695  +
    }
       30696  +
}
       30697  +
29608  30698   
#[allow(unreachable_code, unused_variables)]
29609         -
mod server_media_type_header_test {
29610         -
    /// Headers that target strings with a mediaType are base64 encoded
29611         -
    /// Test ID: MediaTypeHeaderInputBase64
       30699  +
#[cfg(test)]
       30700  +
mod recursive_shapes_test {
       30701  +
       30702  +
    /// Serializes recursive structures
       30703  +
    /// Test ID: RestJsonRecursiveShapes
29612  30704   
    #[::tokio::test]
29613         -
    async fn media_type_header_input_base64_request() {
       30705  +
    #[::tracing_test::traced_test]
       30706  +
    async fn rest_json_recursive_shapes_request() {
29614  30707   
        #[allow(unused_mut)]
29615  30708   
                    let mut http_request = http::Request::builder()
29616         -
            .uri("/MediaTypeHeader")
29617         -
            .method("GET")
29618         -
            .header("X-Json", "dHJ1ZQ==")
29619         -
            .body(::aws_smithy_http_server::body::Body::from(
29620         -
                ::bytes::Bytes::from_static("".as_bytes()),
29621         -
            ))
29622         -
            .unwrap();
       30709  +
                        .uri("/RecursiveShapes")
       30710  +
                        .method("PUT")
       30711  +
        .header("Content-Type", "application/json")
       30712  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"nested\": {\n        \"foo\": \"Foo1\",\n        \"nested\": {\n            \"bar\": \"Bar1\",\n            \"recursiveMember\": {\n                \"foo\": \"Foo2\",\n                \"nested\": {\n                    \"bar\": \"Bar2\"\n                }\n            }\n        }\n    }\n}".as_bytes()))).unwrap();
29623  30713   
        #[allow(unused_mut)]
29624  30714   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29625  30715   
        let config = crate::service::RestJsonConfig::builder().build();
29626  30716   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29627         -
            .media_type_header(move |input: crate::input::MediaTypeHeaderInput| {
       30717  +
                        .recursive_shapes(move |input: crate::input::RecursiveShapesInput| {
29628  30718   
                            let sender = sender.clone();
29629  30719   
                            async move {
29630         -
                    let result = {
29631         -
                        let expected = crate::input::MediaTypeHeaderInput {
29632         -
                            json: ::std::option::Option::Some("true".to_owned()),
29633         -
                        };
       30720  +
                                let result = { let expected =
       30721  +
            crate::input::RecursiveShapesInput {
       30722  +
                nested:
       30723  +
                    ::std::option::Option::Some(
       30724  +
                        crate::model::RecursiveShapesInputOutputNested1 {
       30725  +
                            foo:
       30726  +
                                ::std::option::Option::Some(
       30727  +
                                    "Foo1".to_owned()
       30728  +
                                )
       30729  +
                            ,
       30730  +
                            nested:
       30731  +
                                ::std::option::Option::Some(
       30732  +
                                    ::std::boxed::Box::new(
       30733  +
                                        crate::model::RecursiveShapesInputOutputNested2 {
       30734  +
                                            bar:
       30735  +
                                                ::std::option::Option::Some(
       30736  +
                                                    "Bar1".to_owned()
       30737  +
                                                )
       30738  +
                                            ,
       30739  +
                                            recursive_member:
       30740  +
                                                ::std::option::Option::Some(
       30741  +
                                                    crate::model::RecursiveShapesInputOutputNested1 {
       30742  +
                                                        foo:
       30743  +
                                                            ::std::option::Option::Some(
       30744  +
                                                                "Foo2".to_owned()
       30745  +
                                                            )
       30746  +
                                                        ,
       30747  +
                                                        nested:
       30748  +
                                                            ::std::option::Option::Some(
       30749  +
                                                                ::std::boxed::Box::new(
       30750  +
                                                                    crate::model::RecursiveShapesInputOutputNested2 {
       30751  +
                                                                        bar:
       30752  +
                                                                            ::std::option::Option::Some(
       30753  +
                                                                                "Bar2".to_owned()
       30754  +
                                                                            )
       30755  +
                                                                        ,
       30756  +
                                                                        recursive_member:
       30757  +
                                                                            ::std::option::Option::None
       30758  +
                                                                        ,
       30759  +
                                                                    }
       30760  +
                                                                )
       30761  +
                                                            )
       30762  +
                                                        ,
       30763  +
                                                    }
       30764  +
                                                )
       30765  +
                                            ,
       30766  +
                                        }
       30767  +
                                    )
       30768  +
                                )
       30769  +
                            ,
       30770  +
                        }
       30771  +
                    )
       30772  +
                ,
       30773  +
            }
       30774  +
        ;
29634  30775   
        ::pretty_assertions::assert_eq!(input, expected);
29635         -
                        let response = crate::output::MediaTypeHeaderOutput {
29636         -
                            json: ::std::option::Option::None,
29637         -
                        };
29638         -
                        response
29639         -
                    };
       30776  +
        let response =
       30777  +
            crate::output::RecursiveShapesOutput {
       30778  +
                nested:
       30779  +
                    ::std::option::Option::None
       30780  +
                ,
       30781  +
            }
       30782  +
        ;
       30783  +
        response };
29640  30784   
                                sender.send(()).await.expect("receiver dropped early");
29641  30785   
                                result
29642  30786   
                            }
29643  30787   
                        })
29644  30788   
                        .build_unchecked();
29645  30789   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29646  30790   
            .await
29647  30791   
            .expect("unable to make an HTTP request");
29648         -
        assert!(receiver.recv().await.is_some());
       30792  +
        assert!(
       30793  +
            receiver.recv().await.is_some(),
       30794  +
            "we expected operation handler to be invoked but it was not entered"
       30795  +
        );
29649  30796   
    }
29650         -
    /// Headers that target strings with a mediaType are base64 encoded
29651         -
    /// Test ID: MediaTypeHeaderOutputBase64
       30797  +
    /// Serializes recursive structures
       30798  +
    /// Test ID: RestJsonRecursiveShapes
29652  30799   
    #[::tokio::test]
29653         -
    async fn media_type_header_output_base64_response() {
29654         -
        let output = crate::output::MediaTypeHeaderOutput {
29655         -
            json: ::std::option::Option::Some("true".to_owned()),
       30800  +
    #[::tracing_test::traced_test]
       30801  +
    async fn rest_json_recursive_shapes_response() {
       30802  +
        let output = crate::output::RecursiveShapesOutput {
       30803  +
            nested: ::std::option::Option::Some(crate::model::RecursiveShapesInputOutputNested1 {
       30804  +
                foo: ::std::option::Option::Some("Foo1".to_owned()),
       30805  +
                nested: ::std::option::Option::Some(::std::boxed::Box::new(
       30806  +
                    crate::model::RecursiveShapesInputOutputNested2 {
       30807  +
                        bar: ::std::option::Option::Some("Bar1".to_owned()),
       30808  +
                        recursive_member: ::std::option::Option::Some(
       30809  +
                            crate::model::RecursiveShapesInputOutputNested1 {
       30810  +
                                foo: ::std::option::Option::Some("Foo2".to_owned()),
       30811  +
                                nested: ::std::option::Option::Some(::std::boxed::Box::new(
       30812  +
                                    crate::model::RecursiveShapesInputOutputNested2 {
       30813  +
                                        bar: ::std::option::Option::Some("Bar2".to_owned()),
       30814  +
                                        recursive_member: ::std::option::Option::None,
       30815  +
                                    },
       30816  +
                                )),
       30817  +
                            },
       30818  +
                        ),
       30819  +
                    },
       30820  +
                )),
       30821  +
            }),
29656  30822   
        };
29657  30823   
        use ::aws_smithy_http_server::response::IntoResponse;
29658  30824   
        let http_response = output.into_response();
29659  30825   
        ::pretty_assertions::assert_eq!(
29660  30826   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29661  30827   
            http_response.status()
29662  30828   
        );
29663         -
        let expected_headers = [("X-Json", "dHJ1ZQ==")];
       30829  +
        let expected_headers = [("Content-Type", "application/json")];
29664  30830   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29665  30831   
            http_response.headers(),
29666  30832   
            expected_headers,
29667  30833   
        ));
       30834  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       30835  +
            .await
       30836  +
            .expect("unable to extract body to bytes");
       30837  +
        ::aws_smithy_protocol_test::assert_ok(
       30838  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"nested\": {\n        \"foo\": \"Foo1\",\n        \"nested\": {\n            \"bar\": \"Bar1\",\n            \"recursiveMember\": {\n                \"foo\": \"Foo2\",\n                \"nested\": {\n                    \"bar\": \"Bar2\"\n                }\n            }\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       30839  +
        );
29668  30840   
    }
29669  30841   
}
29670         -
#[cfg(test)]
29671         -
#[allow(unreachable_code, unused_variables)]
29672         -
mod server_no_input_and_no_output_test {
29673         -
    /// No input serializes no payload. When clients do not need to
29674         -
    /// serialize any data in the payload, they should omit a payload
29675         -
    /// altogether.
29676         -
    /// Test ID: RestJsonNoInputAndNoOutput
29677         -
    #[::tokio::test]
29678         -
    async fn rest_json_no_input_and_no_output_request() {
29679         -
        #[allow(unused_mut)]
29680         -
        let mut http_request = http::Request::builder()
29681         -
            .uri("/NoInputAndNoOutput")
29682         -
            .method("POST")
29683         -
            .body(::aws_smithy_http_server::body::Body::from(
29684         -
                ::bytes::Bytes::from_static("".as_bytes()),
29685         -
            ))
29686         -
            .unwrap();
29687         -
        #[allow(unused_mut)]
29688         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29689         -
        let config = crate::service::RestJsonConfig::builder().build();
29690         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29691         -
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
29692         -
                let sender = sender.clone();
29693         -
                async move {
29694         -
                    let result = {
29695         -
                        let expected = crate::input::NoInputAndNoOutputInput {};
29696         -
                        ::pretty_assertions::assert_eq!(input, expected);
29697         -
                        let response = crate::output::NoInputAndNoOutputOutput {};
29698         -
                        response
29699         -
                    };
29700         -
                    sender.send(()).await.expect("receiver dropped early");
29701         -
                    result
       30842  +
       30843  +
const CONTENT_TYPE_JSONINTENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
       30844  +
::pin_project_lite::pin_project! {
       30845  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       30846  +
    /// [`JsonIntEnumsInput`](crate::input::JsonIntEnumsInput) using modelled bindings.
       30847  +
    pub struct JsonIntEnumsInputFuture {
       30848  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonIntEnumsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
29702  30849   
    }
29703         -
            })
29704         -
            .build_unchecked();
29705         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       30850  +
}
       30851  +
       30852  +
impl std::future::Future for JsonIntEnumsInputFuture {
       30853  +
    type Output = Result<
       30854  +
        crate::input::JsonIntEnumsInput,
       30855  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       30856  +
    >;
       30857  +
       30858  +
    fn poll(
       30859  +
        self: std::pin::Pin<&mut Self>,
       30860  +
        cx: &mut std::task::Context<'_>,
       30861  +
    ) -> std::task::Poll<Self::Output> {
       30862  +
        let this = self.project();
       30863  +
        this.inner.as_mut().poll(cx)
       30864  +
    }
       30865  +
}
       30866  +
       30867  +
impl<B>
       30868  +
    ::aws_smithy_http_server::request::FromRequest<
       30869  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30870  +
        B,
       30871  +
    > for crate::input::JsonIntEnumsInput
       30872  +
where
       30873  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       30874  +
    B: 'static,
       30875  +
       30876  +
    B::Data: Send,
       30877  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       30878  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       30879  +
{
       30880  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       30881  +
    type Future = JsonIntEnumsInputFuture;
       30882  +
       30883  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       30884  +
        let fut = async move {
       30885  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       30886  +
                request.headers(),
       30887  +
                &CONTENT_TYPE_JSONINTENUMS,
       30888  +
            ) {
       30889  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       30890  +
            }
       30891  +
            crate::protocol_serde::shape_json_int_enums::de_json_int_enums_http_request(request)
29706  30892   
                .await
29707         -
            .expect("unable to make an HTTP request");
29708         -
        assert!(receiver.recv().await.is_some());
       30893  +
                .map_err(Into::into)
       30894  +
        };
       30895  +
        use ::futures_util::future::TryFutureExt;
       30896  +
        let fut = fut.map_err(
       30897  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       30898  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       30899  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       30900  +
                    e,
       30901  +
                )
       30902  +
            },
       30903  +
        );
       30904  +
        JsonIntEnumsInputFuture {
       30905  +
            inner: Box::pin(fut),
29709  30906   
        }
29710         -
    /// Servers should allow the accept header to be set to the
29711         -
    /// default content-type.
29712         -
    /// Test ID: RestJsonNoInputAllowsAccept
       30907  +
    }
       30908  +
}
       30909  +
impl
       30910  +
    ::aws_smithy_http_server::response::IntoResponse<
       30911  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30912  +
    > for crate::output::JsonIntEnumsOutput
       30913  +
{
       30914  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       30915  +
        match crate::protocol_serde::shape_json_int_enums::ser_json_int_enums_http_response(self) {
       30916  +
            Ok(response) => response,
       30917  +
            Err(e) => {
       30918  +
                ::tracing::error!(error = %e, "failed to serialize response");
       30919  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       30920  +
            }
       30921  +
        }
       30922  +
    }
       30923  +
}
       30924  +
impl
       30925  +
    ::aws_smithy_http_server::response::IntoResponse<
       30926  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       30927  +
    > for crate::error::JsonIntEnumsError
       30928  +
{
       30929  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       30930  +
        match crate::protocol_serde::shape_json_int_enums::ser_json_int_enums_http_error(&self) {
       30931  +
            Ok(mut response) => {
       30932  +
                response.extensions_mut().insert(
       30933  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       30934  +
                );
       30935  +
                response
       30936  +
            }
       30937  +
            Err(e) => {
       30938  +
                ::tracing::error!(error = %e, "failed to serialize response");
       30939  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       30940  +
            }
       30941  +
        }
       30942  +
    }
       30943  +
}
       30944  +
       30945  +
#[allow(unreachable_code, unused_variables)]
       30946  +
#[cfg(test)]
       30947  +
mod json_int_enums_test {
       30948  +
       30949  +
    /// Serializes intEnums as integers
       30950  +
    /// Test ID: RestJsonJsonIntEnums
29713  30951   
    #[::tokio::test]
29714         -
    async fn rest_json_no_input_allows_accept_request() {
       30952  +
    #[::tracing_test::traced_test]
       30953  +
    async fn rest_json_json_int_enums_request() {
29715  30954   
        #[allow(unused_mut)]
29716  30955   
                    let mut http_request = http::Request::builder()
29717         -
            .uri("/NoInputAndNoOutput")
29718         -
            .method("POST")
29719         -
            .header("Accept", "application/json")
29720         -
            .body(::aws_smithy_http_server::body::Body::from(
29721         -
                ::bytes::Bytes::from_static("".as_bytes()),
29722         -
            ))
29723         -
            .unwrap();
       30956  +
                        .uri("/JsonIntEnums")
       30957  +
                        .method("PUT")
       30958  +
        .header("Content-Type", "application/json")
       30959  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"integerEnum1\": 1,\n    \"integerEnum2\": 2,\n    \"integerEnum3\": 3,\n    \"integerEnumList\": [\n        1,\n        2,\n        3\n    ],\n    \"integerEnumSet\": [\n        1,\n        2\n    ],\n    \"integerEnumMap\": {\n        \"abc\": 1,\n        \"def\": 2\n    }\n}".as_bytes()))).unwrap();
29724  30960   
        #[allow(unused_mut)]
29725  30961   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29726  30962   
        let config = crate::service::RestJsonConfig::builder().build();
29727  30963   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29728         -
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
       30964  +
            .json_int_enums(move |input: crate::input::JsonIntEnumsInput| {
29729  30965   
                let sender = sender.clone();
29730  30966   
                async move {
29731  30967   
                    let result = {
29732         -
                        let expected = crate::input::NoInputAndNoOutputInput {};
       30968  +
                        let expected = crate::input::JsonIntEnumsInput {
       30969  +
                            integer_enum1: ::std::option::Option::Some(1),
       30970  +
                            integer_enum2: ::std::option::Option::Some(2),
       30971  +
                            integer_enum3: ::std::option::Option::Some(3),
       30972  +
                            integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
       30973  +
                            integer_enum_set: ::std::option::Option::Some(
       30974  +
                                vec![1, 2].try_into().expect("this is only used in tests"),
       30975  +
                            ),
       30976  +
                            integer_enum_map: ::std::option::Option::Some({
       30977  +
                                let mut ret = ::std::collections::HashMap::new();
       30978  +
                                ret.insert("abc".to_owned(), 1);
       30979  +
                                ret.insert("def".to_owned(), 2);
       30980  +
                                ret
       30981  +
                            }),
       30982  +
                        };
29733  30983   
                        ::pretty_assertions::assert_eq!(input, expected);
29734         -
                        let response = crate::output::NoInputAndNoOutputOutput {};
29735         -
                        response
       30984  +
                        let response = crate::output::JsonIntEnumsOutput {
       30985  +
                            integer_enum1: ::std::option::Option::None,
       30986  +
                            integer_enum2: ::std::option::Option::None,
       30987  +
                            integer_enum3: ::std::option::Option::None,
       30988  +
                            integer_enum_list: ::std::option::Option::None,
       30989  +
                            integer_enum_set: ::std::option::Option::None,
       30990  +
                            integer_enum_map: ::std::option::Option::None,
       30991  +
                        };
       30992  +
                        Ok(response)
29736  30993   
                    };
29737  30994   
                    sender.send(()).await.expect("receiver dropped early");
29738  30995   
                    result
29739  30996   
                }
29740  30997   
            })
29741  30998   
            .build_unchecked();
29742  30999   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29743  31000   
            .await
29744  31001   
            .expect("unable to make an HTTP request");
29745         -
        assert!(receiver.recv().await.is_some());
       31002  +
        assert!(
       31003  +
            receiver.recv().await.is_some(),
       31004  +
            "we expected operation handler to be invoked but it was not entered"
       31005  +
        );
29746  31006   
    }
29747         -
    /// When an operation does not define output, the service will respond
29748         -
    /// with an empty payload, and may optionally include the content-type
29749         -
    /// header.
29750         -
    /// Test ID: RestJsonNoInputAndNoOutput
       31007  +
    /// Serializes intEnums as integers
       31008  +
    /// Test ID: RestJsonJsonIntEnums
29751  31009   
    #[::tokio::test]
29752         -
    async fn rest_json_no_input_and_no_output_response() {
29753         -
        let output = crate::output::NoInputAndNoOutputOutput {};
       31010  +
    #[::tracing_test::traced_test]
       31011  +
    async fn rest_json_json_int_enums_response() {
       31012  +
        let output = crate::output::JsonIntEnumsOutput {
       31013  +
            integer_enum1: ::std::option::Option::Some(1),
       31014  +
            integer_enum2: ::std::option::Option::Some(2),
       31015  +
            integer_enum3: ::std::option::Option::Some(3),
       31016  +
            integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
       31017  +
            integer_enum_set: ::std::option::Option::Some(
       31018  +
                vec![1, 2].try_into().expect("this is only used in tests"),
       31019  +
            ),
       31020  +
            integer_enum_map: ::std::option::Option::Some({
       31021  +
                let mut ret = ::std::collections::HashMap::new();
       31022  +
                ret.insert("abc".to_owned(), 1);
       31023  +
                ret.insert("def".to_owned(), 2);
       31024  +
                ret
       31025  +
            }),
       31026  +
        };
29754  31027   
        use ::aws_smithy_http_server::response::IntoResponse;
29755  31028   
        let http_response = output.into_response();
29756  31029   
        ::pretty_assertions::assert_eq!(
29757  31030   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29758  31031   
            http_response.status()
29759  31032   
        );
       31033  +
        let expected_headers = [("Content-Type", "application/json")];
       31034  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       31035  +
            http_response.headers(),
       31036  +
            expected_headers,
       31037  +
        ));
29760  31038   
        let body = ::hyper::body::to_bytes(http_response.into_body())
29761  31039   
            .await
29762  31040   
            .expect("unable to extract body to bytes");
29763         -
        // No body.
29764         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       31041  +
        ::aws_smithy_protocol_test::assert_ok(
       31042  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"integerEnum1\": 1,\n    \"integerEnum2\": 2,\n    \"integerEnum3\": 3,\n    \"integerEnumList\": [\n        1,\n        2,\n        3\n    ],\n    \"integerEnumSet\": [\n        1,\n        2\n    ],\n    \"integerEnumMap\": {\n        \"abc\": 1,\n        \"def\": 2\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       31043  +
        );
29765  31044   
    }
29766  31045   
}
29767         -
#[cfg(test)]
29768         -
#[allow(unreachable_code, unused_variables)]
29769         -
mod server_no_input_and_output_test {
29770         -
    /// No input serializes no payload. When clients do not need to
29771         -
    /// serialize any data in the payload, they should omit a payload
29772         -
    /// altogether.
29773         -
    /// Test ID: RestJsonNoInputAndOutput
29774         -
    #[::tokio::test]
29775         -
    async fn rest_json_no_input_and_output_request() {
29776         -
        #[allow(unused_mut)]
29777         -
        let mut http_request = http::Request::builder()
29778         -
            .uri("/NoInputAndOutputOutput")
29779         -
            .method("POST")
29780         -
            .body(::aws_smithy_http_server::body::Body::from(
29781         -
                ::bytes::Bytes::from_static("".as_bytes()),
29782         -
            ))
29783         -
            .unwrap();
29784         -
        #[allow(unused_mut)]
29785         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29786         -
        let config = crate::service::RestJsonConfig::builder().build();
29787         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29788         -
            .no_input_and_output(move |input: crate::input::NoInputAndOutputInput| {
29789         -
                let sender = sender.clone();
29790         -
                async move {
29791         -
                    let result = {
29792         -
                        let expected = crate::input::NoInputAndOutputInput {};
29793         -
                        ::pretty_assertions::assert_eq!(input, expected);
29794         -
                        let response = crate::output::NoInputAndOutputOutput {};
29795         -
                        response
29796         -
                    };
29797         -
                    sender.send(()).await.expect("receiver dropped early");
29798         -
                    result
       31046  +
       31047  +
const CONTENT_TYPE_JSONENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
       31048  +
::pin_project_lite::pin_project! {
       31049  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       31050  +
    /// [`JsonEnumsInput`](crate::input::JsonEnumsInput) using modelled bindings.
       31051  +
    pub struct JsonEnumsInputFuture {
       31052  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonEnumsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
29799  31053   
    }
29800         -
            })
29801         -
            .build_unchecked();
29802         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31054  +
}
       31055  +
       31056  +
impl std::future::Future for JsonEnumsInputFuture {
       31057  +
    type Output = Result<
       31058  +
        crate::input::JsonEnumsInput,
       31059  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       31060  +
    >;
       31061  +
       31062  +
    fn poll(
       31063  +
        self: std::pin::Pin<&mut Self>,
       31064  +
        cx: &mut std::task::Context<'_>,
       31065  +
    ) -> std::task::Poll<Self::Output> {
       31066  +
        let this = self.project();
       31067  +
        this.inner.as_mut().poll(cx)
       31068  +
    }
       31069  +
}
       31070  +
       31071  +
impl<B>
       31072  +
    ::aws_smithy_http_server::request::FromRequest<
       31073  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       31074  +
        B,
       31075  +
    > for crate::input::JsonEnumsInput
       31076  +
where
       31077  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       31078  +
    B: 'static,
       31079  +
       31080  +
    B::Data: Send,
       31081  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       31082  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       31083  +
{
       31084  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       31085  +
    type Future = JsonEnumsInputFuture;
       31086  +
       31087  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       31088  +
        let fut = async move {
       31089  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       31090  +
                request.headers(),
       31091  +
                &CONTENT_TYPE_JSONENUMS,
       31092  +
            ) {
       31093  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       31094  +
            }
       31095  +
            crate::protocol_serde::shape_json_enums::de_json_enums_http_request(request)
29803  31096   
                .await
29804         -
            .expect("unable to make an HTTP request");
29805         -
        assert!(receiver.recv().await.is_some());
       31097  +
                .map_err(Into::into)
       31098  +
        };
       31099  +
        use ::futures_util::future::TryFutureExt;
       31100  +
        let fut = fut.map_err(
       31101  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       31102  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       31103  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       31104  +
                    e,
       31105  +
                )
       31106  +
            },
       31107  +
        );
       31108  +
        JsonEnumsInputFuture {
       31109  +
            inner: Box::pin(fut),
29806  31110   
        }
29807         -
    /// Servers should allow the accept header to be set to the
29808         -
    /// default content-type.
29809         -
    /// Test ID: RestJsonNoInputAndOutputAllowsAccept
       31111  +
    }
       31112  +
}
       31113  +
impl
       31114  +
    ::aws_smithy_http_server::response::IntoResponse<
       31115  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       31116  +
    > for crate::output::JsonEnumsOutput
       31117  +
{
       31118  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       31119  +
        match crate::protocol_serde::shape_json_enums::ser_json_enums_http_response(self) {
       31120  +
            Ok(response) => response,
       31121  +
            Err(e) => {
       31122  +
                ::tracing::error!(error = %e, "failed to serialize response");
       31123  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       31124  +
            }
       31125  +
        }
       31126  +
    }
       31127  +
}
       31128  +
impl
       31129  +
    ::aws_smithy_http_server::response::IntoResponse<
       31130  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       31131  +
    > for crate::error::JsonEnumsError
       31132  +
{
       31133  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       31134  +
        match crate::protocol_serde::shape_json_enums::ser_json_enums_http_error(&self) {
       31135  +
            Ok(mut response) => {
       31136  +
                response.extensions_mut().insert(
       31137  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       31138  +
                );
       31139  +
                response
       31140  +
            }
       31141  +
            Err(e) => {
       31142  +
                ::tracing::error!(error = %e, "failed to serialize response");
       31143  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       31144  +
            }
       31145  +
        }
       31146  +
    }
       31147  +
}
       31148  +
       31149  +
#[allow(unreachable_code, unused_variables)]
       31150  +
#[cfg(test)]
       31151  +
mod json_enums_test {
       31152  +
       31153  +
    /// Serializes simple scalar properties
       31154  +
    /// Test ID: RestJsonJsonEnums
29810  31155   
    #[::tokio::test]
29811         -
    async fn rest_json_no_input_and_output_allows_accept_request() {
       31156  +
    #[::tracing_test::traced_test]
       31157  +
    async fn rest_json_json_enums_request() {
29812  31158   
        #[allow(unused_mut)]
29813  31159   
                    let mut http_request = http::Request::builder()
29814         -
            .uri("/NoInputAndOutputOutput")
29815         -
            .method("POST")
29816         -
            .header("Accept", "application/json")
29817         -
            .body(::aws_smithy_http_server::body::Body::from(
29818         -
                ::bytes::Bytes::from_static("".as_bytes()),
29819         -
            ))
29820         -
            .unwrap();
       31160  +
                        .uri("/JsonEnums")
       31161  +
                        .method("PUT")
       31162  +
        .header("Content-Type", "application/json")
       31163  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"fooEnum1\": \"Foo\",\n    \"fooEnum2\": \"0\",\n    \"fooEnum3\": \"1\",\n    \"fooEnumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumSet\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumMap\": {\n        \"hi\": \"Foo\",\n        \"zero\": \"0\"\n    }\n}".as_bytes()))).unwrap();
29821  31164   
        #[allow(unused_mut)]
29822  31165   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29823  31166   
        let config = crate::service::RestJsonConfig::builder().build();
29824  31167   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29825         -
            .no_input_and_output(move |input: crate::input::NoInputAndOutputInput| {
       31168  +
            .json_enums(move |input: crate::input::JsonEnumsInput| {
29826  31169   
                let sender = sender.clone();
29827  31170   
                async move {
29828  31171   
                    let result = {
29829         -
                        let expected = crate::input::NoInputAndOutputInput {};
       31172  +
                        let expected = crate::input::JsonEnumsInput {
       31173  +
                            foo_enum1: ::std::option::Option::Some(
       31174  +
                                "Foo"
       31175  +
                                    .parse::<crate::model::FooEnum>()
       31176  +
                                    .expect("static value validated to member"),
       31177  +
                            ),
       31178  +
                            foo_enum2: ::std::option::Option::Some(
       31179  +
                                "0".parse::<crate::model::FooEnum>()
       31180  +
                                    .expect("static value validated to member"),
       31181  +
                            ),
       31182  +
                            foo_enum3: ::std::option::Option::Some(
       31183  +
                                "1".parse::<crate::model::FooEnum>()
       31184  +
                                    .expect("static value validated to member"),
       31185  +
                            ),
       31186  +
                            foo_enum_list: ::std::option::Option::Some(vec![
       31187  +
                                "Foo"
       31188  +
                                    .parse::<crate::model::FooEnum>()
       31189  +
                                    .expect("static value validated to member"),
       31190  +
                                "0".parse::<crate::model::FooEnum>()
       31191  +
                                    .expect("static value validated to member"),
       31192  +
                            ]),
       31193  +
                            foo_enum_set: ::std::option::Option::Some(
       31194  +
                                vec![
       31195  +
                                    "Foo"
       31196  +
                                        .parse::<crate::model::FooEnum>()
       31197  +
                                        .expect("static value validated to member"),
       31198  +
                                    "0".parse::<crate::model::FooEnum>()
       31199  +
                                        .expect("static value validated to member"),
       31200  +
                                ]
       31201  +
                                .try_into()
       31202  +
                                .expect("this is only used in tests"),
       31203  +
                            ),
       31204  +
                            foo_enum_map: ::std::option::Option::Some({
       31205  +
                                let mut ret = ::std::collections::HashMap::new();
       31206  +
                                ret.insert(
       31207  +
                                    "hi".to_owned(),
       31208  +
                                    "Foo"
       31209  +
                                        .parse::<crate::model::FooEnum>()
       31210  +
                                        .expect("static value validated to member"),
       31211  +
                                );
       31212  +
                                ret.insert(
       31213  +
                                    "zero".to_owned(),
       31214  +
                                    "0".parse::<crate::model::FooEnum>()
       31215  +
                                        .expect("static value validated to member"),
       31216  +
                                );
       31217  +
                                ret
       31218  +
                            }),
       31219  +
                        };
29830  31220   
                        ::pretty_assertions::assert_eq!(input, expected);
29831         -
                        let response = crate::output::NoInputAndOutputOutput {};
29832         -
                        response
       31221  +
                        let response = crate::output::JsonEnumsOutput {
       31222  +
                            foo_enum1: ::std::option::Option::None,
       31223  +
                            foo_enum2: ::std::option::Option::None,
       31224  +
                            foo_enum3: ::std::option::Option::None,
       31225  +
                            foo_enum_list: ::std::option::Option::None,
       31226  +
                            foo_enum_set: ::std::option::Option::None,
       31227  +
                            foo_enum_map: ::std::option::Option::None,
       31228  +
                        };
       31229  +
                        Ok(response)
29833  31230   
                    };
29834  31231   
                    sender.send(()).await.expect("receiver dropped early");
29835  31232   
                    result
29836  31233   
                }
29837  31234   
            })
29838  31235   
            .build_unchecked();
29839  31236   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29840  31237   
            .await
29841  31238   
            .expect("unable to make an HTTP request");
29842         -
        assert!(receiver.recv().await.is_some());
       31239  +
        assert!(
       31240  +
            receiver.recv().await.is_some(),
       31241  +
            "we expected operation handler to be invoked but it was not entered"
       31242  +
        );
29843  31243   
    }
29844         -
    /// Operations that define output and do not bind anything to
29845         -
    /// the payload return a JSON object in the response.
29846         -
    /// Test ID: RestJsonNoInputAndOutputWithJson
       31244  +
    /// Serializes simple scalar properties
       31245  +
    /// Test ID: RestJsonJsonEnums
29847  31246   
    #[::tokio::test]
29848         -
    async fn rest_json_no_input_and_output_with_json_response() {
29849         -
        let output = crate::output::NoInputAndOutputOutput {};
       31247  +
    #[::tracing_test::traced_test]
       31248  +
    async fn rest_json_json_enums_response() {
       31249  +
        let output = crate::output::JsonEnumsOutput {
       31250  +
            foo_enum1: ::std::option::Option::Some(
       31251  +
                "Foo"
       31252  +
                    .parse::<crate::model::FooEnum>()
       31253  +
                    .expect("static value validated to member"),
       31254  +
            ),
       31255  +
            foo_enum2: ::std::option::Option::Some(
       31256  +
                "0".parse::<crate::model::FooEnum>()
       31257  +
                    .expect("static value validated to member"),
       31258  +
            ),
       31259  +
            foo_enum3: ::std::option::Option::Some(
       31260  +
                "1".parse::<crate::model::FooEnum>()
       31261  +
                    .expect("static value validated to member"),
       31262  +
            ),
       31263  +
            foo_enum_list: ::std::option::Option::Some(vec![
       31264  +
                "Foo"
       31265  +
                    .parse::<crate::model::FooEnum>()
       31266  +
                    .expect("static value validated to member"),
       31267  +
                "0".parse::<crate::model::FooEnum>()
       31268  +
                    .expect("static value validated to member"),
       31269  +
            ]),
       31270  +
            foo_enum_set: ::std::option::Option::Some(
       31271  +
                vec![
       31272  +
                    "Foo"
       31273  +
                        .parse::<crate::model::FooEnum>()
       31274  +
                        .expect("static value validated to member"),
       31275  +
                    "0".parse::<crate::model::FooEnum>()
       31276  +
                        .expect("static value validated to member"),
       31277  +
                ]
       31278  +
                .try_into()
       31279  +
                .expect("this is only used in tests"),
       31280  +
            ),
       31281  +
            foo_enum_map: ::std::option::Option::Some({
       31282  +
                let mut ret = ::std::collections::HashMap::new();
       31283  +
                ret.insert(
       31284  +
                    "hi".to_owned(),
       31285  +
                    "Foo"
       31286  +
                        .parse::<crate::model::FooEnum>()
       31287  +
                        .expect("static value validated to member"),
       31288  +
                );
       31289  +
                ret.insert(
       31290  +
                    "zero".to_owned(),
       31291  +
                    "0".parse::<crate::model::FooEnum>()
       31292  +
                        .expect("static value validated to member"),
       31293  +
                );
       31294  +
                ret
       31295  +
            }),
       31296  +
        };
29850  31297   
        use ::aws_smithy_http_server::response::IntoResponse;
29851  31298   
        let http_response = output.into_response();
29852  31299   
        ::pretty_assertions::assert_eq!(
29853  31300   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29854  31301   
            http_response.status()
29855  31302   
        );
29856  31303   
        let expected_headers = [("Content-Type", "application/json")];
29857  31304   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
29858  31305   
            http_response.headers(),
29859  31306   
            expected_headers,
29860  31307   
        ));
29861  31308   
        let body = ::hyper::body::to_bytes(http_response.into_body())
29862  31309   
            .await
29863  31310   
            .expect("unable to extract body to bytes");
29864         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
29865         -
            &body,
29866         -
            "{}",
29867         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
29868         -
        ));
       31311  +
        ::aws_smithy_protocol_test::assert_ok(
       31312  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"fooEnum1\": \"Foo\",\n    \"fooEnum2\": \"0\",\n    \"fooEnum3\": \"1\",\n    \"fooEnumList\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumSet\": [\n        \"Foo\",\n        \"0\"\n    ],\n    \"fooEnumMap\": {\n        \"hi\": \"Foo\",\n        \"zero\": \"0\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       31313  +
        );
29869  31314   
    }
29870  31315   
}
29871         -
#[cfg(test)]
29872         -
#[allow(unreachable_code, unused_variables)]
29873         -
mod server_null_and_empty_headers_server_test {
29874         -
    /// Do not send null or empty headers
29875         -
    /// Test ID: RestJsonNullAndEmptyHeaders
29876         -
    #[::tokio::test]
29877         -
    async fn rest_json_null_and_empty_headers_response() {
29878         -
        let output = crate::output::NullAndEmptyHeadersServerOutput {
29879         -
            a: ::std::option::Option::None,
29880         -
            b: ::std::option::Option::Some("".to_owned()),
29881         -
            c: ::std::option::Option::Some(vec![]),
       31316  +
       31317  +
const CONTENT_TYPE_JSONTIMESTAMPS: ::mime::Mime = ::mime::APPLICATION_JSON;
       31318  +
::pin_project_lite::pin_project! {
       31319  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       31320  +
    /// [`JsonTimestampsInput`](crate::input::JsonTimestampsInput) using modelled bindings.
       31321  +
    pub struct JsonTimestampsInputFuture {
       31322  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonTimestampsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       31323  +
    }
       31324  +
}
       31325  +
       31326  +
impl std::future::Future for JsonTimestampsInputFuture {
       31327  +
    type Output = Result<
       31328  +
        crate::input::JsonTimestampsInput,
       31329  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       31330  +
    >;
       31331  +
       31332  +
    fn poll(
       31333  +
        self: std::pin::Pin<&mut Self>,
       31334  +
        cx: &mut std::task::Context<'_>,
       31335  +
    ) -> std::task::Poll<Self::Output> {
       31336  +
        let this = self.project();
       31337  +
        this.inner.as_mut().poll(cx)
       31338  +
    }
       31339  +
}
       31340  +
       31341  +
impl<B>
       31342  +
    ::aws_smithy_http_server::request::FromRequest<
       31343  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       31344  +
        B,
       31345  +
    > for crate::input::JsonTimestampsInput
       31346  +
where
       31347  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       31348  +
    B: 'static,
       31349  +
       31350  +
    B::Data: Send,
       31351  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       31352  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       31353  +
{
       31354  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       31355  +
    type Future = JsonTimestampsInputFuture;
       31356  +
       31357  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       31358  +
        let fut = async move {
       31359  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       31360  +
                request.headers(),
       31361  +
                &CONTENT_TYPE_JSONTIMESTAMPS,
       31362  +
            ) {
       31363  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       31364  +
            }
       31365  +
            crate::protocol_serde::shape_json_timestamps::de_json_timestamps_http_request(request)
       31366  +
                .await
       31367  +
                .map_err(Into::into)
29882  31368   
        };
29883         -
        use ::aws_smithy_http_server::response::IntoResponse;
29884         -
        let http_response = output.into_response();
29885         -
        ::pretty_assertions::assert_eq!(
29886         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
29887         -
            http_response.status()
       31369  +
        use ::futures_util::future::TryFutureExt;
       31370  +
        let fut = fut.map_err(
       31371  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       31372  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       31373  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       31374  +
                    e,
       31375  +
                )
       31376  +
            },
29888  31377   
        );
29889         -
        let forbidden_headers = &["X-A", "X-B", "X-C"];
29890         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::forbid_headers(
29891         -
            http_response.headers(),
29892         -
            forbidden_headers,
29893         -
        ));
       31378  +
        JsonTimestampsInputFuture {
       31379  +
            inner: Box::pin(fut),
       31380  +
        }
29894  31381   
    }
29895  31382   
}
29896         -
#[cfg(test)]
       31383  +
impl
       31384  +
    ::aws_smithy_http_server::response::IntoResponse<
       31385  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       31386  +
    > for crate::output::JsonTimestampsOutput
       31387  +
{
       31388  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       31389  +
        match crate::protocol_serde::shape_json_timestamps::ser_json_timestamps_http_response(self)
       31390  +
        {
       31391  +
            Ok(response) => response,
       31392  +
            Err(e) => {
       31393  +
                ::tracing::error!(error = %e, "failed to serialize response");
       31394  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       31395  +
            }
       31396  +
        }
       31397  +
    }
       31398  +
}
       31399  +
29897  31400   
#[allow(unreachable_code, unused_variables)]
29898         -
mod server_omits_null_serializes_empty_string_test {
29899         -
    /// Serializes empty query strings
29900         -
    /// Test ID: RestJsonSerializesEmptyQueryValue
       31401  +
#[cfg(test)]
       31402  +
mod json_timestamps_test {
       31403  +
       31404  +
    /// Tests how normal timestamps are serialized
       31405  +
    /// Test ID: RestJsonJsonTimestamps
29901  31406   
    #[::tokio::test]
29902         -
    async fn rest_json_serializes_empty_query_value_request() {
       31407  +
    #[::tracing_test::traced_test]
       31408  +
    async fn rest_json_json_timestamps_request() {
29903  31409   
        #[allow(unused_mut)]
29904  31410   
        let mut http_request = http::Request::builder()
29905         -
            .uri("/OmitsNullSerializesEmptyString")
29906         -
            .method("GET")
       31411  +
            .uri("/JsonTimestamps")
       31412  +
            .method("POST")
       31413  +
            .header("Content-Type", "application/json")
29907  31414   
            .body(::aws_smithy_http_server::body::Body::from(
29908         -
                ::bytes::Bytes::from_static("".as_bytes()),
       31415  +
                ::bytes::Bytes::from_static("{\n    \"normal\": 1398796238\n}".as_bytes()),
29909  31416   
            ))
29910  31417   
            .unwrap();
29911         -
        *http_request.uri_mut() = "/OmitsNullSerializesEmptyString?Empty=".parse().unwrap();
29912  31418   
        #[allow(unused_mut)]
29913  31419   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29914  31420   
        let config = crate::service::RestJsonConfig::builder().build();
29915  31421   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29916         -
            .omits_null_serializes_empty_string(
29917         -
                move |input: crate::input::OmitsNullSerializesEmptyStringInput| {
       31422  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
29918  31423   
                let sender = sender.clone();
29919  31424   
                async move {
29920  31425   
                    let result = {
29921         -
                            let expected = crate::input::OmitsNullSerializesEmptyStringInput {
29922         -
                                empty_string: ::std::option::Option::Some("".to_owned()),
29923         -
                                null_value: ::std::option::Option::None,
       31426  +
                        let expected = crate::input::JsonTimestampsInput {
       31427  +
                            normal: ::std::option::Option::Some(
       31428  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       31429  +
                                    1398796238, 0_f64,
       31430  +
                                ),
       31431  +
                            ),
       31432  +
                            date_time: ::std::option::Option::None,
       31433  +
                            date_time_on_target: ::std::option::Option::None,
       31434  +
                            epoch_seconds: ::std::option::Option::None,
       31435  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31436  +
                            http_date: ::std::option::Option::None,
       31437  +
                            http_date_on_target: ::std::option::Option::None,
29924  31438   
                        };
29925  31439   
                        ::pretty_assertions::assert_eq!(input, expected);
29926         -
                            let response = crate::output::OmitsNullSerializesEmptyStringOutput {};
       31440  +
                        let response = crate::output::JsonTimestampsOutput {
       31441  +
                            normal: ::std::option::Option::None,
       31442  +
                            date_time: ::std::option::Option::None,
       31443  +
                            date_time_on_target: ::std::option::Option::None,
       31444  +
                            epoch_seconds: ::std::option::Option::None,
       31445  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31446  +
                            http_date: ::std::option::Option::None,
       31447  +
                            http_date_on_target: ::std::option::Option::None,
       31448  +
                        };
29927  31449   
                        response
29928  31450   
                    };
29929  31451   
                    sender.send(()).await.expect("receiver dropped early");
29930  31452   
                    result
29931  31453   
                }
29932         -
                },
29933         -
            )
       31454  +
            })
29934  31455   
            .build_unchecked();
29935  31456   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29936  31457   
            .await
29937  31458   
            .expect("unable to make an HTTP request");
29938         -
        assert!(receiver.recv().await.is_some());
       31459  +
        assert!(
       31460  +
            receiver.recv().await.is_some(),
       31461  +
            "we expected operation handler to be invoked but it was not entered"
       31462  +
        );
29939  31463   
    }
29940         -
    /// Servers accept static query params as empty strings.
29941         -
    /// Test ID: RestJsonServersAcceptStaticQueryParamAsEmptyString
       31464  +
    /// Ensures that the timestampFormat of date-time works like normal timestamps
       31465  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
29942  31466   
    #[::tokio::test]
29943         -
    async fn rest_json_servers_accept_static_query_param_as_empty_string_request() {
       31467  +
    #[::tracing_test::traced_test]
       31468  +
    async fn rest_json_json_timestamps_with_date_time_format_request() {
29944  31469   
        #[allow(unused_mut)]
29945  31470   
        let mut http_request = http::Request::builder()
29946         -
            .uri("/OmitsNullSerializesEmptyString")
29947         -
            .method("GET")
       31471  +
            .uri("/JsonTimestamps")
       31472  +
            .method("POST")
       31473  +
            .header("Content-Type", "application/json")
29948  31474   
            .body(::aws_smithy_http_server::body::Body::from(
29949         -
                ::bytes::Bytes::from_static("".as_bytes()),
       31475  +
                ::bytes::Bytes::from_static(
       31476  +
                    "{\n    \"dateTime\": \"2014-04-29T18:30:38Z\"\n}".as_bytes(),
       31477  +
                ),
29950  31478   
            ))
29951  31479   
            .unwrap();
29952         -
        *http_request.uri_mut() = "/OmitsNullSerializesEmptyString?Empty".parse().unwrap();
29953  31480   
        #[allow(unused_mut)]
29954  31481   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
29955  31482   
        let config = crate::service::RestJsonConfig::builder().build();
29956  31483   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
29957         -
            .omits_null_serializes_empty_string(
29958         -
                move |input: crate::input::OmitsNullSerializesEmptyStringInput| {
       31484  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
29959  31485   
                let sender = sender.clone();
29960  31486   
                async move {
29961  31487   
                    let result = {
29962         -
                            let expected = crate::input::OmitsNullSerializesEmptyStringInput {
29963         -
                                empty_string: ::std::option::Option::Some("".to_owned()),
29964         -
                                null_value: ::std::option::Option::None,
       31488  +
                        let expected = crate::input::JsonTimestampsInput {
       31489  +
                            date_time: ::std::option::Option::Some(
       31490  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       31491  +
                                    1398796238, 0_f64,
       31492  +
                                ),
       31493  +
                            ),
       31494  +
                            normal: ::std::option::Option::None,
       31495  +
                            date_time_on_target: ::std::option::Option::None,
       31496  +
                            epoch_seconds: ::std::option::Option::None,
       31497  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31498  +
                            http_date: ::std::option::Option::None,
       31499  +
                            http_date_on_target: ::std::option::Option::None,
29965  31500   
                        };
29966  31501   
                        ::pretty_assertions::assert_eq!(input, expected);
29967         -
                            let response = crate::output::OmitsNullSerializesEmptyStringOutput {};
       31502  +
                        let response = crate::output::JsonTimestampsOutput {
       31503  +
                            normal: ::std::option::Option::None,
       31504  +
                            date_time: ::std::option::Option::None,
       31505  +
                            date_time_on_target: ::std::option::Option::None,
       31506  +
                            epoch_seconds: ::std::option::Option::None,
       31507  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31508  +
                            http_date: ::std::option::Option::None,
       31509  +
                            http_date_on_target: ::std::option::Option::None,
       31510  +
                        };
29968  31511   
                        response
29969  31512   
                    };
29970  31513   
                    sender.send(()).await.expect("receiver dropped early");
29971  31514   
                    result
29972  31515   
                }
29973         -
                },
29974         -
            )
       31516  +
            })
29975  31517   
            .build_unchecked();
29976  31518   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
29977  31519   
            .await
29978  31520   
            .expect("unable to make an HTTP request");
29979         -
        assert!(receiver.recv().await.is_some());
       31521  +
        assert!(
       31522  +
            receiver.recv().await.is_some(),
       31523  +
            "we expected operation handler to be invoked but it was not entered"
       31524  +
        );
29980  31525   
    }
29981         -
}
29982         -
#[cfg(test)]
29983         -
#[allow(unreachable_code, unused_variables)]
29984         -
mod server_omits_serializing_empty_lists_test {
29985         -
    /// Supports omitting empty lists.
29986         -
    /// Test ID: RestJsonOmitsEmptyListQueryValues
       31526  +
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
       31527  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
29987  31528   
    #[::tokio::test]
29988         -
    #[should_panic]
29989         -
    async fn rest_json_omits_empty_list_query_values_request() {
       31529  +
    #[::tracing_test::traced_test]
       31530  +
    async fn rest_json_json_timestamps_with_date_time_on_target_format_request() {
29990  31531   
        #[allow(unused_mut)]
29991  31532   
        let mut http_request = http::Request::builder()
29992         -
            .uri("/OmitsSerializingEmptyLists")
       31533  +
            .uri("/JsonTimestamps")
29993  31534   
            .method("POST")
       31535  +
            .header("Content-Type", "application/json")
29994  31536   
            .body(::aws_smithy_http_server::body::Body::from(
29995         -
                ::bytes::Bytes::from_static("".as_bytes()),
       31537  +
                ::bytes::Bytes::from_static(
       31538  +
                    "{\n    \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\"\n}".as_bytes(),
       31539  +
                ),
29996  31540   
            ))
29997  31541   
            .unwrap();
29998  31542   
        #[allow(unused_mut)]
29999  31543   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30000  31544   
        let config = crate::service::RestJsonConfig::builder().build();
30001  31545   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30002         -
            .omits_serializing_empty_lists(
30003         -
                move |input: crate::input::OmitsSerializingEmptyListsInput| {
       31546  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
30004  31547   
                let sender = sender.clone();
30005  31548   
                async move {
30006  31549   
                    let result = {
30007         -
                            let expected = crate::input::OmitsSerializingEmptyListsInput {
30008         -
                                query_string_list: ::std::option::Option::Some(vec![]),
30009         -
                                query_integer_list: ::std::option::Option::Some(vec![]),
30010         -
                                query_double_list: ::std::option::Option::Some(vec![]),
30011         -
                                query_boolean_list: ::std::option::Option::Some(vec![]),
30012         -
                                query_timestamp_list: ::std::option::Option::Some(vec![]),
30013         -
                                query_enum_list: ::std::option::Option::Some(vec![]),
30014         -
                                query_integer_enum_list: ::std::option::Option::Some(vec![]),
       31550  +
                        let expected = crate::input::JsonTimestampsInput {
       31551  +
                            date_time_on_target: ::std::option::Option::Some(
       31552  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       31553  +
                                    1398796238, 0_f64,
       31554  +
                                ),
       31555  +
                            ),
       31556  +
                            normal: ::std::option::Option::None,
       31557  +
                            date_time: ::std::option::Option::None,
       31558  +
                            epoch_seconds: ::std::option::Option::None,
       31559  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31560  +
                            http_date: ::std::option::Option::None,
       31561  +
                            http_date_on_target: ::std::option::Option::None,
30015  31562   
                        };
30016  31563   
                        ::pretty_assertions::assert_eq!(input, expected);
30017         -
                            let response = crate::output::OmitsSerializingEmptyListsOutput {};
30018         -
                            Ok(response)
       31564  +
                        let response = crate::output::JsonTimestampsOutput {
       31565  +
                            normal: ::std::option::Option::None,
       31566  +
                            date_time: ::std::option::Option::None,
       31567  +
                            date_time_on_target: ::std::option::Option::None,
       31568  +
                            epoch_seconds: ::std::option::Option::None,
       31569  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31570  +
                            http_date: ::std::option::Option::None,
       31571  +
                            http_date_on_target: ::std::option::Option::None,
       31572  +
                        };
       31573  +
                        response
30019  31574   
                    };
30020  31575   
                    sender.send(()).await.expect("receiver dropped early");
30021  31576   
                    result
30022  31577   
                }
30023         -
                },
30024         -
            )
       31578  +
            })
30025  31579   
            .build_unchecked();
30026  31580   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30027  31581   
            .await
30028  31582   
            .expect("unable to make an HTTP request");
30029         -
        assert!(receiver.recv().await.is_some());
       31583  +
        assert!(
       31584  +
            receiver.recv().await.is_some(),
       31585  +
            "we expected operation handler to be invoked but it was not entered"
       31586  +
        );
30030  31587   
    }
30031         -
}
30032         -
#[cfg(test)]
30033         -
#[allow(unreachable_code, unused_variables)]
30034         -
mod server_post_player_action_test {
30035         -
    /// Unit types in unions are serialized like normal structures in requests.
30036         -
    /// Test ID: RestJsonInputUnionWithUnitMember
       31588  +
    /// Ensures that the timestampFormat of epoch-seconds works
       31589  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
30037  31590   
    #[::tokio::test]
30038         -
    async fn rest_json_input_union_with_unit_member_request() {
       31591  +
    #[::tracing_test::traced_test]
       31592  +
    async fn rest_json_json_timestamps_with_epoch_seconds_format_request() {
30039  31593   
        #[allow(unused_mut)]
30040  31594   
        let mut http_request = http::Request::builder()
30041         -
            .uri("/PostPlayerAction")
       31595  +
            .uri("/JsonTimestamps")
30042  31596   
            .method("POST")
30043  31597   
            .header("Content-Type", "application/json")
30044  31598   
            .body(::aws_smithy_http_server::body::Body::from(
30045         -
                ::bytes::Bytes::from_static(
30046         -
                    "{\n    \"action\": {\n        \"quit\": {}\n    }\n}".as_bytes(),
30047         -
                ),
       31599  +
                ::bytes::Bytes::from_static("{\n    \"epochSeconds\": 1398796238\n}".as_bytes()),
30048  31600   
            ))
30049  31601   
            .unwrap();
30050  31602   
        #[allow(unused_mut)]
30051  31603   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30052  31604   
        let config = crate::service::RestJsonConfig::builder().build();
30053  31605   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30054         -
            .post_player_action(move |input: crate::input::PostPlayerActionInput| {
       31606  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
30055  31607   
                let sender = sender.clone();
30056  31608   
                async move {
30057  31609   
                    let result = {
30058         -
                        let expected = crate::input::PostPlayerActionInput {
30059         -
                            action: ::std::option::Option::Some(crate::model::PlayerAction::Quit),
       31610  +
                        let expected = crate::input::JsonTimestampsInput {
       31611  +
                            epoch_seconds: ::std::option::Option::Some(
       31612  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       31613  +
                                    1398796238, 0_f64,
       31614  +
                                ),
       31615  +
                            ),
       31616  +
                            normal: ::std::option::Option::None,
       31617  +
                            date_time: ::std::option::Option::None,
       31618  +
                            date_time_on_target: ::std::option::Option::None,
       31619  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31620  +
                            http_date: ::std::option::Option::None,
       31621  +
                            http_date_on_target: ::std::option::Option::None,
30060  31622   
                        };
30061  31623   
                        ::pretty_assertions::assert_eq!(input, expected);
30062         -
                        let response = crate::output::PostPlayerActionOutput {
30063         -
                            action: crate::model::PlayerAction::Quit,
       31624  +
                        let response = crate::output::JsonTimestampsOutput {
       31625  +
                            normal: ::std::option::Option::None,
       31626  +
                            date_time: ::std::option::Option::None,
       31627  +
                            date_time_on_target: ::std::option::Option::None,
       31628  +
                            epoch_seconds: ::std::option::Option::None,
       31629  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31630  +
                            http_date: ::std::option::Option::None,
       31631  +
                            http_date_on_target: ::std::option::Option::None,
30064  31632   
                        };
30065  31633   
                        response
30066  31634   
                    };
30067  31635   
                    sender.send(()).await.expect("receiver dropped early");
30068  31636   
                    result
30069  31637   
                }
30070  31638   
            })
30071  31639   
            .build_unchecked();
30072  31640   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30073  31641   
            .await
30074  31642   
            .expect("unable to make an HTTP request");
30075         -
        assert!(receiver.recv().await.is_some());
30076         -
    }
30077         -
    /// Unit types in unions are serialized like normal structures in responses.
30078         -
    /// Test ID: RestJsonOutputUnionWithUnitMember
30079         -
    #[::tokio::test]
30080         -
    async fn rest_json_output_union_with_unit_member_response() {
30081         -
        let output = crate::output::PostPlayerActionOutput {
30082         -
            action: crate::model::PlayerAction::Quit,
30083         -
        };
30084         -
        use ::aws_smithy_http_server::response::IntoResponse;
30085         -
        let http_response = output.into_response();
30086         -
        ::pretty_assertions::assert_eq!(
30087         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30088         -
            http_response.status()
       31643  +
        assert!(
       31644  +
            receiver.recv().await.is_some(),
       31645  +
            "we expected operation handler to be invoked but it was not entered"
30089  31646   
        );
30090         -
        let expected_headers = [("Content-Type", "application/json")];
30091         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30092         -
            http_response.headers(),
30093         -
            expected_headers,
30094         -
        ));
30095         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
30096         -
            .await
30097         -
            .expect("unable to extract body to bytes");
30098         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
30099         -
            &body,
30100         -
            "{\n    \"action\": {\n        \"quit\": {}\n    }\n}",
30101         -
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
30102         -
        ));
30103  31647   
    }
30104         -
}
30105         -
#[cfg(test)]
30106         -
#[allow(unreachable_code, unused_variables)]
30107         -
mod server_post_union_with_json_name_test {
30108         -
    /// Tests that jsonName works with union members.
30109         -
    /// Test ID: PostUnionWithJsonNameRequest1
       31648  +
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
       31649  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
30110  31650   
    #[::tokio::test]
30111         -
    async fn post_union_with_json_name_request1_request() {
       31651  +
    #[::tracing_test::traced_test]
       31652  +
    async fn rest_json_json_timestamps_with_epoch_seconds_on_target_format_request() {
30112  31653   
        #[allow(unused_mut)]
30113  31654   
        let mut http_request = http::Request::builder()
30114         -
            .uri("/PostUnionWithJsonName")
       31655  +
            .uri("/JsonTimestamps")
30115  31656   
            .method("POST")
30116  31657   
            .header("Content-Type", "application/json")
30117  31658   
            .body(::aws_smithy_http_server::body::Body::from(
30118  31659   
                ::bytes::Bytes::from_static(
30119         -
                    "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}".as_bytes(),
       31660  +
                    "{\n    \"epochSecondsOnTarget\": 1398796238\n}".as_bytes(),
30120  31661   
                ),
30121  31662   
            ))
30122  31663   
            .unwrap();
30123  31664   
        #[allow(unused_mut)]
30124  31665   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30125  31666   
        let config = crate::service::RestJsonConfig::builder().build();
30126  31667   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30127         -
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
       31668  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
30128  31669   
                let sender = sender.clone();
30129  31670   
                async move {
30130  31671   
                    let result = {
30131         -
                        let expected = crate::input::PostUnionWithJsonNameInput {
30132         -
                            value: ::std::option::Option::Some(
30133         -
                                crate::model::UnionWithJsonName::Foo("hi".to_owned()),
       31672  +
                        let expected = crate::input::JsonTimestampsInput {
       31673  +
                            epoch_seconds_on_target: ::std::option::Option::Some(
       31674  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       31675  +
                                    1398796238, 0_f64,
30134  31676   
                                ),
       31677  +
                            ),
       31678  +
                            normal: ::std::option::Option::None,
       31679  +
                            date_time: ::std::option::Option::None,
       31680  +
                            date_time_on_target: ::std::option::Option::None,
       31681  +
                            epoch_seconds: ::std::option::Option::None,
       31682  +
                            http_date: ::std::option::Option::None,
       31683  +
                            http_date_on_target: ::std::option::Option::None,
30135  31684   
                        };
30136  31685   
                        ::pretty_assertions::assert_eq!(input, expected);
30137         -
                        let response = crate::output::PostUnionWithJsonNameOutput {
30138         -
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
       31686  +
                        let response = crate::output::JsonTimestampsOutput {
       31687  +
                            normal: ::std::option::Option::None,
       31688  +
                            date_time: ::std::option::Option::None,
       31689  +
                            date_time_on_target: ::std::option::Option::None,
       31690  +
                            epoch_seconds: ::std::option::Option::None,
       31691  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31692  +
                            http_date: ::std::option::Option::None,
       31693  +
                            http_date_on_target: ::std::option::Option::None,
30139  31694   
                        };
30140  31695   
                        response
30141  31696   
                    };
30142  31697   
                    sender.send(()).await.expect("receiver dropped early");
30143  31698   
                    result
30144  31699   
                }
30145  31700   
            })
30146  31701   
            .build_unchecked();
30147  31702   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30148  31703   
            .await
30149  31704   
            .expect("unable to make an HTTP request");
30150         -
        assert!(receiver.recv().await.is_some());
       31705  +
        assert!(
       31706  +
            receiver.recv().await.is_some(),
       31707  +
            "we expected operation handler to be invoked but it was not entered"
       31708  +
        );
30151  31709   
    }
30152         -
    /// Tests that jsonName works with union members.
30153         -
    /// Test ID: PostUnionWithJsonNameRequest2
       31710  +
    /// Ensures that the timestampFormat of http-date works
       31711  +
    /// Test ID: RestJsonJsonTimestampsWithHttpDateFormat
30154  31712   
    #[::tokio::test]
30155         -
    async fn post_union_with_json_name_request2_request() {
       31713  +
    #[::tracing_test::traced_test]
       31714  +
    async fn rest_json_json_timestamps_with_http_date_format_request() {
30156  31715   
        #[allow(unused_mut)]
30157  31716   
        let mut http_request = http::Request::builder()
30158         -
            .uri("/PostUnionWithJsonName")
       31717  +
            .uri("/JsonTimestamps")
30159  31718   
            .method("POST")
30160  31719   
            .header("Content-Type", "application/json")
30161  31720   
            .body(::aws_smithy_http_server::body::Body::from(
30162  31721   
                ::bytes::Bytes::from_static(
30163         -
                    "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}".as_bytes(),
       31722  +
                    "{\n    \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}".as_bytes(),
30164  31723   
                ),
30165  31724   
            ))
30166  31725   
            .unwrap();
30167  31726   
        #[allow(unused_mut)]
30168  31727   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30169  31728   
        let config = crate::service::RestJsonConfig::builder().build();
30170  31729   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30171         -
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
       31730  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
30172  31731   
                let sender = sender.clone();
30173  31732   
                async move {
30174  31733   
                    let result = {
30175         -
                        let expected = crate::input::PostUnionWithJsonNameInput {
30176         -
                            value: ::std::option::Option::Some(
30177         -
                                crate::model::UnionWithJsonName::Baz("hi".to_owned()),
       31734  +
                        let expected = crate::input::JsonTimestampsInput {
       31735  +
                            http_date: ::std::option::Option::Some(
       31736  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       31737  +
                                    1398796238, 0_f64,
30178  31738   
                                ),
       31739  +
                            ),
       31740  +
                            normal: ::std::option::Option::None,
       31741  +
                            date_time: ::std::option::Option::None,
       31742  +
                            date_time_on_target: ::std::option::Option::None,
       31743  +
                            epoch_seconds: ::std::option::Option::None,
       31744  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31745  +
                            http_date_on_target: ::std::option::Option::None,
30179  31746   
                        };
30180  31747   
                        ::pretty_assertions::assert_eq!(input, expected);
30181         -
                        let response = crate::output::PostUnionWithJsonNameOutput {
30182         -
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
       31748  +
                        let response = crate::output::JsonTimestampsOutput {
       31749  +
                            normal: ::std::option::Option::None,
       31750  +
                            date_time: ::std::option::Option::None,
       31751  +
                            date_time_on_target: ::std::option::Option::None,
       31752  +
                            epoch_seconds: ::std::option::Option::None,
       31753  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31754  +
                            http_date: ::std::option::Option::None,
       31755  +
                            http_date_on_target: ::std::option::Option::None,
30183  31756   
                        };
30184  31757   
                        response
30185  31758   
                    };
30186  31759   
                    sender.send(()).await.expect("receiver dropped early");
30187  31760   
                    result
30188  31761   
                }
30189  31762   
            })
30190  31763   
            .build_unchecked();
30191  31764   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30192  31765   
            .await
30193  31766   
            .expect("unable to make an HTTP request");
30194         -
        assert!(receiver.recv().await.is_some());
       31767  +
        assert!(
       31768  +
            receiver.recv().await.is_some(),
       31769  +
            "we expected operation handler to be invoked but it was not entered"
       31770  +
        );
30195  31771   
    }
30196         -
    /// Tests that jsonName works with union members.
30197         -
    /// Test ID: PostUnionWithJsonNameRequest3
       31772  +
    /// Ensures that the timestampFormat of http-date on the target shape works
       31773  +
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
30198  31774   
    #[::tokio::test]
30199         -
    async fn post_union_with_json_name_request3_request() {
       31775  +
    #[::tracing_test::traced_test]
       31776  +
    async fn rest_json_json_timestamps_with_http_date_on_target_format_request() {
30200  31777   
        #[allow(unused_mut)]
30201  31778   
        let mut http_request = http::Request::builder()
30202         -
            .uri("/PostUnionWithJsonName")
       31779  +
            .uri("/JsonTimestamps")
30203  31780   
            .method("POST")
30204  31781   
            .header("Content-Type", "application/json")
30205  31782   
            .body(::aws_smithy_http_server::body::Body::from(
30206  31783   
                ::bytes::Bytes::from_static(
30207         -
                    "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}".as_bytes(),
       31784  +
                    "{\n    \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}".as_bytes(),
30208  31785   
                ),
30209  31786   
            ))
30210  31787   
            .unwrap();
30211  31788   
        #[allow(unused_mut)]
30212  31789   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30213  31790   
        let config = crate::service::RestJsonConfig::builder().build();
30214  31791   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30215         -
            .post_union_with_json_name(move |input: crate::input::PostUnionWithJsonNameInput| {
       31792  +
            .json_timestamps(move |input: crate::input::JsonTimestampsInput| {
30216  31793   
                let sender = sender.clone();
30217  31794   
                async move {
30218  31795   
                    let result = {
30219         -
                        let expected = crate::input::PostUnionWithJsonNameInput {
30220         -
                            value: ::std::option::Option::Some(
30221         -
                                crate::model::UnionWithJsonName::Bar("hi".to_owned()),
       31796  +
                        let expected = crate::input::JsonTimestampsInput {
       31797  +
                            http_date_on_target: ::std::option::Option::Some(
       31798  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       31799  +
                                    1398796238, 0_f64,
30222  31800   
                                ),
       31801  +
                            ),
       31802  +
                            normal: ::std::option::Option::None,
       31803  +
                            date_time: ::std::option::Option::None,
       31804  +
                            date_time_on_target: ::std::option::Option::None,
       31805  +
                            epoch_seconds: ::std::option::Option::None,
       31806  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31807  +
                            http_date: ::std::option::Option::None,
30223  31808   
                        };
30224  31809   
                        ::pretty_assertions::assert_eq!(input, expected);
30225         -
                        let response = crate::output::PostUnionWithJsonNameOutput {
30226         -
                            value: crate::model::UnionWithJsonName::Foo("".to_owned()),
       31810  +
                        let response = crate::output::JsonTimestampsOutput {
       31811  +
                            normal: ::std::option::Option::None,
       31812  +
                            date_time: ::std::option::Option::None,
       31813  +
                            date_time_on_target: ::std::option::Option::None,
       31814  +
                            epoch_seconds: ::std::option::Option::None,
       31815  +
                            epoch_seconds_on_target: ::std::option::Option::None,
       31816  +
                            http_date: ::std::option::Option::None,
       31817  +
                            http_date_on_target: ::std::option::Option::None,
30227  31818   
                        };
30228  31819   
                        response
30229  31820   
                    };
30230  31821   
                    sender.send(()).await.expect("receiver dropped early");
30231  31822   
                    result
30232  31823   
                }
30233  31824   
            })
30234  31825   
            .build_unchecked();
30235  31826   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30236  31827   
            .await
30237  31828   
            .expect("unable to make an HTTP request");
30238         -
        assert!(receiver.recv().await.is_some());
       31829  +
        assert!(
       31830  +
            receiver.recv().await.is_some(),
       31831  +
            "we expected operation handler to be invoked but it was not entered"
       31832  +
        );
30239  31833   
    }
30240         -
    /// Tests that jsonName works with union members.
30241         -
    /// Test ID: PostUnionWithJsonNameResponse1
       31834  +
    /// Tests how normal timestamps are serialized
       31835  +
    /// Test ID: RestJsonJsonTimestamps
30242  31836   
    #[::tokio::test]
30243         -
    async fn post_union_with_json_name_response1_response() {
30244         -
        let output = crate::output::PostUnionWithJsonNameOutput {
30245         -
            value: crate::model::UnionWithJsonName::Foo("hi".to_owned()),
       31837  +
    #[::tracing_test::traced_test]
       31838  +
    async fn rest_json_json_timestamps_response() {
       31839  +
        let output = crate::output::JsonTimestampsOutput {
       31840  +
            normal: ::std::option::Option::Some(
       31841  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       31842  +
            ),
       31843  +
            date_time: ::std::option::Option::None,
       31844  +
            date_time_on_target: ::std::option::Option::None,
       31845  +
            epoch_seconds: ::std::option::Option::None,
       31846  +
            epoch_seconds_on_target: ::std::option::Option::None,
       31847  +
            http_date: ::std::option::Option::None,
       31848  +
            http_date_on_target: ::std::option::Option::None,
30246  31849   
        };
30247  31850   
        use ::aws_smithy_http_server::response::IntoResponse;
30248  31851   
        let http_response = output.into_response();
30249  31852   
        ::pretty_assertions::assert_eq!(
30250  31853   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30251  31854   
            http_response.status()
30252  31855   
        );
30253  31856   
        let expected_headers = [("Content-Type", "application/json")];
30254  31857   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30255  31858   
            http_response.headers(),
30256  31859   
            expected_headers,
30257  31860   
        ));
30258  31861   
        let body = ::hyper::body::to_bytes(http_response.into_body())
30259  31862   
            .await
30260  31863   
            .expect("unable to extract body to bytes");
30261  31864   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
30262  31865   
            &body,
30263         -
            "{\n    \"value\": {\n        \"FOO\": \"hi\"\n    }\n}",
       31866  +
            "{\n    \"normal\": 1398796238\n}",
30264  31867   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
30265  31868   
        ));
30266  31869   
    }
30267         -
    /// Tests that jsonName works with union members.
30268         -
    /// Test ID: PostUnionWithJsonNameResponse2
       31870  +
    /// Ensures that the timestampFormat of date-time works like normal timestamps
       31871  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeFormat
30269  31872   
    #[::tokio::test]
30270         -
    async fn post_union_with_json_name_response2_response() {
30271         -
        let output = crate::output::PostUnionWithJsonNameOutput {
30272         -
            value: crate::model::UnionWithJsonName::Baz("hi".to_owned()),
       31873  +
    #[::tracing_test::traced_test]
       31874  +
    async fn rest_json_json_timestamps_with_date_time_format_response() {
       31875  +
        let output = crate::output::JsonTimestampsOutput {
       31876  +
            date_time: ::std::option::Option::Some(
       31877  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       31878  +
            ),
       31879  +
            normal: ::std::option::Option::None,
       31880  +
            date_time_on_target: ::std::option::Option::None,
       31881  +
            epoch_seconds: ::std::option::Option::None,
       31882  +
            epoch_seconds_on_target: ::std::option::Option::None,
       31883  +
            http_date: ::std::option::Option::None,
       31884  +
            http_date_on_target: ::std::option::Option::None,
30273  31885   
        };
30274  31886   
        use ::aws_smithy_http_server::response::IntoResponse;
30275  31887   
        let http_response = output.into_response();
30276  31888   
        ::pretty_assertions::assert_eq!(
30277  31889   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30278  31890   
            http_response.status()
30279  31891   
        );
30280  31892   
        let expected_headers = [("Content-Type", "application/json")];
30281  31893   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30282  31894   
            http_response.headers(),
30283  31895   
            expected_headers,
30284  31896   
        ));
30285  31897   
        let body = ::hyper::body::to_bytes(http_response.into_body())
30286  31898   
            .await
30287  31899   
            .expect("unable to extract body to bytes");
30288  31900   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
30289  31901   
            &body,
30290         -
            "{\n    \"value\": {\n        \"_baz\": \"hi\"\n    }\n}",
       31902  +
            "{\n    \"dateTime\": \"2014-04-29T18:30:38Z\"\n}",
30291  31903   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
30292  31904   
        ));
30293  31905   
    }
30294         -
    /// Tests that jsonName works with union members.
30295         -
    /// Test ID: PostUnionWithJsonNameResponse3
       31906  +
    /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
       31907  +
    /// Test ID: RestJsonJsonTimestampsWithDateTimeOnTargetFormat
30296  31908   
    #[::tokio::test]
30297         -
    async fn post_union_with_json_name_response3_response() {
30298         -
        let output = crate::output::PostUnionWithJsonNameOutput {
30299         -
            value: crate::model::UnionWithJsonName::Bar("hi".to_owned()),
       31909  +
    #[::tracing_test::traced_test]
       31910  +
    async fn rest_json_json_timestamps_with_date_time_on_target_format_response() {
       31911  +
        let output = crate::output::JsonTimestampsOutput {
       31912  +
            date_time_on_target: ::std::option::Option::Some(
       31913  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       31914  +
            ),
       31915  +
            normal: ::std::option::Option::None,
       31916  +
            date_time: ::std::option::Option::None,
       31917  +
            epoch_seconds: ::std::option::Option::None,
       31918  +
            epoch_seconds_on_target: ::std::option::Option::None,
       31919  +
            http_date: ::std::option::Option::None,
       31920  +
            http_date_on_target: ::std::option::Option::None,
30300  31921   
        };
30301  31922   
        use ::aws_smithy_http_server::response::IntoResponse;
30302  31923   
        let http_response = output.into_response();
30303  31924   
        ::pretty_assertions::assert_eq!(
30304  31925   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30305  31926   
            http_response.status()
30306  31927   
        );
30307  31928   
        let expected_headers = [("Content-Type", "application/json")];
30308  31929   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30309  31930   
            http_response.headers(),
30310  31931   
            expected_headers,
30311  31932   
        ));
30312  31933   
        let body = ::hyper::body::to_bytes(http_response.into_body())
30313  31934   
            .await
30314  31935   
            .expect("unable to extract body to bytes");
30315  31936   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
30316  31937   
            &body,
30317         -
            "{\n    \"value\": {\n        \"bar\": \"hi\"\n    }\n}",
       31938  +
            "{\n    \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\"\n}",
30318  31939   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
30319  31940   
        ));
30320  31941   
    }
30321         -
}
30322         -
#[cfg(test)]
30323         -
#[allow(unreachable_code, unused_variables)]
30324         -
mod server_query_params_as_string_list_map_test {
30325         -
    /// Servers put all query params in map
30326         -
    /// Test ID: RestJsonServersQueryParamsStringListMap
30327         -
    #[::tokio::test]
30328         -
    async fn rest_json_servers_query_params_string_list_map_request() {
30329         -
        #[allow(unused_mut)]
30330         -
        let mut http_request = http::Request::builder()
30331         -
            .uri("/StringListMap")
30332         -
            .method("POST")
30333         -
            .body(::aws_smithy_http_server::body::Body::from(
30334         -
                ::bytes::Bytes::from_static("".as_bytes()),
30335         -
            ))
30336         -
            .unwrap();
30337         -
        *http_request.uri_mut() = "/StringListMap?corge=named&baz=bar&baz=qux"
30338         -
            .parse()
30339         -
            .unwrap();
30340         -
        #[allow(unused_mut)]
30341         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30342         -
        let config = crate::service::RestJsonConfig::builder().build();
30343         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30344         -
            .query_params_as_string_list_map(
30345         -
                move |input: crate::input::QueryParamsAsStringListMapInput| {
30346         -
                    let sender = sender.clone();
30347         -
                    async move {
30348         -
                        let result = {
30349         -
                            let expected = crate::input::QueryParamsAsStringListMapInput {
30350         -
                                qux: ::std::option::Option::Some("named".to_owned()),
30351         -
                                foo: ::std::option::Option::Some({
30352         -
                                    let mut ret = ::std::collections::HashMap::new();
30353         -
                                    ret.insert("corge".to_owned(), vec!["named".to_owned()]);
30354         -
                                    ret.insert(
30355         -
                                        "baz".to_owned(),
30356         -
                                        vec!["bar".to_owned(), "qux".to_owned()],
30357         -
                                    );
30358         -
                                    ret
30359         -
                                }),
30360         -
                            };
30361         -
                            ::pretty_assertions::assert_eq!(input, expected);
30362         -
                            let response = crate::output::QueryParamsAsStringListMapOutput {};
30363         -
                            response
30364         -
                        };
30365         -
                        sender.send(()).await.expect("receiver dropped early");
30366         -
                        result
30367         -
                    }
30368         -
                },
30369         -
            )
30370         -
            .build_unchecked();
30371         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30372         -
            .await
30373         -
            .expect("unable to make an HTTP request");
30374         -
        assert!(receiver.recv().await.is_some());
30375         -
    }
30376         -
}
30377         -
#[cfg(test)]
30378         -
#[allow(unreachable_code, unused_variables)]
30379         -
mod server_query_precedence_test {
30380         -
    /// Servers put all query params in map
30381         -
    /// Test ID: RestJsonServersPutAllQueryParamsInMap
       31942  +
    /// Ensures that the timestampFormat of epoch-seconds works
       31943  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsFormat
30382  31944   
    #[::tokio::test]
30383         -
    async fn rest_json_servers_put_all_query_params_in_map_request() {
30384         -
        #[allow(unused_mut)]
30385         -
        let mut http_request = http::Request::builder()
30386         -
            .uri("/Precedence")
30387         -
            .method("POST")
30388         -
            .body(::aws_smithy_http_server::body::Body::from(
30389         -
                ::bytes::Bytes::from_static("".as_bytes()),
30390         -
            ))
30391         -
            .unwrap();
30392         -
        *http_request.uri_mut() = "/Precedence?bar=named&qux=fromMap".parse().unwrap();
30393         -
        #[allow(unused_mut)]
30394         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30395         -
        let config = crate::service::RestJsonConfig::builder().build();
30396         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30397         -
            .query_precedence(move |input: crate::input::QueryPrecedenceInput| {
30398         -
                let sender = sender.clone();
30399         -
                async move {
30400         -
                    let result = {
30401         -
                        let expected = crate::input::QueryPrecedenceInput {
30402         -
                            foo: ::std::option::Option::Some("named".to_owned()),
30403         -
                            baz: ::std::option::Option::Some({
30404         -
                                let mut ret = ::std::collections::HashMap::new();
30405         -
                                ret.insert("bar".to_owned(), "named".to_owned());
30406         -
                                ret.insert("qux".to_owned(), "fromMap".to_owned());
30407         -
                                ret
30408         -
                            }),
30409         -
                        };
30410         -
                        ::pretty_assertions::assert_eq!(input, expected);
30411         -
                        let response = crate::output::QueryPrecedenceOutput {};
30412         -
                        response
       31945  +
    #[::tracing_test::traced_test]
       31946  +
    async fn rest_json_json_timestamps_with_epoch_seconds_format_response() {
       31947  +
        let output = crate::output::JsonTimestampsOutput {
       31948  +
            epoch_seconds: ::std::option::Option::Some(
       31949  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       31950  +
            ),
       31951  +
            normal: ::std::option::Option::None,
       31952  +
            date_time: ::std::option::Option::None,
       31953  +
            date_time_on_target: ::std::option::Option::None,
       31954  +
            epoch_seconds_on_target: ::std::option::Option::None,
       31955  +
            http_date: ::std::option::Option::None,
       31956  +
            http_date_on_target: ::std::option::Option::None,
30413  31957   
        };
30414         -
                    sender.send(()).await.expect("receiver dropped early");
30415         -
                    result
30416         -
                }
30417         -
            })
30418         -
            .build_unchecked();
30419         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30420         -
            .await
30421         -
            .expect("unable to make an HTTP request");
30422         -
        assert!(receiver.recv().await.is_some());
30423         -
    }
30424         -
}
30425         -
#[cfg(test)]
30426         -
#[allow(unreachable_code, unused_variables)]
30427         -
mod server_recursive_shapes_test {
30428         -
    /// Serializes recursive structures
30429         -
    /// Test ID: RestJsonRecursiveShapes
30430         -
    #[::tokio::test]
30431         -
    async fn rest_json_recursive_shapes_request() {
30432         -
        #[allow(unused_mut)]
30433         -
                    let mut http_request = http::Request::builder()
30434         -
                        .uri("/RecursiveShapes")
30435         -
                        .method("PUT")
30436         -
        .header("Content-Type", "application/json")
30437         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"nested\": {\n        \"foo\": \"Foo1\",\n        \"nested\": {\n            \"bar\": \"Bar1\",\n            \"recursiveMember\": {\n                \"foo\": \"Foo2\",\n                \"nested\": {\n                    \"bar\": \"Bar2\"\n                }\n            }\n        }\n    }\n}".as_bytes()))).unwrap();
30438         -
        #[allow(unused_mut)]
30439         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
30440         -
        let config = crate::service::RestJsonConfig::builder().build();
30441         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
30442         -
                        .recursive_shapes(move |input: crate::input::RecursiveShapesInput| {
30443         -
                            let sender = sender.clone();
30444         -
                            async move {
30445         -
                                let result = { let expected =
30446         -
            crate::input::RecursiveShapesInput {
30447         -
                nested:
30448         -
                    ::std::option::Option::Some(
30449         -
                        crate::model::RecursiveShapesInputOutputNested1 {
30450         -
                            foo:
30451         -
                                ::std::option::Option::Some(
30452         -
                                    "Foo1".to_owned()
30453         -
                                )
30454         -
                            ,
30455         -
                            nested:
30456         -
                                ::std::option::Option::Some(
30457         -
                                    ::std::boxed::Box::new(
30458         -
                                        crate::model::RecursiveShapesInputOutputNested2 {
30459         -
                                            bar:
30460         -
                                                ::std::option::Option::Some(
30461         -
                                                    "Bar1".to_owned()
30462         -
                                                )
30463         -
                                            ,
30464         -
                                            recursive_member:
30465         -
                                                ::std::option::Option::Some(
30466         -
                                                    crate::model::RecursiveShapesInputOutputNested1 {
30467         -
                                                        foo:
30468         -
                                                            ::std::option::Option::Some(
30469         -
                                                                "Foo2".to_owned()
30470         -
                                                            )
30471         -
                                                        ,
30472         -
                                                        nested:
30473         -
                                                            ::std::option::Option::Some(
30474         -
                                                                ::std::boxed::Box::new(
30475         -
                                                                    crate::model::RecursiveShapesInputOutputNested2 {
30476         -
                                                                        bar:
30477         -
                                                                            ::std::option::Option::Some(
30478         -
                                                                                "Bar2".to_owned()
30479         -
                                                                            )
30480         -
                                                                        ,
30481         -
                                                                        recursive_member:
30482         -
                                                                            ::std::option::Option::None
30483         -
                                                                        ,
30484         -
                                                                    }
30485         -
                                                                )
30486         -
                                                            )
30487         -
                                                        ,
30488         -
                                                    }
30489         -
                                                )
30490         -
                                            ,
30491         -
                                        }
30492         -
                                    )
30493         -
                                )
30494         -
                            ,
30495         -
                        }
30496         -
                    )
30497         -
                ,
30498         -
            }
30499         -
        ;
30500         -
        ::pretty_assertions::assert_eq!(input, expected);
30501         -
        let response =
30502         -
            crate::output::RecursiveShapesOutput {
30503         -
                nested:
30504         -
                    ::std::option::Option::None
30505         -
                ,
30506         -
            }
30507         -
        ;
30508         -
        response };
30509         -
                                sender.send(()).await.expect("receiver dropped early");
30510         -
                                result
30511         -
                            }
30512         -
                        })
30513         -
                        .build_unchecked();
30514         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       31958  +
        use ::aws_smithy_http_server::response::IntoResponse;
       31959  +
        let http_response = output.into_response();
       31960  +
        ::pretty_assertions::assert_eq!(
       31961  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       31962  +
            http_response.status()
       31963  +
        );
       31964  +
        let expected_headers = [("Content-Type", "application/json")];
       31965  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       31966  +
            http_response.headers(),
       31967  +
            expected_headers,
       31968  +
        ));
       31969  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
30515  31970   
            .await
30516         -
            .expect("unable to make an HTTP request");
30517         -
        assert!(receiver.recv().await.is_some());
       31971  +
            .expect("unable to extract body to bytes");
       31972  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       31973  +
            &body,
       31974  +
            "{\n    \"epochSeconds\": 1398796238\n}",
       31975  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       31976  +
        ));
30518  31977   
    }
30519         -
    /// Serializes recursive structures
30520         -
    /// Test ID: RestJsonRecursiveShapes
       31978  +
    /// Ensures that the timestampFormat of epoch-seconds on the target shape works
       31979  +
    /// Test ID: RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat
30521  31980   
    #[::tokio::test]
30522         -
    async fn rest_json_recursive_shapes_response() {
30523         -
        let output = crate::output::RecursiveShapesOutput {
30524         -
            nested: ::std::option::Option::Some(crate::model::RecursiveShapesInputOutputNested1 {
30525         -
                foo: ::std::option::Option::Some("Foo1".to_owned()),
30526         -
                nested: ::std::option::Option::Some(::std::boxed::Box::new(
30527         -
                    crate::model::RecursiveShapesInputOutputNested2 {
30528         -
                        bar: ::std::option::Option::Some("Bar1".to_owned()),
30529         -
                        recursive_member: ::std::option::Option::Some(
30530         -
                            crate::model::RecursiveShapesInputOutputNested1 {
30531         -
                                foo: ::std::option::Option::Some("Foo2".to_owned()),
30532         -
                                nested: ::std::option::Option::Some(::std::boxed::Box::new(
30533         -
                                    crate::model::RecursiveShapesInputOutputNested2 {
30534         -
                                        bar: ::std::option::Option::Some("Bar2".to_owned()),
30535         -
                                        recursive_member: ::std::option::Option::None,
30536         -
                                    },
30537         -
                                )),
30538         -
                            },
       31981  +
    #[::tracing_test::traced_test]
       31982  +
    async fn rest_json_json_timestamps_with_epoch_seconds_on_target_format_response() {
       31983  +
        let output = crate::output::JsonTimestampsOutput {
       31984  +
            epoch_seconds_on_target: ::std::option::Option::Some(
       31985  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
30539  31986   
            ),
30540         -
                    },
30541         -
                )),
30542         -
            }),
       31987  +
            normal: ::std::option::Option::None,
       31988  +
            date_time: ::std::option::Option::None,
       31989  +
            date_time_on_target: ::std::option::Option::None,
       31990  +
            epoch_seconds: ::std::option::Option::None,
       31991  +
            http_date: ::std::option::Option::None,
       31992  +
            http_date_on_target: ::std::option::Option::None,
30543  31993   
        };
30544  31994   
        use ::aws_smithy_http_server::response::IntoResponse;
30545  31995   
        let http_response = output.into_response();
30546  31996   
        ::pretty_assertions::assert_eq!(
30547  31997   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
30548  31998   
            http_response.status()
30549  31999   
        );
30550  32000   
        let expected_headers = [("Content-Type", "application/json")];
30551  32001   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
30552  32002   
            http_response.headers(),
30553  32003   
            expected_headers,
30554  32004   
        ));
30555  32005   
        let body = ::hyper::body::to_bytes(http_response.into_body())
30556  32006   
            .await
30557  32007   
            .expect("unable to extract body to bytes");
30558         -
        ::aws_smithy_protocol_test::assert_ok(
30559         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"nested\": {\n        \"foo\": \"Foo1\",\n        \"nested\": {\n            \"bar\": \"Bar1\",\n            \"recursiveMember\": {\n                \"foo\": \"Foo2\",\n                \"nested\": {\n                    \"bar\": \"Bar2\"\n                }\n            }\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
30560         -
        );
       32008  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       32009  +
            &body,
       32010  +
            "{\n    \"epochSecondsOnTarget\": 1398796238\n}",
       32011  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       32012  +
        ));
30561  32013   
    }
30562         -
}
30563         -
#[cfg(test)]
       32014  +
    /// Ensures that the timestampFormat of http-date works
       32015  +
    /// Test ID: RestJsonJsonTimestampsWithHttpDateFormat
       32016  +
    #[::tokio::test]
       32017  +
    #[::tracing_test::traced_test]
       32018  +
    async fn rest_json_json_timestamps_with_http_date_format_response() {
       32019  +
        let output = crate::output::JsonTimestampsOutput {
       32020  +
            http_date: ::std::option::Option::Some(
       32021  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       32022  +
            ),
       32023  +
            normal: ::std::option::Option::None,
       32024  +
            date_time: ::std::option::Option::None,
       32025  +
            date_time_on_target: ::std::option::Option::None,
       32026  +
            epoch_seconds: ::std::option::Option::None,
       32027  +
            epoch_seconds_on_target: ::std::option::Option::None,
       32028  +
            http_date_on_target: ::std::option::Option::None,
       32029  +
        };
       32030  +
        use ::aws_smithy_http_server::response::IntoResponse;
       32031  +
        let http_response = output.into_response();
       32032  +
        ::pretty_assertions::assert_eq!(
       32033  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       32034  +
            http_response.status()
       32035  +
        );
       32036  +
        let expected_headers = [("Content-Type", "application/json")];
       32037  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32038  +
            http_response.headers(),
       32039  +
            expected_headers,
       32040  +
        ));
       32041  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32042  +
            .await
       32043  +
            .expect("unable to extract body to bytes");
       32044  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       32045  +
            &body,
       32046  +
            "{\n    \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}",
       32047  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       32048  +
        ));
       32049  +
    }
       32050  +
    /// Ensures that the timestampFormat of http-date on the target shape works
       32051  +
    /// Test ID: RestJsonJsonTimestampsWithHttpDateOnTargetFormat
       32052  +
    #[::tokio::test]
       32053  +
    #[::tracing_test::traced_test]
       32054  +
    async fn rest_json_json_timestamps_with_http_date_on_target_format_response() {
       32055  +
        let output = crate::output::JsonTimestampsOutput {
       32056  +
            http_date_on_target: ::std::option::Option::Some(
       32057  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
       32058  +
            ),
       32059  +
            normal: ::std::option::Option::None,
       32060  +
            date_time: ::std::option::Option::None,
       32061  +
            date_time_on_target: ::std::option::Option::None,
       32062  +
            epoch_seconds: ::std::option::Option::None,
       32063  +
            epoch_seconds_on_target: ::std::option::Option::None,
       32064  +
            http_date: ::std::option::Option::None,
       32065  +
        };
       32066  +
        use ::aws_smithy_http_server::response::IntoResponse;
       32067  +
        let http_response = output.into_response();
       32068  +
        ::pretty_assertions::assert_eq!(
       32069  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       32070  +
            http_response.status()
       32071  +
        );
       32072  +
        let expected_headers = [("Content-Type", "application/json")];
       32073  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       32074  +
            http_response.headers(),
       32075  +
            expected_headers,
       32076  +
        ));
       32077  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       32078  +
            .await
       32079  +
            .expect("unable to extract body to bytes");
       32080  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       32081  +
            &body,
       32082  +
            "{\n    \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\"\n}",
       32083  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       32084  +
        ));
       32085  +
    }
       32086  +
}
       32087  +
       32088  +
const CONTENT_TYPE_SIMPLESCALARPROPERTIES: ::mime::Mime = ::mime::APPLICATION_JSON;
       32089  +
::pin_project_lite::pin_project! {
       32090  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       32091  +
    /// [`SimpleScalarPropertiesInput`](crate::input::SimpleScalarPropertiesInput) using modelled bindings.
       32092  +
    pub struct SimpleScalarPropertiesInputFuture {
       32093  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SimpleScalarPropertiesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       32094  +
    }
       32095  +
}
       32096  +
       32097  +
impl std::future::Future for SimpleScalarPropertiesInputFuture {
       32098  +
    type Output = Result<
       32099  +
        crate::input::SimpleScalarPropertiesInput,
       32100  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       32101  +
    >;
       32102  +
       32103  +
    fn poll(
       32104  +
        self: std::pin::Pin<&mut Self>,
       32105  +
        cx: &mut std::task::Context<'_>,
       32106  +
    ) -> std::task::Poll<Self::Output> {
       32107  +
        let this = self.project();
       32108  +
        this.inner.as_mut().poll(cx)
       32109  +
    }
       32110  +
}
       32111  +
       32112  +
impl<B>
       32113  +
    ::aws_smithy_http_server::request::FromRequest<
       32114  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       32115  +
        B,
       32116  +
    > for crate::input::SimpleScalarPropertiesInput
       32117  +
where
       32118  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       32119  +
    B: 'static,
       32120  +
       32121  +
    B::Data: Send,
       32122  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       32123  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       32124  +
{
       32125  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       32126  +
    type Future = SimpleScalarPropertiesInputFuture;
       32127  +
       32128  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       32129  +
        let fut = async move {
       32130  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       32131  +
                request.headers(),
       32132  +
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
       32133  +
            ) {
       32134  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       32135  +
            }
       32136  +
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
       32137  +
                            .await
       32138  +
                            .map_err(Into::into)
       32139  +
        };
       32140  +
        use ::futures_util::future::TryFutureExt;
       32141  +
        let fut = fut.map_err(
       32142  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       32143  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       32144  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       32145  +
                    e,
       32146  +
                )
       32147  +
            },
       32148  +
        );
       32149  +
        SimpleScalarPropertiesInputFuture {
       32150  +
            inner: Box::pin(fut),
       32151  +
        }
       32152  +
    }
       32153  +
}
       32154  +
impl
       32155  +
    ::aws_smithy_http_server::response::IntoResponse<
       32156  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       32157  +
    > for crate::output::SimpleScalarPropertiesOutput
       32158  +
{
       32159  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       32160  +
        match crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_http_response(self) {
       32161  +
                        Ok(response) => response,
       32162  +
                        Err(e) => {
       32163  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       32164  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       32165  +
                        }
       32166  +
                    }
       32167  +
    }
       32168  +
}
       32169  +
30564  32170   
#[allow(unreachable_code, unused_variables)]
30565         -
mod server_simple_scalar_properties_test {
       32171  +
#[cfg(test)]
       32172  +
mod simple_scalar_properties_test {
       32173  +
30566  32174   
    /// Serializes simple scalar properties
30567  32175   
    /// Test ID: RestJsonSimpleScalarProperties
30568  32176   
    #[::tokio::test]
       32177  +
    #[::tracing_test::traced_test]
30569  32178   
    async fn rest_json_simple_scalar_properties_request() {
30570  32179   
        #[allow(unused_mut)]
30571  32180   
                    let mut http_request = http::Request::builder()
30572  32181   
                        .uri("/SimpleScalarProperties")
30573  32182   
                        .method("PUT")
30574  32183   
        .header("Content-Type", "application/json")
30575  32184   
        .header("X-Foo", "Foo")
30576  32185   
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"stringValue\": \"string\",\n    \"trueBooleanValue\": true,\n    \"falseBooleanValue\": false,\n    \"byteValue\": 1,\n    \"shortValue\": 2,\n    \"integerValue\": 3,\n    \"longValue\": 4,\n    \"floatValue\": 5.5,\n    \"DoubleDribble\": 6.5\n}".as_bytes()))).unwrap();
30577  32186   
        #[allow(unused_mut)]
30578  32187   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
@@ -30642,32251 +30706,32319 @@
30662  32271   
                        response
30663  32272   
                    };
30664  32273   
                    sender.send(()).await.expect("receiver dropped early");
30665  32274   
                    result
30666  32275   
                }
30667  32276   
            })
30668  32277   
            .build_unchecked();
30669  32278   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30670  32279   
            .await
30671  32280   
            .expect("unable to make an HTTP request");
30672         -
        assert!(receiver.recv().await.is_some());
       32281  +
        assert!(
       32282  +
            receiver.recv().await.is_some(),
       32283  +
            "we expected operation handler to be invoked but it was not entered"
       32284  +
        );
30673  32285   
    }
30674  32286   
    /// Rest Json should not deserialize null structure values
30675  32287   
    /// Test ID: RestJsonServersDontSerializeNullStructureValues
30676  32288   
    #[::tokio::test]
       32289  +
    #[::tracing_test::traced_test]
30677  32290   
    async fn rest_json_servers_dont_serialize_null_structure_values_request() {
30678  32291   
        #[allow(unused_mut)]
30679  32292   
        let mut http_request = http::Request::builder()
30680  32293   
            .uri("/SimpleScalarProperties")
30681  32294   
            .method("PUT")
30682  32295   
            .header("Content-Type", "application/json")
30683  32296   
            .body(::aws_smithy_http_server::body::Body::from(
30684  32297   
                ::bytes::Bytes::from_static("{\n    \"stringValue\": null\n}".as_bytes()),
30685  32298   
            ))
30686  32299   
            .unwrap();
@@ -30752,32365 +30816,32433 @@
30772  32385   
                        response
30773  32386   
                    };
30774  32387   
                    sender.send(()).await.expect("receiver dropped early");
30775  32388   
                    result
30776  32389   
                }
30777  32390   
            })
30778  32391   
            .build_unchecked();
30779  32392   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30780  32393   
            .await
30781  32394   
            .expect("unable to make an HTTP request");
30782         -
        assert!(receiver.recv().await.is_some());
       32395  +
        assert!(
       32396  +
            receiver.recv().await.is_some(),
       32397  +
            "we expected operation handler to be invoked but it was not entered"
       32398  +
        );
30783  32399   
    }
30784  32400   
    /// Supports handling NaN float values.
30785  32401   
    /// Test ID: RestJsonSupportsNaNFloatInputs
30786  32402   
    #[::tokio::test]
       32403  +
    #[::tracing_test::traced_test]
30787  32404   
    async fn rest_json_supports_na_n_float_inputs_request() {
30788  32405   
        #[allow(unused_mut)]
30789  32406   
        let mut http_request = http::Request::builder()
30790  32407   
            .uri("/SimpleScalarProperties")
30791  32408   
            .method("PUT")
30792  32409   
            .header("Content-Type", "application/json")
30793  32410   
            .body(::aws_smithy_http_server::body::Body::from(
30794  32411   
                ::bytes::Bytes::from_static(
30795  32412   
                    "{\n    \"floatValue\": \"NaN\",\n    \"DoubleDribble\": \"NaN\"\n}".as_bytes(),
30796  32413   
                ),
@@ -30870,32487 +30934,32555 @@
30890  32507   
        ;
30891  32508   
        response };
30892  32509   
                                sender.send(()).await.expect("receiver dropped early");
30893  32510   
                                result
30894  32511   
                            }
30895  32512   
                        })
30896  32513   
                        .build_unchecked();
30897  32514   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
30898  32515   
            .await
30899  32516   
            .expect("unable to make an HTTP request");
30900         -
        assert!(receiver.recv().await.is_some());
       32517  +
        assert!(
       32518  +
            receiver.recv().await.is_some(),
       32519  +
            "we expected operation handler to be invoked but it was not entered"
       32520  +
        );
30901  32521   
    }
30902  32522   
    /// Supports handling Infinity float values.
30903  32523   
    /// Test ID: RestJsonSupportsInfinityFloatInputs
30904  32524   
    #[::tokio::test]
       32525  +
    #[::tracing_test::traced_test]
30905  32526   
    async fn rest_json_supports_infinity_float_inputs_request() {
30906  32527   
        #[allow(unused_mut)]
30907  32528   
        let mut http_request = http::Request::builder()
30908  32529   
            .uri("/SimpleScalarProperties")
30909  32530   
            .method("PUT")
30910  32531   
            .header("Content-Type", "application/json")
30911  32532   
            .body(::aws_smithy_http_server::body::Body::from(
30912  32533   
                ::bytes::Bytes::from_static(
30913  32534   
                    "{\n    \"floatValue\": \"Infinity\",\n    \"DoubleDribble\": \"Infinity\"\n}"
30914  32535   
                        .as_bytes(),
@@ -30989,32610 +31053,32678 @@
31009  32630   
        ;
31010  32631   
        response };
31011  32632   
                                sender.send(()).await.expect("receiver dropped early");
31012  32633   
                                result
31013  32634   
                            }
31014  32635   
                        })
31015  32636   
                        .build_unchecked();
31016  32637   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31017  32638   
            .await
31018  32639   
            .expect("unable to make an HTTP request");
31019         -
        assert!(receiver.recv().await.is_some());
       32640  +
        assert!(
       32641  +
            receiver.recv().await.is_some(),
       32642  +
            "we expected operation handler to be invoked but it was not entered"
       32643  +
        );
31020  32644   
    }
31021  32645   
    /// Supports handling -Infinity float values.
31022  32646   
    /// Test ID: RestJsonSupportsNegativeInfinityFloatInputs
31023  32647   
    #[::tokio::test]
       32648  +
    #[::tracing_test::traced_test]
31024  32649   
    async fn rest_json_supports_negative_infinity_float_inputs_request() {
31025  32650   
        #[allow(unused_mut)]
31026  32651   
                    let mut http_request = http::Request::builder()
31027  32652   
                        .uri("/SimpleScalarProperties")
31028  32653   
                        .method("PUT")
31029  32654   
        .header("Content-Type", "application/json")
31030  32655   
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"floatValue\": \"-Infinity\",\n    \"DoubleDribble\": \"-Infinity\"\n}".as_bytes()))).unwrap();
31031  32656   
        #[allow(unused_mut)]
31032  32657   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31033  32658   
        let config = crate::service::RestJsonConfig::builder().build();
@@ -31102,32727 +41227,42040 @@
31122  32747   
        ;
31123  32748   
        response };
31124  32749   
                                sender.send(()).await.expect("receiver dropped early");
31125  32750   
                                result
31126  32751   
                            }
31127  32752   
                        })
31128  32753   
                        .build_unchecked();
31129  32754   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31130  32755   
            .await
31131  32756   
            .expect("unable to make an HTTP request");
31132         -
        assert!(receiver.recv().await.is_some());
       32757  +
        assert!(
       32758  +
            receiver.recv().await.is_some(),
       32759  +
            "we expected operation handler to be invoked but it was not entered"
       32760  +
        );
31133  32761   
    }
31134  32762   
    /// Serializes simple scalar properties
31135  32763   
    /// Test ID: RestJsonSimpleScalarProperties
31136  32764   
    #[::tokio::test]
       32765  +
    #[::tracing_test::traced_test]
31137  32766   
    async fn rest_json_simple_scalar_properties_response() {
31138  32767   
        let output = crate::output::SimpleScalarPropertiesOutput {
31139  32768   
            foo: ::std::option::Option::Some("Foo".to_owned()),
31140  32769   
            string_value: ::std::option::Option::Some("string".to_owned()),
31141  32770   
            true_boolean_value: ::std::option::Option::Some(true),
31142  32771   
            false_boolean_value: ::std::option::Option::Some(false),
31143  32772   
            byte_value: ::std::option::Option::Some(1),
31144  32773   
            short_value: ::std::option::Option::Some(2),
31145  32774   
            integer_value: ::std::option::Option::Some(3),
31146  32775   
            long_value: ::std::option::Option::Some(4),
31147  32776   
            float_value: ::std::option::Option::Some(5.5_f32),
31148  32777   
            double_value: ::std::option::Option::Some(6.5_f64),
31149  32778   
        };
31150  32779   
        use ::aws_smithy_http_server::response::IntoResponse;
31151  32780   
        let http_response = output.into_response();
31152  32781   
        ::pretty_assertions::assert_eq!(
31153  32782   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31154  32783   
            http_response.status()
31155  32784   
        );
31156  32785   
        let expected_headers = [("Content-Type", "application/json"), ("X-Foo", "Foo")];
31157  32786   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31158  32787   
            http_response.headers(),
31159  32788   
            expected_headers,
31160  32789   
        ));
31161  32790   
        let body = ::hyper::body::to_bytes(http_response.into_body())
31162  32791   
            .await
31163  32792   
            .expect("unable to extract body to bytes");
31164  32793   
        ::aws_smithy_protocol_test::assert_ok(
31165  32794   
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"stringValue\": \"string\",\n    \"trueBooleanValue\": true,\n    \"falseBooleanValue\": false,\n    \"byteValue\": 1,\n    \"shortValue\": 2,\n    \"integerValue\": 3,\n    \"longValue\": 4,\n    \"floatValue\": 5.5,\n    \"DoubleDribble\": 6.5\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
31166  32795   
        );
31167  32796   
    }
31168  32797   
    /// Rest Json should not serialize null structure values
31169  32798   
    /// Test ID: RestJsonServersDontSerializeNullStructureValues
31170  32799   
    #[::tokio::test]
       32800  +
    #[::tracing_test::traced_test]
31171  32801   
    async fn rest_json_servers_dont_serialize_null_structure_values_response() {
31172  32802   
        let output = crate::output::SimpleScalarPropertiesOutput {
31173  32803   
            string_value: ::std::option::Option::None,
31174  32804   
            foo: ::std::option::Option::None,
31175  32805   
            true_boolean_value: ::std::option::Option::None,
31176  32806   
            false_boolean_value: ::std::option::Option::None,
31177  32807   
            byte_value: ::std::option::Option::None,
31178  32808   
            short_value: ::std::option::Option::None,
31179  32809   
            integer_value: ::std::option::Option::None,
31180  32810   
            long_value: ::std::option::Option::None,
31181  32811   
            float_value: ::std::option::Option::None,
31182  32812   
            double_value: ::std::option::Option::None,
31183  32813   
        };
31184  32814   
        use ::aws_smithy_http_server::response::IntoResponse;
31185  32815   
        let http_response = output.into_response();
31186  32816   
        ::pretty_assertions::assert_eq!(
31187  32817   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31188  32818   
            http_response.status()
31189  32819   
        );
31190  32820   
        let expected_headers = [("Content-Type", "application/json")];
31191  32821   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31192  32822   
            http_response.headers(),
31193  32823   
            expected_headers,
31194  32824   
        ));
31195  32825   
        let body = ::hyper::body::to_bytes(http_response.into_body())
31196  32826   
            .await
31197  32827   
            .expect("unable to extract body to bytes");
31198  32828   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31199  32829   
            &body,
31200  32830   
            "{}",
31201  32831   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31202  32832   
        ));
31203  32833   
    }
31204  32834   
    /// Supports handling NaN float values.
31205  32835   
    /// Test ID: RestJsonSupportsNaNFloatInputs
31206  32836   
    #[::tokio::test]
       32837  +
    #[::tracing_test::traced_test]
31207  32838   
    async fn rest_json_supports_na_n_float_inputs_response() {
31208  32839   
        let output = crate::output::SimpleScalarPropertiesOutput {
31209  32840   
            float_value: ::std::option::Option::Some(
31210  32841   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
31211  32842   
                    .expect("invalid string for number"),
31212  32843   
            ),
31213  32844   
            double_value: ::std::option::Option::Some(
31214  32845   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
31215  32846   
                    .expect("invalid string for number"),
31216  32847   
            ),
31217  32848   
            foo: ::std::option::Option::None,
31218  32849   
            string_value: ::std::option::Option::None,
31219  32850   
            true_boolean_value: ::std::option::Option::None,
31220  32851   
            false_boolean_value: ::std::option::Option::None,
31221  32852   
            byte_value: ::std::option::Option::None,
31222  32853   
            short_value: ::std::option::Option::None,
31223  32854   
            integer_value: ::std::option::Option::None,
31224  32855   
            long_value: ::std::option::Option::None,
31225  32856   
        };
31226  32857   
        use ::aws_smithy_http_server::response::IntoResponse;
31227  32858   
        let http_response = output.into_response();
31228  32859   
        ::pretty_assertions::assert_eq!(
31229  32860   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31230  32861   
            http_response.status()
31231  32862   
        );
31232  32863   
        let expected_headers = [("Content-Type", "application/json")];
31233  32864   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31234  32865   
            http_response.headers(),
31235  32866   
            expected_headers,
31236  32867   
        ));
31237  32868   
        let body = ::hyper::body::to_bytes(http_response.into_body())
31238  32869   
            .await
31239  32870   
            .expect("unable to extract body to bytes");
31240  32871   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31241  32872   
            &body,
31242  32873   
            "{\n    \"floatValue\": \"NaN\",\n    \"DoubleDribble\": \"NaN\"\n}",
31243  32874   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31244  32875   
        ));
31245  32876   
    }
31246  32877   
    /// Supports handling Infinity float values.
31247  32878   
    /// Test ID: RestJsonSupportsInfinityFloatInputs
31248  32879   
    #[::tokio::test]
       32880  +
    #[::tracing_test::traced_test]
31249  32881   
    async fn rest_json_supports_infinity_float_inputs_response() {
31250  32882   
        let output = crate::output::SimpleScalarPropertiesOutput {
31251  32883   
            float_value: ::std::option::Option::Some(
31252  32884   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
31253  32885   
                    .expect("invalid string for number"),
31254  32886   
            ),
31255  32887   
            double_value: ::std::option::Option::Some(
31256  32888   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
31257  32889   
                    .expect("invalid string for number"),
31258  32890   
            ),
31259  32891   
            foo: ::std::option::Option::None,
31260  32892   
            string_value: ::std::option::Option::None,
31261  32893   
            true_boolean_value: ::std::option::Option::None,
31262  32894   
            false_boolean_value: ::std::option::Option::None,
31263  32895   
            byte_value: ::std::option::Option::None,
31264  32896   
            short_value: ::std::option::Option::None,
31265  32897   
            integer_value: ::std::option::Option::None,
31266  32898   
            long_value: ::std::option::Option::None,
31267  32899   
        };
31268  32900   
        use ::aws_smithy_http_server::response::IntoResponse;
31269  32901   
        let http_response = output.into_response();
31270  32902   
        ::pretty_assertions::assert_eq!(
31271  32903   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31272  32904   
            http_response.status()
31273  32905   
        );
31274  32906   
        let expected_headers = [("Content-Type", "application/json")];
31275  32907   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31276  32908   
            http_response.headers(),
31277  32909   
            expected_headers,
31278  32910   
        ));
31279  32911   
        let body = ::hyper::body::to_bytes(http_response.into_body())
31280  32912   
            .await
31281  32913   
            .expect("unable to extract body to bytes");
31282  32914   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31283  32915   
            &body,
31284  32916   
            "{\n    \"floatValue\": \"Infinity\",\n    \"DoubleDribble\": \"Infinity\"\n}",
31285  32917   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31286  32918   
        ));
31287  32919   
    }
31288  32920   
    /// Supports handling -Infinity float values.
31289  32921   
    /// Test ID: RestJsonSupportsNegativeInfinityFloatInputs
31290  32922   
    #[::tokio::test]
       32923  +
    #[::tracing_test::traced_test]
31291  32924   
    async fn rest_json_supports_negative_infinity_float_inputs_response() {
31292  32925   
        let output = crate::output::SimpleScalarPropertiesOutput {
31293  32926   
            float_value: ::std::option::Option::Some(
31294  32927   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
31295  32928   
                    .expect("invalid string for number"),
31296  32929   
            ),
31297  32930   
            double_value: ::std::option::Option::Some(
31298  32931   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
31299  32932   
                    .expect("invalid string for number"),
31300  32933   
            ),
31301  32934   
            foo: ::std::option::Option::None,
31302  32935   
            string_value: ::std::option::Option::None,
31303  32936   
            true_boolean_value: ::std::option::Option::None,
31304  32937   
            false_boolean_value: ::std::option::Option::None,
31305  32938   
            byte_value: ::std::option::Option::None,
31306  32939   
            short_value: ::std::option::Option::None,
31307  32940   
            integer_value: ::std::option::Option::None,
31308  32941   
            long_value: ::std::option::Option::None,
31309  32942   
        };
31310  32943   
        use ::aws_smithy_http_server::response::IntoResponse;
31311  32944   
        let http_response = output.into_response();
31312  32945   
        ::pretty_assertions::assert_eq!(
31313  32946   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31314  32947   
            http_response.status()
31315  32948   
        );
31316  32949   
        let expected_headers = [("Content-Type", "application/json")];
31317  32950   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31318  32951   
            http_response.headers(),
31319  32952   
            expected_headers,
31320  32953   
        ));
31321  32954   
        let body = ::hyper::body::to_bytes(http_response.into_body())
31322  32955   
            .await
31323  32956   
            .expect("unable to extract body to bytes");
31324  32957   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31325  32958   
            &body,
31326  32959   
            "{\n    \"floatValue\": \"-Infinity\",\n    \"DoubleDribble\": \"-Infinity\"\n}",
31327  32960   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31328  32961   
        ));
31329  32962   
    }
31330  32963   
}
31331         -
#[cfg(test)]
31332         -
#[allow(unreachable_code, unused_variables)]
31333         -
mod server_sparse_json_lists_test {
31334         -
    /// Serializes null values in sparse lists
31335         -
    /// Test ID: RestJsonSparseListsSerializeNull
31336         -
    #[::tokio::test]
31337         -
    async fn rest_json_sparse_lists_serialize_null_request() {
31338         -
        #[allow(unused_mut)]
31339         -
        let mut http_request = http::Request::builder()
31340         -
            .uri("/SparseJsonLists")
31341         -
            .method("PUT")
31342         -
            .header("Content-Type", "application/json")
31343         -
            .body(::aws_smithy_http_server::body::Body::from(
31344         -
                ::bytes::Bytes::from_static(
31345         -
                    "{\n    \"sparseStringList\": [\n        null,\n        \"hi\"\n    ]\n}"
31346         -
                        .as_bytes(),
31347         -
                ),
31348         -
            ))
31349         -
            .unwrap();
31350         -
        #[allow(unused_mut)]
31351         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31352         -
        let config = crate::service::RestJsonConfig::builder().build();
31353         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31354         -
            .sparse_json_lists(move |input: crate::input::SparseJsonListsInput| {
31355         -
                let sender = sender.clone();
31356         -
                async move {
31357         -
                    let result = {
31358         -
                        let expected = crate::input::SparseJsonListsInput {
31359         -
                            sparse_string_list: ::std::option::Option::Some(vec![
31360         -
                                ::std::option::Option::None,
31361         -
                                ::std::option::Option::Some("hi".to_owned()),
31362         -
                            ]),
31363         -
                        };
31364         -
                        ::pretty_assertions::assert_eq!(input, expected);
31365         -
                        let response = crate::output::SparseJsonListsOutput {
31366         -
                            sparse_string_list: ::std::option::Option::None,
       32964  +
       32965  +
const CONTENT_TYPE_GREETINGWITHERRORS: ::mime::Mime = ::mime::APPLICATION_JSON;
       32966  +
::pin_project_lite::pin_project! {
       32967  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       32968  +
    /// [`GreetingWithErrorsInput`](crate::input::GreetingWithErrorsInput) using modelled bindings.
       32969  +
    pub struct GreetingWithErrorsInputFuture {
       32970  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GreetingWithErrorsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       32971  +
    }
       32972  +
}
       32973  +
       32974  +
impl std::future::Future for GreetingWithErrorsInputFuture {
       32975  +
    type Output = Result<
       32976  +
        crate::input::GreetingWithErrorsInput,
       32977  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       32978  +
    >;
       32979  +
       32980  +
    fn poll(
       32981  +
        self: std::pin::Pin<&mut Self>,
       32982  +
        cx: &mut std::task::Context<'_>,
       32983  +
    ) -> std::task::Poll<Self::Output> {
       32984  +
        let this = self.project();
       32985  +
        this.inner.as_mut().poll(cx)
       32986  +
    }
       32987  +
}
       32988  +
       32989  +
impl<B>
       32990  +
    ::aws_smithy_http_server::request::FromRequest<
       32991  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       32992  +
        B,
       32993  +
    > for crate::input::GreetingWithErrorsInput
       32994  +
where
       32995  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       32996  +
    B: 'static,
       32997  +
       32998  +
    B::Data: Send,
       32999  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       33000  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       33001  +
{
       33002  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       33003  +
    type Future = GreetingWithErrorsInputFuture;
       33004  +
       33005  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       33006  +
        let fut = async move {
       33007  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       33008  +
                request.headers(),
       33009  +
                &CONTENT_TYPE_GREETINGWITHERRORS,
       33010  +
            ) {
       33011  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       33012  +
            }
       33013  +
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
       33014  +
                request,
       33015  +
            )
       33016  +
            .await
       33017  +
            .map_err(Into::into)
31367  33018   
        };
       33019  +
        use ::futures_util::future::TryFutureExt;
       33020  +
        let fut = fut.map_err(
       33021  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       33022  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       33023  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       33024  +
                    e,
       33025  +
                )
       33026  +
            },
       33027  +
        );
       33028  +
        GreetingWithErrorsInputFuture {
       33029  +
            inner: Box::pin(fut),
       33030  +
        }
       33031  +
    }
       33032  +
}
       33033  +
impl
       33034  +
    ::aws_smithy_http_server::response::IntoResponse<
       33035  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33036  +
    > for crate::output::GreetingWithErrorsOutput
       33037  +
{
       33038  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       33039  +
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_response(self) {
       33040  +
                        Ok(response) => response,
       33041  +
                        Err(e) => {
       33042  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       33043  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       33044  +
                        }
       33045  +
                    }
       33046  +
    }
       33047  +
}
       33048  +
impl
       33049  +
    ::aws_smithy_http_server::response::IntoResponse<
       33050  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33051  +
    > for crate::error::GreetingWithErrorsError
       33052  +
{
       33053  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       33054  +
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_error(
       33055  +
            &self,
       33056  +
        ) {
       33057  +
            Ok(mut response) => {
       33058  +
                response.extensions_mut().insert(
       33059  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       33060  +
                );
31368  33061   
                response
31369         -
                    };
31370         -
                    sender.send(()).await.expect("receiver dropped early");
31371         -
                    result
31372  33062   
            }
31373         -
            })
31374         -
            .build_unchecked();
31375         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31376         -
            .await
31377         -
            .expect("unable to make an HTTP request");
31378         -
        assert!(receiver.recv().await.is_some());
       33063  +
            Err(e) => {
       33064  +
                ::tracing::error!(error = %e, "failed to serialize response");
       33065  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
31379  33066   
            }
31380         -
    /// Serializes null values in sparse lists
31381         -
    /// Test ID: RestJsonSparseListsSerializeNull
       33067  +
        }
       33068  +
    }
       33069  +
}
       33070  +
       33071  +
#[allow(unreachable_code, unused_variables)]
       33072  +
#[cfg(test)]
       33073  +
mod greeting_with_errors_test {
       33074  +
       33075  +
    /// Ensures that operations with errors successfully know how
       33076  +
    /// to deserialize a successful response. As of January 2021,
       33077  +
    /// server implementations are expected to respond with a
       33078  +
    /// JSON object regardless of if the output parameters are
       33079  +
    /// empty.
       33080  +
    /// Test ID: RestJsonGreetingWithErrors
31382  33081   
    #[::tokio::test]
31383         -
    async fn rest_json_sparse_lists_serialize_null_response() {
31384         -
        let output = crate::output::SparseJsonListsOutput {
31385         -
            sparse_string_list: ::std::option::Option::Some(vec![
31386         -
                ::std::option::Option::None,
31387         -
                ::std::option::Option::Some("hi".to_owned()),
31388         -
            ]),
       33082  +
    #[::tracing_test::traced_test]
       33083  +
    async fn rest_json_greeting_with_errors_response() {
       33084  +
        let output = crate::output::GreetingWithErrorsOutput {
       33085  +
            greeting: ::std::option::Option::Some("Hello".to_owned()),
31389  33086   
        };
31390  33087   
        use ::aws_smithy_http_server::response::IntoResponse;
31391  33088   
        let http_response = output.into_response();
31392  33089   
        ::pretty_assertions::assert_eq!(
31393  33090   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31394  33091   
            http_response.status()
31395  33092   
        );
31396         -
        let expected_headers = [("Content-Type", "application/json")];
       33093  +
        let expected_headers = [("X-Greeting", "Hello")];
31397  33094   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31398  33095   
            http_response.headers(),
31399  33096   
            expected_headers,
31400  33097   
        ));
31401  33098   
        let body = ::hyper::body::to_bytes(http_response.into_body())
31402  33099   
            .await
31403  33100   
            .expect("unable to extract body to bytes");
31404  33101   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
31405  33102   
            &body,
31406         -
            "{\n    \"sparseStringList\": [\n        null,\n        \"hi\"\n    ]\n}",
       33103  +
            "{}",
31407  33104   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31408  33105   
        ));
31409  33106   
    }
31410         -
}
31411         -
#[cfg(test)]
31412         -
#[allow(unreachable_code, unused_variables)]
31413         -
mod server_sparse_json_maps_test {
31414         -
    /// Serializes JSON maps
31415         -
    /// Test ID: RestJsonSparseJsonMaps
       33107  +
    /// Parses simple JSON errors
       33108  +
    /// Test ID: RestJsonInvalidGreetingError
31416  33109   
    #[::tokio::test]
31417         -
    async fn rest_json_sparse_json_maps_request() {
31418         -
        #[allow(unused_mut)]
31419         -
                    let mut http_request = http::Request::builder()
31420         -
                        .uri("/SparseJsonMaps")
31421         -
                        .method("POST")
31422         -
        .header("Content-Type", "application/json")
31423         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n    }\n}".as_bytes()))).unwrap();
31424         -
        #[allow(unused_mut)]
31425         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31426         -
        let config = crate::service::RestJsonConfig::builder().build();
31427         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31428         -
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
31429         -
                let sender = sender.clone();
31430         -
                async move {
31431         -
                    let result = {
31432         -
                        let expected = crate::input::SparseJsonMapsInput {
31433         -
                            sparse_struct_map: ::std::option::Option::Some({
31434         -
                                let mut ret = ::std::collections::HashMap::new();
31435         -
                                ret.insert(
31436         -
                                    "foo".to_owned(),
31437         -
                                    ::std::option::Option::Some(crate::model::GreetingStruct {
31438         -
                                        hi: ::std::option::Option::Some("there".to_owned()),
31439         -
                                    }),
31440         -
                                );
31441         -
                                ret.insert(
31442         -
                                    "baz".to_owned(),
31443         -
                                    ::std::option::Option::Some(crate::model::GreetingStruct {
31444         -
                                        hi: ::std::option::Option::Some("bye".to_owned()),
31445         -
                                    }),
31446         -
                                );
31447         -
                                ret
31448         -
                            }),
31449         -
                            sparse_number_map: ::std::option::Option::None,
31450         -
                            sparse_boolean_map: ::std::option::Option::None,
31451         -
                            sparse_string_map: ::std::option::Option::None,
31452         -
                            sparse_set_map: ::std::option::Option::None,
31453         -
                        };
31454         -
                        ::pretty_assertions::assert_eq!(input, expected);
31455         -
                        let response = crate::output::SparseJsonMapsOutput {
31456         -
                            sparse_struct_map: ::std::option::Option::None,
31457         -
                            sparse_number_map: ::std::option::Option::None,
31458         -
                            sparse_boolean_map: ::std::option::Option::None,
31459         -
                            sparse_string_map: ::std::option::Option::None,
31460         -
                            sparse_set_map: ::std::option::Option::None,
31461         -
                        };
31462         -
                        Ok(response)
       33110  +
    #[::tracing_test::traced_test]
       33111  +
    async fn rest_json_invalid_greeting_error_response() {
       33112  +
        let output = crate::error::InvalidGreeting {
       33113  +
            message: ::std::option::Option::Some("Hi".to_owned()),
31463  33114   
        };
31464         -
                    sender.send(()).await.expect("receiver dropped early");
31465         -
                    result
31466         -
                }
31467         -
            })
31468         -
            .build_unchecked();
31469         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33115  +
        let output = crate::error::GreetingWithErrorsError::InvalidGreeting(output);
       33116  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33117  +
        let http_response = output.into_response();
       33118  +
        ::pretty_assertions::assert_eq!(
       33119  +
            http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
       33120  +
            http_response.status()
       33121  +
        );
       33122  +
        let expected_headers = [
       33123  +
            ("Content-Type", "application/json"),
       33124  +
            ("X-Amzn-Errortype", "InvalidGreeting"),
       33125  +
        ];
       33126  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33127  +
            http_response.headers(),
       33128  +
            expected_headers,
       33129  +
        ));
       33130  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
31470  33131   
            .await
31471         -
            .expect("unable to make an HTTP request");
31472         -
        assert!(receiver.recv().await.is_some());
       33132  +
            .expect("unable to extract body to bytes");
       33133  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       33134  +
            &body,
       33135  +
            "{\n    \"Message\": \"Hi\"\n}",
       33136  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       33137  +
        ));
31473  33138   
    }
31474         -
    /// Serializes JSON map values in sparse maps
31475         -
    /// Test ID: RestJsonSerializesSparseNullMapValues
       33139  +
    /// Serializes a complex error with no message member
       33140  +
    /// Test ID: RestJsonComplexErrorWithNoMessage
31476  33141   
    #[::tokio::test]
31477         -
    async fn rest_json_serializes_sparse_null_map_values_request() {
31478         -
        #[allow(unused_mut)]
31479         -
                    let mut http_request = http::Request::builder()
31480         -
                        .uri("/SparseJsonMaps")
31481         -
                        .method("POST")
31482         -
        .header("Content-Type", "application/json")
31483         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseBooleanMap\": {\n        \"x\": null\n    },\n    \"sparseNumberMap\": {\n        \"x\": null\n    },\n    \"sparseStringMap\": {\n        \"x\": null\n    },\n    \"sparseStructMap\": {\n        \"x\": null\n    }\n}".as_bytes()))).unwrap();
31484         -
        #[allow(unused_mut)]
31485         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31486         -
        let config = crate::service::RestJsonConfig::builder().build();
31487         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31488         -
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
31489         -
                let sender = sender.clone();
31490         -
                async move {
31491         -
                    let result = {
31492         -
                        let expected = crate::input::SparseJsonMapsInput {
31493         -
                            sparse_boolean_map: ::std::option::Option::Some({
31494         -
                                let mut ret = ::std::collections::HashMap::new();
31495         -
                                ret.insert("x".to_owned(), ::std::option::Option::None);
31496         -
                                ret
31497         -
                            }),
31498         -
                            sparse_number_map: ::std::option::Option::Some({
31499         -
                                let mut ret = ::std::collections::HashMap::new();
31500         -
                                ret.insert("x".to_owned(), ::std::option::Option::None);
31501         -
                                ret
31502         -
                            }),
31503         -
                            sparse_string_map: ::std::option::Option::Some({
31504         -
                                let mut ret = ::std::collections::HashMap::new();
31505         -
                                ret.insert("x".to_owned(), ::std::option::Option::None);
31506         -
                                ret
31507         -
                            }),
31508         -
                            sparse_struct_map: ::std::option::Option::Some({
31509         -
                                let mut ret = ::std::collections::HashMap::new();
31510         -
                                ret.insert("x".to_owned(), ::std::option::Option::None);
31511         -
                                ret
       33142  +
    #[::tracing_test::traced_test]
       33143  +
    async fn rest_json_complex_error_with_no_message_response() {
       33144  +
        let output = crate::error::ComplexError {
       33145  +
            header: ::std::option::Option::Some("Header".to_owned()),
       33146  +
            top_level: ::std::option::Option::Some("Top level".to_owned()),
       33147  +
            nested: ::std::option::Option::Some(crate::model::ComplexNestedErrorData {
       33148  +
                foo: ::std::option::Option::Some("bar".to_owned()),
31512  33149   
            }),
31513         -
                            sparse_set_map: ::std::option::Option::None,
31514         -
                        };
31515         -
                        ::pretty_assertions::assert_eq!(input, expected);
31516         -
                        let response = crate::output::SparseJsonMapsOutput {
31517         -
                            sparse_struct_map: ::std::option::Option::None,
31518         -
                            sparse_number_map: ::std::option::Option::None,
31519         -
                            sparse_boolean_map: ::std::option::Option::None,
31520         -
                            sparse_string_map: ::std::option::Option::None,
31521         -
                            sparse_set_map: ::std::option::Option::None,
31522         -
                        };
31523         -
                        Ok(response)
31524  33150   
        };
31525         -
                    sender.send(()).await.expect("receiver dropped early");
31526         -
                    result
31527         -
                }
31528         -
            })
31529         -
            .build_unchecked();
31530         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33151  +
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
       33152  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33153  +
        let http_response = output.into_response();
       33154  +
        ::pretty_assertions::assert_eq!(
       33155  +
            http::StatusCode::from_u16(403).expect("invalid expected HTTP status code"),
       33156  +
            http_response.status()
       33157  +
        );
       33158  +
        let expected_headers = [
       33159  +
            ("Content-Type", "application/json"),
       33160  +
            ("X-Amzn-Errortype", "ComplexError"),
       33161  +
            ("X-Header", "Header"),
       33162  +
        ];
       33163  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33164  +
            http_response.headers(),
       33165  +
            expected_headers,
       33166  +
        ));
       33167  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
31531  33168   
            .await
31532         -
            .expect("unable to make an HTTP request");
31533         -
        assert!(receiver.recv().await.is_some());
       33169  +
            .expect("unable to extract body to bytes");
       33170  +
        ::aws_smithy_protocol_test::assert_ok(
       33171  +
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"TopLevel\": \"Top level\",\n    \"Nested\": {\n        \"Fooooo\": \"bar\"\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       33172  +
        );
31534  33173   
    }
31535         -
    /// Ensure that 0 and false are sent over the wire in all maps and lists
31536         -
    /// Test ID: RestJsonSerializesZeroValuesInSparseMaps
       33174  +
    /// Test ID: RestJsonEmptyComplexErrorWithNoMessage
31537  33175   
    #[::tokio::test]
31538         -
    async fn rest_json_serializes_zero_values_in_sparse_maps_request() {
31539         -
        #[allow(unused_mut)]
31540         -
                    let mut http_request = http::Request::builder()
31541         -
                        .uri("/SparseJsonMaps")
31542         -
                        .method("POST")
31543         -
        .header("Content-Type", "application/json")
31544         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseNumberMap\": {\n        \"x\": 0\n    },\n    \"sparseBooleanMap\": {\n        \"x\": false\n    }\n}".as_bytes()))).unwrap();
31545         -
        #[allow(unused_mut)]
31546         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31547         -
        let config = crate::service::RestJsonConfig::builder().build();
31548         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31549         -
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
31550         -
                let sender = sender.clone();
31551         -
                async move {
31552         -
                    let result = {
31553         -
                        let expected = crate::input::SparseJsonMapsInput {
31554         -
                            sparse_number_map: ::std::option::Option::Some({
31555         -
                                let mut ret = ::std::collections::HashMap::new();
31556         -
                                ret.insert("x".to_owned(), ::std::option::Option::Some(0));
31557         -
                                ret
31558         -
                            }),
31559         -
                            sparse_boolean_map: ::std::option::Option::Some({
31560         -
                                let mut ret = ::std::collections::HashMap::new();
31561         -
                                ret.insert("x".to_owned(), ::std::option::Option::Some(false));
31562         -
                                ret
31563         -
                            }),
31564         -
                            sparse_struct_map: ::std::option::Option::None,
31565         -
                            sparse_string_map: ::std::option::Option::None,
31566         -
                            sparse_set_map: ::std::option::Option::None,
31567         -
                        };
31568         -
                        ::pretty_assertions::assert_eq!(input, expected);
31569         -
                        let response = crate::output::SparseJsonMapsOutput {
31570         -
                            sparse_struct_map: ::std::option::Option::None,
31571         -
                            sparse_number_map: ::std::option::Option::None,
31572         -
                            sparse_boolean_map: ::std::option::Option::None,
31573         -
                            sparse_string_map: ::std::option::Option::None,
31574         -
                            sparse_set_map: ::std::option::Option::None,
31575         -
                        };
31576         -
                        Ok(response)
31577         -
                    };
31578         -
                    sender.send(()).await.expect("receiver dropped early");
31579         -
                    result
31580         -
                }
31581         -
            })
31582         -
            .build_unchecked();
31583         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31584         -
            .await
31585         -
            .expect("unable to make an HTTP request");
31586         -
        assert!(receiver.recv().await.is_some());
31587         -
    }
31588         -
    /// A request that contains a sparse map of sets
31589         -
    /// Test ID: RestJsonSerializesSparseSetMap
31590         -
    #[::tokio::test]
31591         -
    async fn rest_json_serializes_sparse_set_map_request() {
31592         -
        #[allow(unused_mut)]
31593         -
                    let mut http_request = http::Request::builder()
31594         -
                        .uri("/SparseJsonMaps")
31595         -
                        .method("POST")
31596         -
        .header("Content-Type", "application/json")
31597         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}".as_bytes()))).unwrap();
31598         -
        #[allow(unused_mut)]
31599         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31600         -
        let config = crate::service::RestJsonConfig::builder().build();
31601         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31602         -
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
31603         -
                let sender = sender.clone();
31604         -
                async move {
31605         -
                    let result = {
31606         -
                        let expected = crate::input::SparseJsonMapsInput {
31607         -
                            sparse_set_map: ::std::option::Option::Some({
31608         -
                                let mut ret = ::std::collections::HashMap::new();
31609         -
                                ret.insert(
31610         -
                                    "x".to_owned(),
31611         -
                                    ::std::option::Option::Some(
31612         -
                                        vec![].try_into().expect("this is only used in tests"),
31613         -
                                    ),
31614         -
                                );
31615         -
                                ret.insert(
31616         -
                                    "y".to_owned(),
31617         -
                                    ::std::option::Option::Some(
31618         -
                                        vec!["a".to_owned(), "b".to_owned()]
31619         -
                                            .try_into()
31620         -
                                            .expect("this is only used in tests"),
31621         -
                                    ),
31622         -
                                );
31623         -
                                ret
31624         -
                            }),
31625         -
                            sparse_struct_map: ::std::option::Option::None,
31626         -
                            sparse_number_map: ::std::option::Option::None,
31627         -
                            sparse_boolean_map: ::std::option::Option::None,
31628         -
                            sparse_string_map: ::std::option::Option::None,
31629         -
                        };
31630         -
                        ::pretty_assertions::assert_eq!(input, expected);
31631         -
                        let response = crate::output::SparseJsonMapsOutput {
31632         -
                            sparse_struct_map: ::std::option::Option::None,
31633         -
                            sparse_number_map: ::std::option::Option::None,
31634         -
                            sparse_boolean_map: ::std::option::Option::None,
31635         -
                            sparse_string_map: ::std::option::Option::None,
31636         -
                            sparse_set_map: ::std::option::Option::None,
31637         -
                        };
31638         -
                        Ok(response)
31639         -
                    };
31640         -
                    sender.send(()).await.expect("receiver dropped early");
31641         -
                    result
31642         -
                }
31643         -
            })
31644         -
            .build_unchecked();
31645         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31646         -
            .await
31647         -
            .expect("unable to make an HTTP request");
31648         -
        assert!(receiver.recv().await.is_some());
31649         -
    }
31650         -
    /// A request that contains a sparse map of sets.
31651         -
    /// Test ID: RestJsonSerializesSparseSetMapAndRetainsNull
31652         -
    #[::tokio::test]
31653         -
    async fn rest_json_serializes_sparse_set_map_and_retains_null_request() {
31654         -
        #[allow(unused_mut)]
31655         -
                    let mut http_request = http::Request::builder()
31656         -
                        .uri("/SparseJsonMaps")
31657         -
                        .method("POST")
31658         -
        .header("Content-Type", "application/json")
31659         -
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"],\n        \"z\": null\n    }\n}".as_bytes()))).unwrap();
31660         -
        #[allow(unused_mut)]
31661         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31662         -
        let config = crate::service::RestJsonConfig::builder().build();
31663         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31664         -
            .sparse_json_maps(move |input: crate::input::SparseJsonMapsInput| {
31665         -
                let sender = sender.clone();
31666         -
                async move {
31667         -
                    let result = {
31668         -
                        let expected = crate::input::SparseJsonMapsInput {
31669         -
                            sparse_set_map: ::std::option::Option::Some({
31670         -
                                let mut ret = ::std::collections::HashMap::new();
31671         -
                                ret.insert(
31672         -
                                    "x".to_owned(),
31673         -
                                    ::std::option::Option::Some(
31674         -
                                        vec![].try_into().expect("this is only used in tests"),
31675         -
                                    ),
31676         -
                                );
31677         -
                                ret.insert(
31678         -
                                    "y".to_owned(),
31679         -
                                    ::std::option::Option::Some(
31680         -
                                        vec!["a".to_owned(), "b".to_owned()]
31681         -
                                            .try_into()
31682         -
                                            .expect("this is only used in tests"),
31683         -
                                    ),
31684         -
                                );
31685         -
                                ret.insert("z".to_owned(), ::std::option::Option::None);
31686         -
                                ret
31687         -
                            }),
31688         -
                            sparse_struct_map: ::std::option::Option::None,
31689         -
                            sparse_number_map: ::std::option::Option::None,
31690         -
                            sparse_boolean_map: ::std::option::Option::None,
31691         -
                            sparse_string_map: ::std::option::Option::None,
31692         -
                        };
31693         -
                        ::pretty_assertions::assert_eq!(input, expected);
31694         -
                        let response = crate::output::SparseJsonMapsOutput {
31695         -
                            sparse_struct_map: ::std::option::Option::None,
31696         -
                            sparse_number_map: ::std::option::Option::None,
31697         -
                            sparse_boolean_map: ::std::option::Option::None,
31698         -
                            sparse_string_map: ::std::option::Option::None,
31699         -
                            sparse_set_map: ::std::option::Option::None,
31700         -
                        };
31701         -
                        Ok(response)
31702         -
                    };
31703         -
                    sender.send(()).await.expect("receiver dropped early");
31704         -
                    result
31705         -
                }
31706         -
            })
31707         -
            .build_unchecked();
31708         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31709         -
            .await
31710         -
            .expect("unable to make an HTTP request");
31711         -
        assert!(receiver.recv().await.is_some());
31712         -
    }
31713         -
    /// Deserializes JSON maps
31714         -
    /// Test ID: RestJsonSparseJsonMaps
31715         -
    #[::tokio::test]
31716         -
    async fn rest_json_sparse_json_maps_response() {
31717         -
        let output = crate::output::SparseJsonMapsOutput {
31718         -
            sparse_struct_map: ::std::option::Option::Some({
31719         -
                let mut ret = ::std::collections::HashMap::new();
31720         -
                ret.insert(
31721         -
                    "foo".to_owned(),
31722         -
                    ::std::option::Option::Some(crate::model::GreetingStruct {
31723         -
                        hi: ::std::option::Option::Some("there".to_owned()),
31724         -
                    }),
31725         -
                );
31726         -
                ret.insert(
31727         -
                    "baz".to_owned(),
31728         -
                    ::std::option::Option::Some(crate::model::GreetingStruct {
31729         -
                        hi: ::std::option::Option::Some("bye".to_owned()),
31730         -
                    }),
31731         -
                );
31732         -
                ret
31733         -
            }),
31734         -
            sparse_number_map: ::std::option::Option::None,
31735         -
            sparse_boolean_map: ::std::option::Option::None,
31736         -
            sparse_string_map: ::std::option::Option::None,
31737         -
            sparse_set_map: ::std::option::Option::None,
       33176  +
    #[::tracing_test::traced_test]
       33177  +
    async fn rest_json_empty_complex_error_with_no_message_response() {
       33178  +
        let output = crate::error::ComplexError {
       33179  +
            header: ::std::option::Option::None,
       33180  +
            top_level: ::std::option::Option::None,
       33181  +
            nested: ::std::option::Option::None,
31738  33182   
        };
       33183  +
        let output = crate::error::GreetingWithErrorsError::ComplexError(output);
31739  33184   
        use ::aws_smithy_http_server::response::IntoResponse;
31740  33185   
        let http_response = output.into_response();
31741  33186   
        ::pretty_assertions::assert_eq!(
31742         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       33187  +
            http::StatusCode::from_u16(403).expect("invalid expected HTTP status code"),
31743  33188   
            http_response.status()
31744  33189   
        );
31745         -
        let expected_headers = [("Content-Type", "application/json")];
       33190  +
        let expected_headers = [
       33191  +
            ("Content-Type", "application/json"),
       33192  +
            ("X-Amzn-Errortype", "ComplexError"),
       33193  +
        ];
31746  33194   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31747  33195   
            http_response.headers(),
31748  33196   
            expected_headers,
31749  33197   
        ));
31750  33198   
        let body = ::hyper::body::to_bytes(http_response.into_body())
31751  33199   
            .await
31752  33200   
            .expect("unable to extract body to bytes");
31753         -
        ::aws_smithy_protocol_test::assert_ok(
31754         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseStructMap\": {\n        \"foo\": {\n            \"hi\": \"there\"\n        },\n        \"baz\": {\n            \"hi\": \"bye\"\n        }\n   }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
31755         -
        );
31756         -
    }
31757         -
    /// Deserializes null JSON map values
31758         -
    /// Test ID: RestJsonDeserializesSparseNullMapValues
31759         -
    #[::tokio::test]
31760         -
    async fn rest_json_deserializes_sparse_null_map_values_response() {
31761         -
        let output = crate::output::SparseJsonMapsOutput {
31762         -
            sparse_boolean_map: ::std::option::Option::Some({
31763         -
                let mut ret = ::std::collections::HashMap::new();
31764         -
                ret.insert("x".to_owned(), ::std::option::Option::None);
31765         -
                ret
31766         -
            }),
31767         -
            sparse_number_map: ::std::option::Option::Some({
31768         -
                let mut ret = ::std::collections::HashMap::new();
31769         -
                ret.insert("x".to_owned(), ::std::option::Option::None);
31770         -
                ret
31771         -
            }),
31772         -
            sparse_string_map: ::std::option::Option::Some({
31773         -
                let mut ret = ::std::collections::HashMap::new();
31774         -
                ret.insert("x".to_owned(), ::std::option::Option::None);
31775         -
                ret
31776         -
            }),
31777         -
            sparse_struct_map: ::std::option::Option::Some({
31778         -
                let mut ret = ::std::collections::HashMap::new();
31779         -
                ret.insert("x".to_owned(), ::std::option::Option::None);
31780         -
                ret
31781         -
            }),
31782         -
            sparse_set_map: ::std::option::Option::None,
31783         -
        };
31784         -
        use ::aws_smithy_http_server::response::IntoResponse;
31785         -
        let http_response = output.into_response();
31786         -
        ::pretty_assertions::assert_eq!(
31787         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31788         -
            http_response.status()
31789         -
        );
31790         -
        let expected_headers = [("Content-Type", "application/json")];
31791         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31792         -
            http_response.headers(),
31793         -
            expected_headers,
       33201  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       33202  +
            &body,
       33203  +
            "{}",
       33204  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
31794  33205   
        ));
31795         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31796         -
            .await
31797         -
            .expect("unable to extract body to bytes");
31798         -
        ::aws_smithy_protocol_test::assert_ok(
31799         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseBooleanMap\": {\n        \"x\": null\n    },\n    \"sparseNumberMap\": {\n        \"x\": null\n    },\n    \"sparseStringMap\": {\n        \"x\": null\n    },\n    \"sparseStructMap\": {\n        \"x\": null\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
31800         -
        );
31801  33206   
    }
31802         -
    /// Ensure that 0 and false are sent over the wire in all maps and lists
31803         -
    /// Test ID: RestJsonDeserializesZeroValuesInSparseMaps
31804         -
    #[::tokio::test]
31805         -
    async fn rest_json_deserializes_zero_values_in_sparse_maps_response() {
31806         -
        let output = crate::output::SparseJsonMapsOutput {
31807         -
            sparse_number_map: ::std::option::Option::Some({
31808         -
                let mut ret = ::std::collections::HashMap::new();
31809         -
                ret.insert("x".to_owned(), ::std::option::Option::Some(0));
31810         -
                ret
31811         -
            }),
31812         -
            sparse_boolean_map: ::std::option::Option::Some({
31813         -
                let mut ret = ::std::collections::HashMap::new();
31814         -
                ret.insert("x".to_owned(), ::std::option::Option::Some(false));
31815         -
                ret
31816         -
            }),
31817         -
            sparse_struct_map: ::std::option::Option::None,
31818         -
            sparse_string_map: ::std::option::Option::None,
31819         -
            sparse_set_map: ::std::option::Option::None,
31820         -
        };
31821         -
        use ::aws_smithy_http_server::response::IntoResponse;
31822         -
        let http_response = output.into_response();
31823         -
        ::pretty_assertions::assert_eq!(
31824         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31825         -
            http_response.status()
31826         -
        );
31827         -
        let expected_headers = [("Content-Type", "application/json")];
31828         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31829         -
            http_response.headers(),
31830         -
            expected_headers,
31831         -
        ));
31832         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31833         -
            .await
31834         -
            .expect("unable to extract body to bytes");
31835         -
        ::aws_smithy_protocol_test::assert_ok(
31836         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseNumberMap\": {\n        \"x\": 0\n    },\n    \"sparseBooleanMap\": {\n        \"x\": false\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
31837         -
        );
       33207  +
}
       33208  +
       33209  +
static CONTENT_TYPE_STREAMINGTRAITSWITHMEDIATYPE: ::once_cell::sync::Lazy<::mime::Mime> =
       33210  +
    ::once_cell::sync::Lazy::new(|| {
       33211  +
        "text/plain"
       33212  +
            .parse::<::mime::Mime>()
       33213  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
       33214  +
    });
       33215  +
::pin_project_lite::pin_project! {
       33216  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       33217  +
    /// [`StreamingTraitsWithMediaTypeInput`](crate::input::StreamingTraitsWithMediaTypeInput) using modelled bindings.
       33218  +
    pub struct StreamingTraitsWithMediaTypeInputFuture {
       33219  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamingTraitsWithMediaTypeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
31838  33220   
    }
31839         -
    /// A response that contains a sparse map of sets
31840         -
    /// Test ID: RestJsonDeserializesSparseSetMap
31841         -
    #[::tokio::test]
31842         -
    async fn rest_json_deserializes_sparse_set_map_response() {
31843         -
        let output = crate::output::SparseJsonMapsOutput {
31844         -
            sparse_set_map: ::std::option::Option::Some({
31845         -
                let mut ret = ::std::collections::HashMap::new();
31846         -
                ret.insert(
31847         -
                    "x".to_owned(),
31848         -
                    ::std::option::Option::Some(
31849         -
                        vec![].try_into().expect("this is only used in tests"),
31850         -
                    ),
31851         -
                );
31852         -
                ret.insert(
31853         -
                    "y".to_owned(),
31854         -
                    ::std::option::Option::Some(
31855         -
                        vec!["a".to_owned(), "b".to_owned()]
31856         -
                            .try_into()
31857         -
                            .expect("this is only used in tests"),
31858         -
                    ),
31859         -
                );
31860         -
                ret
31861         -
            }),
31862         -
            sparse_struct_map: ::std::option::Option::None,
31863         -
            sparse_number_map: ::std::option::Option::None,
31864         -
            sparse_boolean_map: ::std::option::Option::None,
31865         -
            sparse_string_map: ::std::option::Option::None,
31866         -
        };
31867         -
        use ::aws_smithy_http_server::response::IntoResponse;
31868         -
        let http_response = output.into_response();
31869         -
        ::pretty_assertions::assert_eq!(
31870         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31871         -
            http_response.status()
31872         -
        );
31873         -
        let expected_headers = [("Content-Type", "application/json")];
31874         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31875         -
            http_response.headers(),
31876         -
            expected_headers,
31877         -
        ));
31878         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
31879         -
            .await
31880         -
            .expect("unable to extract body to bytes");
31881         -
        ::aws_smithy_protocol_test::assert_ok(
31882         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"]\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
31883         -
        );
       33221  +
}
       33222  +
       33223  +
impl std::future::Future for StreamingTraitsWithMediaTypeInputFuture {
       33224  +
    type Output = Result<
       33225  +
        crate::input::StreamingTraitsWithMediaTypeInput,
       33226  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       33227  +
    >;
       33228  +
       33229  +
    fn poll(
       33230  +
        self: std::pin::Pin<&mut Self>,
       33231  +
        cx: &mut std::task::Context<'_>,
       33232  +
    ) -> std::task::Poll<Self::Output> {
       33233  +
        let this = self.project();
       33234  +
        this.inner.as_mut().poll(cx)
31884  33235   
    }
31885         -
    /// A response that contains a sparse map of sets.
31886         -
    /// Test ID: RestJsonDeserializesSparseSetMapAndRetainsNull
31887         -
    #[::tokio::test]
31888         -
    async fn rest_json_deserializes_sparse_set_map_and_retains_null_response() {
31889         -
        let output = crate::output::SparseJsonMapsOutput {
31890         -
            sparse_set_map: ::std::option::Option::Some({
31891         -
                let mut ret = ::std::collections::HashMap::new();
31892         -
                ret.insert(
31893         -
                    "x".to_owned(),
31894         -
                    ::std::option::Option::Some(
31895         -
                        vec![].try_into().expect("this is only used in tests"),
31896         -
                    ),
31897         -
                );
31898         -
                ret.insert(
31899         -
                    "y".to_owned(),
31900         -
                    ::std::option::Option::Some(
31901         -
                        vec!["a".to_owned(), "b".to_owned()]
31902         -
                            .try_into()
31903         -
                            .expect("this is only used in tests"),
31904         -
                    ),
31905         -
                );
31906         -
                ret.insert("z".to_owned(), ::std::option::Option::None);
31907         -
                ret
31908         -
            }),
31909         -
            sparse_struct_map: ::std::option::Option::None,
31910         -
            sparse_number_map: ::std::option::Option::None,
31911         -
            sparse_boolean_map: ::std::option::Option::None,
31912         -
            sparse_string_map: ::std::option::Option::None,
31913         -
        };
31914         -
        use ::aws_smithy_http_server::response::IntoResponse;
31915         -
        let http_response = output.into_response();
31916         -
        ::pretty_assertions::assert_eq!(
31917         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
31918         -
            http_response.status()
31919         -
        );
31920         -
        let expected_headers = [("Content-Type", "application/json")];
31921         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
31922         -
            http_response.headers(),
31923         -
            expected_headers,
31924         -
        ));
31925         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
       33236  +
}
       33237  +
       33238  +
impl<B>
       33239  +
    ::aws_smithy_http_server::request::FromRequest<
       33240  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33241  +
        B,
       33242  +
    > for crate::input::StreamingTraitsWithMediaTypeInput
       33243  +
where
       33244  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       33245  +
    B: 'static,
       33246  +
       33247  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
       33248  +
    B::Data: Send,
       33249  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       33250  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       33251  +
{
       33252  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       33253  +
    type Future = StreamingTraitsWithMediaTypeInputFuture;
       33254  +
       33255  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       33256  +
        let fut = async move {
       33257  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       33258  +
                request.headers(),
       33259  +
                &CONTENT_TYPE_STREAMINGTRAITSWITHMEDIATYPE,
       33260  +
            ) {
       33261  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       33262  +
            }
       33263  +
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_request(request)
31926  33264   
                            .await
31927         -
            .expect("unable to extract body to bytes");
31928         -
        ::aws_smithy_protocol_test::assert_ok(
31929         -
        ::aws_smithy_protocol_test::validate_body(&body, "{\n    \"sparseSetMap\": {\n        \"x\": [],\n        \"y\": [\"a\", \"b\"],\n        \"z\": null\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
       33265  +
                            .map_err(Into::into)
       33266  +
        };
       33267  +
        use ::futures_util::future::TryFutureExt;
       33268  +
        let fut = fut.map_err(
       33269  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       33270  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       33271  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       33272  +
                    e,
       33273  +
                )
       33274  +
            },
31930  33275   
        );
       33276  +
        StreamingTraitsWithMediaTypeInputFuture {
       33277  +
            inner: Box::pin(fut),
       33278  +
        }
31931  33279   
    }
31932  33280   
}
31933         -
#[cfg(test)]
       33281  +
impl
       33282  +
    ::aws_smithy_http_server::response::IntoResponse<
       33283  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33284  +
    > for crate::output::StreamingTraitsWithMediaTypeOutput
       33285  +
{
       33286  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       33287  +
        match crate::protocol_serde::shape_streaming_traits_with_media_type::ser_streaming_traits_with_media_type_http_response(self) {
       33288  +
                        Ok(response) => response,
       33289  +
                        Err(e) => {
       33290  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       33291  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       33292  +
                        }
       33293  +
                    }
       33294  +
    }
       33295  +
}
       33296  +
31934  33297   
#[allow(unreachable_code, unused_variables)]
31935         -
mod server_streaming_traits_test {
31936         -
    /// Serializes a blob in the HTTP payload
31937         -
    /// Test ID: RestJsonStreamingTraitsWithBlob
       33298  +
#[cfg(test)]
       33299  +
mod streaming_traits_with_media_type_test {
       33300  +
       33301  +
    /// Serializes a blob in the HTTP payload with a content-type
       33302  +
    /// Test ID: RestJsonStreamingTraitsWithMediaTypeWithBlob
31938  33303   
    #[::tokio::test]
31939         -
    async fn rest_json_streaming_traits_with_blob_request() {
       33304  +
    #[::tracing_test::traced_test]
       33305  +
    async fn rest_json_streaming_traits_with_media_type_with_blob_request() {
31940  33306   
        #[allow(unused_mut)]
31941  33307   
        let mut http_request = http::Request::builder()
31942         -
            .uri("/StreamingTraits")
       33308  +
            .uri("/StreamingTraitsWithMediaType")
31943  33309   
            .method("POST")
31944         -
            .header("Content-Type", "application/octet-stream")
       33310  +
            .header("Content-Type", "text/plain")
31945  33311   
            .header("X-Foo", "Foo")
31946  33312   
            .body(::aws_smithy_http_server::body::Body::from(
31947  33313   
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
31948  33314   
            ))
31949  33315   
            .unwrap();
31950  33316   
        #[allow(unused_mut)]
31951  33317   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
31952  33318   
        let config = crate::service::RestJsonConfig::builder().build();
31953  33319   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
31954         -
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
       33320  +
            .streaming_traits_with_media_type(
       33321  +
                move |input: crate::input::StreamingTraitsWithMediaTypeInput| {
31955  33322   
                    let sender = sender.clone();
31956  33323   
                    async move {
31957  33324   
                        let result = {
31958         -
                        let expected = crate::input::StreamingTraitsInput {
       33325  +
                            let expected = crate::input::StreamingTraitsWithMediaTypeInput {
31959  33326   
                                foo: ::std::option::Option::Some("Foo".to_owned()),
31960  33327   
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
31961  33328   
                                    b"blobby blob blob",
31962  33329   
                                ),
31963  33330   
                            };
31964  33331   
                            ::pretty_assertions::assert_eq!(
31965  33332   
                                input.foo,
31966  33333   
                                expected.foo,
31967  33334   
                                "Unexpected value for `foo`"
31968  33335   
                            );
31969  33336   
                            ::pretty_assertions::assert_eq!(
31970  33337   
                                input.blob.collect().await.unwrap().into_bytes(),
31971  33338   
                                expected.blob.collect().await.unwrap().into_bytes()
31972  33339   
                            );
31973         -
                        let response = crate::output::StreamingTraitsOutput {
       33340  +
                            let response = crate::output::StreamingTraitsWithMediaTypeOutput {
31974  33341   
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
31975  33342   
                                foo: ::std::option::Option::None,
31976  33343   
                            };
31977  33344   
                            response
31978  33345   
                        };
31979  33346   
                        sender.send(()).await.expect("receiver dropped early");
31980  33347   
                        result
31981  33348   
                    }
31982         -
            })
       33349  +
                },
       33350  +
            )
31983  33351   
            .build_unchecked();
31984  33352   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
31985  33353   
            .await
31986  33354   
            .expect("unable to make an HTTP request");
31987         -
        assert!(receiver.recv().await.is_some());
       33355  +
        assert!(
       33356  +
            receiver.recv().await.is_some(),
       33357  +
            "we expected operation handler to be invoked but it was not entered"
       33358  +
        );
31988  33359   
    }
31989         -
    /// Serializes an empty blob in the HTTP payload
31990         -
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
       33360  +
    /// Serializes a blob in the HTTP payload with a content-type
       33361  +
    /// Test ID: RestJsonStreamingTraitsWithMediaTypeWithBlob
31991  33362   
    #[::tokio::test]
31992         -
    async fn rest_json_streaming_traits_with_no_blob_body_request() {
31993         -
        #[allow(unused_mut)]
31994         -
        let mut http_request = http::Request::builder()
31995         -
            .uri("/StreamingTraits")
31996         -
            .method("POST")
31997         -
            .header("X-Foo", "Foo")
31998         -
            .body(::aws_smithy_http_server::body::Body::from(
31999         -
                ::bytes::Bytes::from_static("".as_bytes()),
32000         -
            ))
32001         -
            .unwrap();
32002         -
        #[allow(unused_mut)]
32003         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32004         -
        let config = crate::service::RestJsonConfig::builder().build();
32005         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32006         -
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
32007         -
                let sender = sender.clone();
32008         -
                async move {
32009         -
                    let result = {
32010         -
                        let expected = crate::input::StreamingTraitsInput {
32011         -
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
32012         -
                            foo: ::std::option::Option::Some("Foo".to_owned()),
32013         -
                        };
32014         -
                        ::pretty_assertions::assert_eq!(
32015         -
                            input.foo,
32016         -
                            expected.foo,
32017         -
                            "Unexpected value for `foo`"
32018         -
                        );
32019         -
                        ::pretty_assertions::assert_eq!(
32020         -
                            input.blob.collect().await.unwrap().into_bytes(),
32021         -
                            expected.blob.collect().await.unwrap().into_bytes()
32022         -
                        );
32023         -
                        let response = crate::output::StreamingTraitsOutput {
32024         -
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
32025         -
                            foo: ::std::option::Option::None,
32026         -
                        };
32027         -
                        response
32028         -
                    };
32029         -
                    sender.send(()).await.expect("receiver dropped early");
32030         -
                    result
32031         -
                }
32032         -
            })
32033         -
            .build_unchecked();
32034         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32035         -
            .await
32036         -
            .expect("unable to make an HTTP request");
32037         -
        assert!(receiver.recv().await.is_some());
32038         -
    }
32039         -
    /// Serializes a blob in the HTTP payload
32040         -
    /// Test ID: RestJsonStreamingTraitsWithBlob
32041         -
    #[::tokio::test]
32042         -
    async fn rest_json_streaming_traits_with_blob_response() {
32043         -
        let output = crate::output::StreamingTraitsOutput {
       33363  +
    #[::tracing_test::traced_test]
       33364  +
    async fn rest_json_streaming_traits_with_media_type_with_blob_response() {
       33365  +
        let output = crate::output::StreamingTraitsWithMediaTypeOutput {
32044  33366   
            foo: ::std::option::Option::Some("Foo".to_owned()),
32045  33367   
            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b"blobby blob blob"),
32046  33368   
        };
32047  33369   
        use ::aws_smithy_http_server::response::IntoResponse;
32048  33370   
        let http_response = output.into_response();
32049  33371   
        ::pretty_assertions::assert_eq!(
32050  33372   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32051  33373   
            http_response.status()
32052  33374   
        );
32053         -
        let expected_headers = [
32054         -
            ("Content-Type", "application/octet-stream"),
32055         -
            ("X-Foo", "Foo"),
32056         -
        ];
       33375  +
        let expected_headers = [("Content-Type", "text/plain"), ("X-Foo", "Foo")];
32057  33376   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
32058  33377   
            http_response.headers(),
32059  33378   
            expected_headers,
32060  33379   
        ));
32061  33380   
        let body = ::hyper::body::to_bytes(http_response.into_body())
32062  33381   
            .await
32063  33382   
            .expect("unable to extract body to bytes");
32064  33383   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
32065  33384   
            &body,
32066  33385   
            "blobby blob blob",
32067  33386   
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
32068  33387   
        ));
32069  33388   
    }
32070         -
    /// Serializes an empty blob in the HTTP payload
32071         -
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
32072         -
    #[::tokio::test]
32073         -
    async fn rest_json_streaming_traits_with_no_blob_body_response() {
32074         -
        let output = crate::output::StreamingTraitsOutput {
32075         -
            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
32076         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
       33389  +
}
       33390  +
       33391  +
const CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH: ::mime::Mime = ::mime::APPLICATION_JSON;
       33392  +
::pin_project_lite::pin_project! {
       33393  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       33394  +
    /// [`StreamingTraitsRequireLengthInput`](crate::input::StreamingTraitsRequireLengthInput) using modelled bindings.
       33395  +
    pub struct StreamingTraitsRequireLengthInputFuture {
       33396  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamingTraitsRequireLengthInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       33397  +
    }
       33398  +
}
       33399  +
       33400  +
impl std::future::Future for StreamingTraitsRequireLengthInputFuture {
       33401  +
    type Output = Result<
       33402  +
        crate::input::StreamingTraitsRequireLengthInput,
       33403  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       33404  +
    >;
       33405  +
       33406  +
    fn poll(
       33407  +
        self: std::pin::Pin<&mut Self>,
       33408  +
        cx: &mut std::task::Context<'_>,
       33409  +
    ) -> std::task::Poll<Self::Output> {
       33410  +
        let this = self.project();
       33411  +
        this.inner.as_mut().poll(cx)
       33412  +
    }
       33413  +
}
       33414  +
       33415  +
impl<B>
       33416  +
    ::aws_smithy_http_server::request::FromRequest<
       33417  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33418  +
        B,
       33419  +
    > for crate::input::StreamingTraitsRequireLengthInput
       33420  +
where
       33421  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       33422  +
    B: 'static,
       33423  +
       33424  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
       33425  +
    B::Data: Send,
       33426  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       33427  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       33428  +
{
       33429  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       33430  +
    type Future = StreamingTraitsRequireLengthInputFuture;
       33431  +
       33432  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       33433  +
        let fut = async move {
       33434  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       33435  +
                request.headers(),
       33436  +
                &CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH,
       33437  +
            ) {
       33438  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       33439  +
            }
       33440  +
            crate::protocol_serde::shape_streaming_traits_require_length::de_streaming_traits_require_length_http_request(request)
       33441  +
                            .await
       33442  +
                            .map_err(Into::into)
32077  33443   
        };
32078         -
        use ::aws_smithy_http_server::response::IntoResponse;
32079         -
        let http_response = output.into_response();
32080         -
        ::pretty_assertions::assert_eq!(
32081         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32082         -
            http_response.status()
       33444  +
        use ::futures_util::future::TryFutureExt;
       33445  +
        let fut = fut.map_err(
       33446  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       33447  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       33448  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       33449  +
                    e,
       33450  +
                )
       33451  +
            },
32083  33452   
        );
32084         -
        let expected_headers = [("X-Foo", "Foo")];
32085         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
32086         -
            http_response.headers(),
32087         -
            expected_headers,
32088         -
        ));
32089         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
32090         -
            .await
32091         -
            .expect("unable to extract body to bytes");
32092         -
        // No body.
32093         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       33453  +
        StreamingTraitsRequireLengthInputFuture {
       33454  +
            inner: Box::pin(fut),
       33455  +
        }
32094  33456   
    }
32095  33457   
}
32096         -
#[cfg(test)]
       33458  +
impl
       33459  +
    ::aws_smithy_http_server::response::IntoResponse<
       33460  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33461  +
    > for crate::output::StreamingTraitsRequireLengthOutput
       33462  +
{
       33463  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       33464  +
        match crate::protocol_serde::shape_streaming_traits_require_length::ser_streaming_traits_require_length_http_response(self) {
       33465  +
                        Ok(response) => response,
       33466  +
                        Err(e) => {
       33467  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       33468  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       33469  +
                        }
       33470  +
                    }
       33471  +
    }
       33472  +
}
       33473  +
32097  33474   
#[allow(unreachable_code, unused_variables)]
32098         -
mod server_streaming_traits_require_length_test {
       33475  +
#[cfg(test)]
       33476  +
mod streaming_traits_require_length_test {
       33477  +
32099  33478   
    /// Serializes a blob in the HTTP payload with a required length
32100  33479   
    /// Test ID: RestJsonStreamingTraitsRequireLengthWithBlob
32101  33480   
    #[::tokio::test]
       33481  +
    #[::tracing_test::traced_test]
32102  33482   
    async fn rest_json_streaming_traits_require_length_with_blob_request() {
32103  33483   
        #[allow(unused_mut)]
32104  33484   
        let mut http_request = http::Request::builder()
32105  33485   
            .uri("/StreamingTraitsRequireLength")
32106  33486   
            .method("POST")
32107  33487   
            .header("Content-Type", "application/octet-stream")
32108  33488   
            .header("X-Foo", "Foo")
32109  33489   
            .body(::aws_smithy_http_server::body::Body::from(
32110  33490   
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
32111  33491   
            ))
32112  33492   
            .unwrap();
32113  33493   
        #[allow(unused_mut)]
32114  33494   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32115  33495   
        let config = crate::service::RestJsonConfig::builder().build();
32116  33496   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32117  33497   
            .streaming_traits_require_length(
32118  33498   
                move |input: crate::input::StreamingTraitsRequireLengthInput| {
32119  33499   
                    let sender = sender.clone();
32120  33500   
                    async move {
32121  33501   
                        let result = {
32122  33502   
                            let expected = crate::input::StreamingTraitsRequireLengthInput {
32123  33503   
                                foo: ::std::option::Option::Some("Foo".to_owned()),
32124  33504   
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
32125  33505   
                                    b"blobby blob blob",
32126  33506   
                                ),
32127  33507   
                            };
32128  33508   
                            ::pretty_assertions::assert_eq!(
32129  33509   
                                input.foo,
32130  33510   
                                expected.foo,
32131  33511   
                                "Unexpected value for `foo`"
32132  33512   
                            );
32133  33513   
                            ::pretty_assertions::assert_eq!(
32134  33514   
                                input.blob.collect().await.unwrap().into_bytes(),
32135  33515   
                                expected.blob.collect().await.unwrap().into_bytes()
32136  33516   
                            );
32137  33517   
                            let response = crate::output::StreamingTraitsRequireLengthOutput {};
32138  33518   
                            response
32139  33519   
                        };
32140  33520   
                        sender.send(()).await.expect("receiver dropped early");
32141  33521   
                        result
32142  33522   
                    }
32143  33523   
                },
32144  33524   
            )
32145  33525   
            .build_unchecked();
32146  33526   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32147  33527   
            .await
32148  33528   
            .expect("unable to make an HTTP request");
32149         -
        assert!(receiver.recv().await.is_some());
       33529  +
        assert!(
       33530  +
            receiver.recv().await.is_some(),
       33531  +
            "we expected operation handler to be invoked but it was not entered"
       33532  +
        );
32150  33533   
    }
32151  33534   
    /// Serializes an empty blob in the HTTP payload
32152  33535   
    /// Test ID: RestJsonStreamingTraitsRequireLengthWithNoBlobBody
32153  33536   
    #[::tokio::test]
       33537  +
    #[::tracing_test::traced_test]
32154  33538   
    async fn rest_json_streaming_traits_require_length_with_no_blob_body_request() {
32155  33539   
        #[allow(unused_mut)]
32156  33540   
        let mut http_request = http::Request::builder()
32157  33541   
            .uri("/StreamingTraitsRequireLength")
32158  33542   
            .method("POST")
32159  33543   
            .header("X-Foo", "Foo")
32160  33544   
            .body(::aws_smithy_http_server::body::Body::from(
32161  33545   
                ::bytes::Bytes::from_static("".as_bytes()),
32162  33546   
            ))
32163  33547   
            .unwrap();
32164  33548   
        #[allow(unused_mut)]
32165  33549   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32166  33550   
        let config = crate::service::RestJsonConfig::builder().build();
32167  33551   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32168  33552   
            .streaming_traits_require_length(
32169  33553   
                move |input: crate::input::StreamingTraitsRequireLengthInput| {
32170  33554   
                    let sender = sender.clone();
32171  33555   
                    async move {
32172  33556   
                        let result = {
32173  33557   
                            let expected = crate::input::StreamingTraitsRequireLengthInput {
32174  33558   
                                blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
32175  33559   
                                foo: ::std::option::Option::Some("Foo".to_owned()),
32176  33560   
                            };
32177  33561   
                            ::pretty_assertions::assert_eq!(
32178  33562   
                                input.foo,
32179  33563   
                                expected.foo,
32180  33564   
                                "Unexpected value for `foo`"
32181  33565   
                            );
32182  33566   
                            ::pretty_assertions::assert_eq!(
32183  33567   
                                input.blob.collect().await.unwrap().into_bytes(),
32184  33568   
                                expected.blob.collect().await.unwrap().into_bytes()
32185  33569   
                            );
32186  33570   
                            let response = crate::output::StreamingTraitsRequireLengthOutput {};
32187  33571   
                            response
32188  33572   
                        };
32189  33573   
                        sender.send(()).await.expect("receiver dropped early");
32190  33574   
                        result
32191  33575   
                    }
32192  33576   
                },
32193  33577   
            )
32194  33578   
            .build_unchecked();
32195  33579   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32196  33580   
            .await
32197  33581   
            .expect("unable to make an HTTP request");
32198         -
        assert!(receiver.recv().await.is_some());
       33582  +
        assert!(
       33583  +
            receiver.recv().await.is_some(),
       33584  +
            "we expected operation handler to be invoked but it was not entered"
       33585  +
        );
32199  33586   
    }
32200  33587   
}
32201         -
#[cfg(test)]
       33588  +
       33589  +
const CONTENT_TYPE_STREAMINGTRAITS: ::mime::Mime = ::mime::APPLICATION_OCTET_STREAM;
       33590  +
::pin_project_lite::pin_project! {
       33591  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       33592  +
    /// [`StreamingTraitsInput`](crate::input::StreamingTraitsInput) using modelled bindings.
       33593  +
    pub struct StreamingTraitsInputFuture {
       33594  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamingTraitsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       33595  +
    }
       33596  +
}
       33597  +
       33598  +
impl std::future::Future for StreamingTraitsInputFuture {
       33599  +
    type Output = Result<
       33600  +
        crate::input::StreamingTraitsInput,
       33601  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       33602  +
    >;
       33603  +
       33604  +
    fn poll(
       33605  +
        self: std::pin::Pin<&mut Self>,
       33606  +
        cx: &mut std::task::Context<'_>,
       33607  +
    ) -> std::task::Poll<Self::Output> {
       33608  +
        let this = self.project();
       33609  +
        this.inner.as_mut().poll(cx)
       33610  +
    }
       33611  +
}
       33612  +
       33613  +
impl<B>
       33614  +
    ::aws_smithy_http_server::request::FromRequest<
       33615  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33616  +
        B,
       33617  +
    > for crate::input::StreamingTraitsInput
       33618  +
where
       33619  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       33620  +
    B: 'static,
       33621  +
       33622  +
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
       33623  +
    B::Data: Send,
       33624  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       33625  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       33626  +
{
       33627  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       33628  +
    type Future = StreamingTraitsInputFuture;
       33629  +
       33630  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       33631  +
        let fut = async move {
       33632  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       33633  +
                request.headers(),
       33634  +
                &CONTENT_TYPE_STREAMINGTRAITS,
       33635  +
            ) {
       33636  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       33637  +
            }
       33638  +
            crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_request(request)
       33639  +
                .await
       33640  +
                .map_err(Into::into)
       33641  +
        };
       33642  +
        use ::futures_util::future::TryFutureExt;
       33643  +
        let fut = fut.map_err(
       33644  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       33645  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       33646  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       33647  +
                    e,
       33648  +
                )
       33649  +
            },
       33650  +
        );
       33651  +
        StreamingTraitsInputFuture {
       33652  +
            inner: Box::pin(fut),
       33653  +
        }
       33654  +
    }
       33655  +
}
       33656  +
impl
       33657  +
    ::aws_smithy_http_server::response::IntoResponse<
       33658  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33659  +
    > for crate::output::StreamingTraitsOutput
       33660  +
{
       33661  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       33662  +
        match crate::protocol_serde::shape_streaming_traits::ser_streaming_traits_http_response(
       33663  +
            self,
       33664  +
        ) {
       33665  +
            Ok(response) => response,
       33666  +
            Err(e) => {
       33667  +
                ::tracing::error!(error = %e, "failed to serialize response");
       33668  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       33669  +
            }
       33670  +
        }
       33671  +
    }
       33672  +
}
       33673  +
32202  33674   
#[allow(unreachable_code, unused_variables)]
32203         -
mod server_streaming_traits_with_media_type_test {
32204         -
    /// Serializes a blob in the HTTP payload with a content-type
32205         -
    /// Test ID: RestJsonStreamingTraitsWithMediaTypeWithBlob
       33675  +
#[cfg(test)]
       33676  +
mod streaming_traits_test {
       33677  +
       33678  +
    /// Serializes a blob in the HTTP payload
       33679  +
    /// Test ID: RestJsonStreamingTraitsWithBlob
32206  33680   
    #[::tokio::test]
32207         -
    async fn rest_json_streaming_traits_with_media_type_with_blob_request() {
       33681  +
    #[::tracing_test::traced_test]
       33682  +
    async fn rest_json_streaming_traits_with_blob_request() {
32208  33683   
        #[allow(unused_mut)]
32209  33684   
        let mut http_request = http::Request::builder()
32210         -
            .uri("/StreamingTraitsWithMediaType")
       33685  +
            .uri("/StreamingTraits")
32211  33686   
            .method("POST")
32212         -
            .header("Content-Type", "text/plain")
       33687  +
            .header("Content-Type", "application/octet-stream")
32213  33688   
            .header("X-Foo", "Foo")
32214  33689   
            .body(::aws_smithy_http_server::body::Body::from(
32215  33690   
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
32216  33691   
            ))
32217  33692   
            .unwrap();
32218  33693   
        #[allow(unused_mut)]
32219  33694   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32220  33695   
        let config = crate::service::RestJsonConfig::builder().build();
32221  33696   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32222         -
            .streaming_traits_with_media_type(
32223         -
                move |input: crate::input::StreamingTraitsWithMediaTypeInput| {
       33697  +
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
32224  33698   
                let sender = sender.clone();
32225  33699   
                async move {
32226  33700   
                    let result = {
32227         -
                            let expected = crate::input::StreamingTraitsWithMediaTypeInput {
       33701  +
                        let expected = crate::input::StreamingTraitsInput {
32228  33702   
                            foo: ::std::option::Option::Some("Foo".to_owned()),
32229  33703   
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(
32230  33704   
                                b"blobby blob blob",
32231  33705   
                            ),
32232  33706   
                        };
32233  33707   
                        ::pretty_assertions::assert_eq!(
32234  33708   
                            input.foo,
32235  33709   
                            expected.foo,
32236  33710   
                            "Unexpected value for `foo`"
32237  33711   
                        );
32238  33712   
                        ::pretty_assertions::assert_eq!(
32239  33713   
                            input.blob.collect().await.unwrap().into_bytes(),
32240  33714   
                            expected.blob.collect().await.unwrap().into_bytes()
32241  33715   
                        );
32242         -
                            let response = crate::output::StreamingTraitsWithMediaTypeOutput {
       33716  +
                        let response = crate::output::StreamingTraitsOutput {
32243  33717   
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
32244  33718   
                            foo: ::std::option::Option::None,
32245  33719   
                        };
32246  33720   
                        response
32247  33721   
                    };
32248  33722   
                    sender.send(()).await.expect("receiver dropped early");
32249  33723   
                    result
32250  33724   
                }
32251         -
                },
32252         -
            )
       33725  +
            })
32253  33726   
            .build_unchecked();
32254  33727   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32255  33728   
            .await
32256  33729   
            .expect("unable to make an HTTP request");
32257         -
        assert!(receiver.recv().await.is_some());
32258         -
    }
32259         -
    /// Serializes a blob in the HTTP payload with a content-type
32260         -
    /// Test ID: RestJsonStreamingTraitsWithMediaTypeWithBlob
32261         -
    #[::tokio::test]
32262         -
    async fn rest_json_streaming_traits_with_media_type_with_blob_response() {
32263         -
        let output = crate::output::StreamingTraitsWithMediaTypeOutput {
32264         -
            foo: ::std::option::Option::Some("Foo".to_owned()),
32265         -
            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b"blobby blob blob"),
32266         -
        };
32267         -
        use ::aws_smithy_http_server::response::IntoResponse;
32268         -
        let http_response = output.into_response();
32269         -
        ::pretty_assertions::assert_eq!(
32270         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32271         -
            http_response.status()
       33730  +
        assert!(
       33731  +
            receiver.recv().await.is_some(),
       33732  +
            "we expected operation handler to be invoked but it was not entered"
32272  33733   
        );
32273         -
        let expected_headers = [("Content-Type", "text/plain"), ("X-Foo", "Foo")];
32274         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
32275         -
            http_response.headers(),
32276         -
            expected_headers,
32277         -
        ));
32278         -
        let body = ::hyper::body::to_bytes(http_response.into_body())
32279         -
            .await
32280         -
            .expect("unable to extract body to bytes");
32281         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
32282         -
            &body,
32283         -
            "blobby blob blob",
32284         -
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
32285         -
        ));
32286  33734   
    }
32287         -
}
32288         -
#[cfg(test)]
32289         -
#[allow(unreachable_code, unused_variables)]
32290         -
mod server_test_body_structure_test {
32291         -
    /// Serializes a structure
32292         -
    /// Test ID: RestJsonTestBodyStructure
       33735  +
    /// Serializes an empty blob in the HTTP payload
       33736  +
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
32293  33737   
    #[::tokio::test]
32294         -
    async fn rest_json_test_body_structure_request() {
       33738  +
    #[::tracing_test::traced_test]
       33739  +
    async fn rest_json_streaming_traits_with_no_blob_body_request() {
32295  33740   
        #[allow(unused_mut)]
32296  33741   
        let mut http_request = http::Request::builder()
32297         -
            .uri("/body")
       33742  +
            .uri("/StreamingTraits")
32298  33743   
            .method("POST")
32299         -
            .header("Content-Type", "application/json")
       33744  +
            .header("X-Foo", "Foo")
32300  33745   
            .body(::aws_smithy_http_server::body::Body::from(
32301         -
                ::bytes::Bytes::from_static(
32302         -
                    "{\"testConfig\":\n    {\"timeout\": 10}\n}".as_bytes(),
32303         -
                ),
       33746  +
                ::bytes::Bytes::from_static("".as_bytes()),
32304  33747   
            ))
32305  33748   
            .unwrap();
32306  33749   
        #[allow(unused_mut)]
32307  33750   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32308  33751   
        let config = crate::service::RestJsonConfig::builder().build();
32309  33752   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32310         -
            .test_body_structure(move |input: crate::input::TestBodyStructureInput| {
       33753  +
            .streaming_traits(move |input: crate::input::StreamingTraitsInput| {
32311  33754   
                let sender = sender.clone();
32312  33755   
                async move {
32313  33756   
                    let result = {
32314         -
                        let expected = crate::input::TestBodyStructureInput {
32315         -
                            test_config: ::std::option::Option::Some(crate::model::TestConfig {
32316         -
                                timeout: ::std::option::Option::Some(10),
32317         -
                            }),
32318         -
                            test_id: ::std::option::Option::None,
       33757  +
                        let expected = crate::input::StreamingTraitsInput {
       33758  +
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
       33759  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
32319  33760   
                        };
32320         -
                        ::pretty_assertions::assert_eq!(input, expected);
32321         -
                        let response = crate::output::TestBodyStructureOutput {
32322         -
                            test_id: ::std::option::Option::None,
32323         -
                            test_config: ::std::option::Option::None,
       33761  +
                        ::pretty_assertions::assert_eq!(
       33762  +
                            input.foo,
       33763  +
                            expected.foo,
       33764  +
                            "Unexpected value for `foo`"
       33765  +
                        );
       33766  +
                        ::pretty_assertions::assert_eq!(
       33767  +
                            input.blob.collect().await.unwrap().into_bytes(),
       33768  +
                            expected.blob.collect().await.unwrap().into_bytes()
       33769  +
                        );
       33770  +
                        let response = crate::output::StreamingTraitsOutput {
       33771  +
                            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
       33772  +
                            foo: ::std::option::Option::None,
32324  33773   
                        };
32325  33774   
                        response
32326  33775   
                    };
32327  33776   
                    sender.send(()).await.expect("receiver dropped early");
32328  33777   
                    result
32329  33778   
                }
32330  33779   
            })
32331  33780   
            .build_unchecked();
32332  33781   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32333  33782   
            .await
32334  33783   
            .expect("unable to make an HTTP request");
32335         -
        assert!(receiver.recv().await.is_some());
       33784  +
        assert!(
       33785  +
            receiver.recv().await.is_some(),
       33786  +
            "we expected operation handler to be invoked but it was not entered"
       33787  +
        );
32336  33788   
    }
32337         -
    /// Serializes an empty structure in the body
32338         -
    /// Test ID: RestJsonHttpWithEmptyBody
       33789  +
    /// Serializes a blob in the HTTP payload
       33790  +
    /// Test ID: RestJsonStreamingTraitsWithBlob
32339  33791   
    #[::tokio::test]
32340         -
    async fn rest_json_http_with_empty_body_request() {
32341         -
        #[allow(unused_mut)]
32342         -
        let mut http_request = http::Request::builder()
32343         -
            .uri("/body")
32344         -
            .method("POST")
32345         -
            .header("Content-Type", "application/json")
32346         -
            .body(::aws_smithy_http_server::body::Body::from(
32347         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
32348         -
            ))
32349         -
            .unwrap();
32350         -
        #[allow(unused_mut)]
32351         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32352         -
        let config = crate::service::RestJsonConfig::builder().build();
32353         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32354         -
            .test_body_structure(move |input: crate::input::TestBodyStructureInput| {
32355         -
                let sender = sender.clone();
32356         -
                async move {
32357         -
                    let result = {
32358         -
                        let expected = crate::input::TestBodyStructureInput {
32359         -
                            test_id: ::std::option::Option::None,
32360         -
                            test_config: ::std::option::Option::None,
32361         -
                        };
32362         -
                        ::pretty_assertions::assert_eq!(input, expected);
32363         -
                        let response = crate::output::TestBodyStructureOutput {
32364         -
                            test_id: ::std::option::Option::None,
32365         -
                            test_config: ::std::option::Option::None,
32366         -
                        };
32367         -
                        response
       33792  +
    #[::tracing_test::traced_test]
       33793  +
    async fn rest_json_streaming_traits_with_blob_response() {
       33794  +
        let output = crate::output::StreamingTraitsOutput {
       33795  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
       33796  +
            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b"blobby blob blob"),
32368  33797   
        };
32369         -
                    sender.send(()).await.expect("receiver dropped early");
32370         -
                    result
32371         -
                }
32372         -
            })
32373         -
            .build_unchecked();
32374         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33798  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33799  +
        let http_response = output.into_response();
       33800  +
        ::pretty_assertions::assert_eq!(
       33801  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       33802  +
            http_response.status()
       33803  +
        );
       33804  +
        let expected_headers = [
       33805  +
            ("Content-Type", "application/octet-stream"),
       33806  +
            ("X-Foo", "Foo"),
       33807  +
        ];
       33808  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33809  +
            http_response.headers(),
       33810  +
            expected_headers,
       33811  +
        ));
       33812  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
32375  33813   
            .await
32376         -
            .expect("unable to make an HTTP request");
32377         -
        assert!(receiver.recv().await.is_some());
       33814  +
            .expect("unable to extract body to bytes");
       33815  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       33816  +
            &body,
       33817  +
            "blobby blob blob",
       33818  +
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
       33819  +
        ));
32378  33820   
    }
32379         -
}
32380         -
#[cfg(test)]
32381         -
#[allow(unreachable_code, unused_variables)]
32382         -
mod server_test_no_payload_test {
32383         -
    /// Serializes a GET request with no modeled body
32384         -
    /// Test ID: RestJsonHttpWithNoModeledBody
       33821  +
    /// Serializes an empty blob in the HTTP payload
       33822  +
    /// Test ID: RestJsonStreamingTraitsWithNoBlobBody
32385  33823   
    #[::tokio::test]
32386         -
    async fn rest_json_http_with_no_modeled_body_request() {
32387         -
        #[allow(unused_mut)]
32388         -
        let mut http_request = http::Request::builder()
32389         -
            .uri("/no_payload")
32390         -
            .method("GET")
32391         -
            .body(::aws_smithy_http_server::body::Body::from(
32392         -
                ::bytes::Bytes::from_static("".as_bytes()),
32393         -
            ))
32394         -
            .unwrap();
32395         -
        #[allow(unused_mut)]
32396         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32397         -
        let config = crate::service::RestJsonConfig::builder().build();
32398         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32399         -
            .test_no_payload(move |input: crate::input::TestNoPayloadInput| {
32400         -
                let sender = sender.clone();
32401         -
                async move {
32402         -
                    let result = {
32403         -
                        let expected = crate::input::TestNoPayloadInput {
32404         -
                            test_id: ::std::option::Option::None,
32405         -
                        };
32406         -
                        ::pretty_assertions::assert_eq!(input, expected);
32407         -
                        let response = crate::output::TestNoPayloadOutput {
32408         -
                            test_id: ::std::option::Option::None,
32409         -
                        };
32410         -
                        response
       33824  +
    #[::tracing_test::traced_test]
       33825  +
    async fn rest_json_streaming_traits_with_no_blob_body_response() {
       33826  +
        let output = crate::output::StreamingTraitsOutput {
       33827  +
            blob: ::aws_smithy_types::byte_stream::ByteStream::from_static(b""),
       33828  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
32411  33829   
        };
32412         -
                    sender.send(()).await.expect("receiver dropped early");
32413         -
                    result
32414         -
                }
32415         -
            })
32416         -
            .build_unchecked();
32417         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       33830  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33831  +
        let http_response = output.into_response();
       33832  +
        ::pretty_assertions::assert_eq!(
       33833  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       33834  +
            http_response.status()
       33835  +
        );
       33836  +
        let expected_headers = [("X-Foo", "Foo")];
       33837  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33838  +
            http_response.headers(),
       33839  +
            expected_headers,
       33840  +
        ));
       33841  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
32418  33842   
            .await
32419         -
            .expect("unable to make an HTTP request");
32420         -
        assert!(receiver.recv().await.is_some());
32421         -
    }
32422         -
    /// Serializes a GET request with header member but no modeled body
32423         -
    /// Test ID: RestJsonHttpWithHeaderMemberNoModeledBody
32424         -
    #[::tokio::test]
32425         -
    async fn rest_json_http_with_header_member_no_modeled_body_request() {
32426         -
        #[allow(unused_mut)]
32427         -
        let mut http_request = http::Request::builder()
32428         -
            .uri("/no_payload")
32429         -
            .method("GET")
32430         -
            .header("X-Amz-Test-Id", "t-12345")
32431         -
            .body(::aws_smithy_http_server::body::Body::from(
32432         -
                ::bytes::Bytes::from_static("".as_bytes()),
32433         -
            ))
32434         -
            .unwrap();
32435         -
        #[allow(unused_mut)]
32436         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32437         -
        let config = crate::service::RestJsonConfig::builder().build();
32438         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32439         -
            .test_no_payload(move |input: crate::input::TestNoPayloadInput| {
32440         -
                let sender = sender.clone();
32441         -
                async move {
32442         -
                    let result = {
32443         -
                        let expected = crate::input::TestNoPayloadInput {
32444         -
                            test_id: ::std::option::Option::Some("t-12345".to_owned()),
32445         -
                        };
32446         -
                        ::pretty_assertions::assert_eq!(input, expected);
32447         -
                        let response = crate::output::TestNoPayloadOutput {
32448         -
                            test_id: ::std::option::Option::None,
32449         -
                        };
32450         -
                        response
32451         -
                    };
32452         -
                    sender.send(()).await.expect("receiver dropped early");
32453         -
                    result
       33843  +
            .expect("unable to extract body to bytes");
       33844  +
        // No body.
       33845  +
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
32454  33846   
    }
32455         -
            })
32456         -
            .build_unchecked();
32457         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32458         -
            .await
32459         -
            .expect("unable to make an HTTP request");
32460         -
        assert!(receiver.recv().await.is_some());
       33847  +
}
       33848  +
       33849  +
const CONTENT_TYPE_HTTPRESPONSECODE: ::mime::Mime = ::mime::APPLICATION_JSON;
       33850  +
::pin_project_lite::pin_project! {
       33851  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       33852  +
    /// [`HttpResponseCodeInput`](crate::input::HttpResponseCodeInput) using modelled bindings.
       33853  +
    pub struct HttpResponseCodeInputFuture {
       33854  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpResponseCodeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
32461  33855   
    }
32462  33856   
}
32463         -
#[cfg(test)]
32464         -
#[allow(unreachable_code, unused_variables)]
32465         -
mod server_test_payload_blob_test {
32466         -
    /// Serializes a payload targeting an empty blob
32467         -
    /// Test ID: RestJsonHttpWithEmptyBlobPayload
32468         -
    #[::tokio::test]
32469         -
    async fn rest_json_http_with_empty_blob_payload_request() {
32470         -
        #[allow(unused_mut)]
32471         -
        let mut http_request = http::Request::builder()
32472         -
            .uri("/blob_payload")
32473         -
            .method("POST")
32474         -
            .header("Content-Type", "application/octet-stream")
32475         -
            .body(::aws_smithy_http_server::body::Body::from(
32476         -
                ::bytes::Bytes::from_static("".as_bytes()),
32477         -
            ))
32478         -
            .unwrap();
32479         -
        #[allow(unused_mut)]
32480         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32481         -
        let config = crate::service::RestJsonConfig::builder().build();
32482         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32483         -
            .test_payload_blob(move |input: crate::input::TestPayloadBlobInput| {
32484         -
                let sender = sender.clone();
32485         -
                async move {
32486         -
                    let result = {
32487         -
                        let expected = crate::input::TestPayloadBlobInput {
32488         -
                            content_type: ::std::option::Option::Some(
32489         -
                                "application/octet-stream".to_owned(),
32490         -
                            ),
32491         -
                            data: ::std::option::Option::None,
       33857  +
       33858  +
impl std::future::Future for HttpResponseCodeInputFuture {
       33859  +
    type Output = Result<
       33860  +
        crate::input::HttpResponseCodeInput,
       33861  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       33862  +
    >;
       33863  +
       33864  +
    fn poll(
       33865  +
        self: std::pin::Pin<&mut Self>,
       33866  +
        cx: &mut std::task::Context<'_>,
       33867  +
    ) -> std::task::Poll<Self::Output> {
       33868  +
        let this = self.project();
       33869  +
        this.inner.as_mut().poll(cx)
       33870  +
    }
       33871  +
}
       33872  +
       33873  +
impl<B>
       33874  +
    ::aws_smithy_http_server::request::FromRequest<
       33875  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33876  +
        B,
       33877  +
    > for crate::input::HttpResponseCodeInput
       33878  +
where
       33879  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       33880  +
    B: 'static,
       33881  +
       33882  +
    B::Data: Send,
       33883  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       33884  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       33885  +
{
       33886  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       33887  +
    type Future = HttpResponseCodeInputFuture;
       33888  +
       33889  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       33890  +
        let fut = async move {
       33891  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       33892  +
                request.headers(),
       33893  +
                &CONTENT_TYPE_HTTPRESPONSECODE,
       33894  +
            ) {
       33895  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       33896  +
            }
       33897  +
            crate::protocol_serde::shape_http_response_code::de_http_response_code_http_request(
       33898  +
                request,
       33899  +
            )
       33900  +
            .await
       33901  +
            .map_err(Into::into)
32492  33902   
        };
32493         -
                        ::pretty_assertions::assert_eq!(input, expected);
32494         -
                        let response = crate::output::TestPayloadBlobOutput {
32495         -
                            content_type: ::std::option::Option::None,
32496         -
                            data: ::std::option::Option::None,
       33903  +
        use ::futures_util::future::TryFutureExt;
       33904  +
        let fut = fut.map_err(
       33905  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       33906  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       33907  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       33908  +
                    e,
       33909  +
                )
       33910  +
            },
       33911  +
        );
       33912  +
        HttpResponseCodeInputFuture {
       33913  +
            inner: Box::pin(fut),
       33914  +
        }
       33915  +
    }
       33916  +
}
       33917  +
impl
       33918  +
    ::aws_smithy_http_server::response::IntoResponse<
       33919  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       33920  +
    > for crate::output::HttpResponseCodeOutput
       33921  +
{
       33922  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       33923  +
        match crate::protocol_serde::shape_http_response_code::ser_http_response_code_http_response(
       33924  +
            self,
       33925  +
        ) {
       33926  +
            Ok(response) => response,
       33927  +
            Err(e) => {
       33928  +
                ::tracing::error!(error = %e, "failed to serialize response");
       33929  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       33930  +
            }
       33931  +
        }
       33932  +
    }
       33933  +
}
       33934  +
       33935  +
#[allow(unreachable_code, unused_variables)]
       33936  +
#[cfg(test)]
       33937  +
mod http_response_code_test {
       33938  +
       33939  +
    /// Binds the http response code to an output structure. Note that
       33940  +
    /// even though all members are bound outside of the payload, an
       33941  +
    /// empty JSON object is serialized in the response. However,
       33942  +
    /// clients should be able to handle an empty JSON object or an
       33943  +
    /// empty payload without failing to deserialize a response.
       33944  +
    /// Test ID: RestJsonHttpResponseCode
       33945  +
    #[::tokio::test]
       33946  +
    #[::tracing_test::traced_test]
       33947  +
    async fn rest_json_http_response_code_response() {
       33948  +
        let output = crate::output::HttpResponseCodeOutput {
       33949  +
            status: ::std::option::Option::Some(201),
32497  33950   
        };
32498         -
                        response
       33951  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33952  +
        let http_response = output.into_response();
       33953  +
        ::pretty_assertions::assert_eq!(
       33954  +
            http::StatusCode::from_u16(201).expect("invalid expected HTTP status code"),
       33955  +
            http_response.status()
       33956  +
        );
       33957  +
        let expected_headers = [("Content-Type", "application/json")];
       33958  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33959  +
            http_response.headers(),
       33960  +
            expected_headers,
       33961  +
        ));
       33962  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       33963  +
            .await
       33964  +
            .expect("unable to extract body to bytes");
       33965  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       33966  +
            &body,
       33967  +
            "{}",
       33968  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       33969  +
        ));
       33970  +
    }
       33971  +
    /// Binds the http response code to the http trait's code if the
       33972  +
    /// code isn't explicitly set. A client would be parsing the
       33973  +
    /// http response code, so this would always be present, but
       33974  +
    /// a server doesn't require it to be set to serialize a request.
       33975  +
    /// Test ID: RestJsonHttpResponseCodeDefaultsToModeledCode
       33976  +
    #[::tokio::test]
       33977  +
    #[::tracing_test::traced_test]
       33978  +
    async fn rest_json_http_response_code_defaults_to_modeled_code_response() {
       33979  +
        let output = crate::output::HttpResponseCodeOutput {
       33980  +
            status: ::std::option::Option::None,
32499  33981   
        };
32500         -
                    sender.send(()).await.expect("receiver dropped early");
32501         -
                    result
       33982  +
        use ::aws_smithy_http_server::response::IntoResponse;
       33983  +
        let http_response = output.into_response();
       33984  +
        ::pretty_assertions::assert_eq!(
       33985  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       33986  +
            http_response.status()
       33987  +
        );
       33988  +
        let expected_headers = [("Content-Type", "application/json")];
       33989  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       33990  +
            http_response.headers(),
       33991  +
            expected_headers,
       33992  +
        ));
       33993  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       33994  +
            .await
       33995  +
            .expect("unable to extract body to bytes");
       33996  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       33997  +
            &body,
       33998  +
            "{}",
       33999  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       34000  +
        ));
32502  34001   
    }
32503         -
            })
32504         -
            .build_unchecked();
32505         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       34002  +
}
       34003  +
       34004  +
const CONTENT_TYPE_HTTPPAYLOADWITHUNION: ::mime::Mime = ::mime::APPLICATION_JSON;
       34005  +
::pin_project_lite::pin_project! {
       34006  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       34007  +
    /// [`HttpPayloadWithUnionInput`](crate::input::HttpPayloadWithUnionInput) using modelled bindings.
       34008  +
    pub struct HttpPayloadWithUnionInputFuture {
       34009  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadWithUnionInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       34010  +
    }
       34011  +
}
       34012  +
       34013  +
impl std::future::Future for HttpPayloadWithUnionInputFuture {
       34014  +
    type Output = Result<
       34015  +
        crate::input::HttpPayloadWithUnionInput,
       34016  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       34017  +
    >;
       34018  +
       34019  +
    fn poll(
       34020  +
        self: std::pin::Pin<&mut Self>,
       34021  +
        cx: &mut std::task::Context<'_>,
       34022  +
    ) -> std::task::Poll<Self::Output> {
       34023  +
        let this = self.project();
       34024  +
        this.inner.as_mut().poll(cx)
       34025  +
    }
       34026  +
}
       34027  +
       34028  +
impl<B>
       34029  +
    ::aws_smithy_http_server::request::FromRequest<
       34030  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       34031  +
        B,
       34032  +
    > for crate::input::HttpPayloadWithUnionInput
       34033  +
where
       34034  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       34035  +
    B: 'static,
       34036  +
       34037  +
    B::Data: Send,
       34038  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       34039  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       34040  +
{
       34041  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       34042  +
    type Future = HttpPayloadWithUnionInputFuture;
       34043  +
       34044  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       34045  +
        let fut = async move {
       34046  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       34047  +
                request.headers(),
       34048  +
                &CONTENT_TYPE_HTTPPAYLOADWITHUNION,
       34049  +
            ) {
       34050  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       34051  +
            }
       34052  +
            crate::protocol_serde::shape_http_payload_with_union::de_http_payload_with_union_http_request(request)
32506  34053   
                            .await
32507         -
            .expect("unable to make an HTTP request");
32508         -
        assert!(receiver.recv().await.is_some());
       34054  +
                            .map_err(Into::into)
       34055  +
        };
       34056  +
        use ::futures_util::future::TryFutureExt;
       34057  +
        let fut = fut.map_err(
       34058  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       34059  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       34060  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       34061  +
                    e,
       34062  +
                )
       34063  +
            },
       34064  +
        );
       34065  +
        HttpPayloadWithUnionInputFuture {
       34066  +
            inner: Box::pin(fut),
32509  34067   
        }
32510         -
    /// Serializes a payload targeting a blob
32511         -
    /// Test ID: RestJsonTestPayloadBlob
       34068  +
    }
       34069  +
}
       34070  +
impl
       34071  +
    ::aws_smithy_http_server::response::IntoResponse<
       34072  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       34073  +
    > for crate::output::HttpPayloadWithUnionOutput
       34074  +
{
       34075  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       34076  +
        match crate::protocol_serde::shape_http_payload_with_union::ser_http_payload_with_union_http_response(self) {
       34077  +
                        Ok(response) => response,
       34078  +
                        Err(e) => {
       34079  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       34080  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       34081  +
                        }
       34082  +
                    }
       34083  +
    }
       34084  +
}
       34085  +
       34086  +
#[allow(unreachable_code, unused_variables)]
       34087  +
#[cfg(test)]
       34088  +
mod http_payload_with_union_test {
       34089  +
       34090  +
    /// Serializes a union in the payload.
       34091  +
    /// Test ID: RestJsonHttpPayloadWithUnion
32512  34092   
    #[::tokio::test]
32513         -
    async fn rest_json_test_payload_blob_request() {
       34093  +
    #[::tracing_test::traced_test]
       34094  +
    async fn rest_json_http_payload_with_union_request() {
32514  34095   
        #[allow(unused_mut)]
32515  34096   
        let mut http_request = http::Request::builder()
32516         -
            .uri("/blob_payload")
32517         -
            .method("POST")
32518         -
            .header("Content-Type", "image/jpg")
       34097  +
            .uri("/HttpPayloadWithUnion")
       34098  +
            .method("PUT")
       34099  +
            .header("Content-Type", "application/json")
32519  34100   
            .body(::aws_smithy_http_server::body::Body::from(
32520         -
                ::bytes::Bytes::from_static("1234".as_bytes()),
       34101  +
                ::bytes::Bytes::from_static("{\n    \"greeting\": \"hello\"\n}".as_bytes()),
32521  34102   
            ))
32522  34103   
            .unwrap();
32523  34104   
        #[allow(unused_mut)]
32524  34105   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32525  34106   
        let config = crate::service::RestJsonConfig::builder().build();
32526  34107   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32527         -
            .test_payload_blob(move |input: crate::input::TestPayloadBlobInput| {
       34108  +
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
32528  34109   
                let sender = sender.clone();
32529  34110   
                async move {
32530  34111   
                    let result = {
32531         -
                        let expected = crate::input::TestPayloadBlobInput {
32532         -
                            content_type: ::std::option::Option::Some("image/jpg".to_owned()),
32533         -
                            data: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
32534         -
                                "1234",
32535         -
                            )),
       34112  +
                        let expected = crate::input::HttpPayloadWithUnionInput {
       34113  +
                            nested: ::std::option::Option::Some(
       34114  +
                                crate::model::UnionPayload::Greeting("hello".to_owned()),
       34115  +
                            ),
32536  34116   
                        };
32537  34117   
                        ::pretty_assertions::assert_eq!(input, expected);
32538         -
                        let response = crate::output::TestPayloadBlobOutput {
32539         -
                            content_type: ::std::option::Option::None,
32540         -
                            data: ::std::option::Option::None,
       34118  +
                        let response = crate::output::HttpPayloadWithUnionOutput {
       34119  +
                            nested: ::std::option::Option::None,
32541  34120   
                        };
32542  34121   
                        response
32543  34122   
                    };
32544  34123   
                    sender.send(()).await.expect("receiver dropped early");
32545  34124   
                    result
32546  34125   
                }
32547  34126   
            })
32548  34127   
            .build_unchecked();
32549  34128   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32550  34129   
            .await
32551  34130   
            .expect("unable to make an HTTP request");
32552         -
        assert!(receiver.recv().await.is_some());
       34131  +
        assert!(
       34132  +
            receiver.recv().await.is_some(),
       34133  +
            "we expected operation handler to be invoked but it was not entered"
       34134  +
        );
32553  34135   
    }
32554         -
}
32555         -
#[cfg(test)]
32556         -
#[allow(unreachable_code, unused_variables)]
32557         -
mod server_test_payload_structure_test {
32558         -
    /// Serializes a payload targeting an empty structure
32559         -
    /// Test ID: RestJsonHttpWithEmptyStructurePayload
       34136  +
    /// No payload is sent if the union has no value.
       34137  +
    /// Test ID: RestJsonHttpPayloadWithUnsetUnion
32560  34138   
    #[::tokio::test]
32561         -
    async fn rest_json_http_with_empty_structure_payload_request() {
       34139  +
    #[::tracing_test::traced_test]
       34140  +
    async fn rest_json_http_payload_with_unset_union_request() {
32562  34141   
        #[allow(unused_mut)]
32563  34142   
        let mut http_request = http::Request::builder()
32564         -
            .uri("/payload")
32565         -
            .method("POST")
32566         -
            .header("Content-Type", "application/json")
       34143  +
            .uri("/HttpPayloadWithUnion")
       34144  +
            .method("PUT")
32567  34145   
            .body(::aws_smithy_http_server::body::Body::from(
32568         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
       34146  +
                ::bytes::Bytes::from_static("".as_bytes()),
32569  34147   
            ))
32570  34148   
            .unwrap();
32571  34149   
        #[allow(unused_mut)]
32572  34150   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32573  34151   
        let config = crate::service::RestJsonConfig::builder().build();
32574  34152   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32575         -
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
       34153  +
            .http_payload_with_union(move |input: crate::input::HttpPayloadWithUnionInput| {
32576  34154   
                let sender = sender.clone();
32577  34155   
                async move {
32578  34156   
                    let result = {
32579         -
                        let expected = crate::input::TestPayloadStructureInput {
32580         -
                            payload_config: ::std::option::Option::Some(
32581         -
                                crate::model::PayloadConfig {
32582         -
                                    data: ::std::option::Option::None,
32583         -
                                },
32584         -
                            ),
32585         -
                            test_id: ::std::option::Option::None,
       34157  +
                        let expected = crate::input::HttpPayloadWithUnionInput {
       34158  +
                            nested: ::std::option::Option::None,
32586  34159   
                        };
32587  34160   
                        ::pretty_assertions::assert_eq!(input, expected);
32588         -
                        let response = crate::output::TestPayloadStructureOutput {
32589         -
                            payload_config: ::std::option::Option::Some(
32590         -
                                crate::model::PayloadConfig {
32591         -
                                    data: ::std::option::Option::None,
32592         -
                                },
32593         -
                            ),
32594         -
                            test_id: ::std::option::Option::None,
       34161  +
                        let response = crate::output::HttpPayloadWithUnionOutput {
       34162  +
                            nested: ::std::option::Option::None,
32595  34163   
                        };
32596  34164   
                        response
32597  34165   
                    };
32598  34166   
                    sender.send(()).await.expect("receiver dropped early");
32599  34167   
                    result
32600  34168   
                }
32601  34169   
            })
32602  34170   
            .build_unchecked();
32603  34171   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32604  34172   
            .await
32605  34173   
            .expect("unable to make an HTTP request");
32606         -
        assert!(receiver.recv().await.is_some());
       34174  +
        assert!(
       34175  +
            receiver.recv().await.is_some(),
       34176  +
            "we expected operation handler to be invoked but it was not entered"
       34177  +
        );
32607  34178   
    }
32608         -
    /// Serializes a payload targeting a structure
32609         -
    /// Test ID: RestJsonTestPayloadStructure
       34179  +
    /// Serializes a union in the payload.
       34180  +
    /// Test ID: RestJsonHttpPayloadWithUnion
32610  34181   
    #[::tokio::test]
32611         -
    async fn rest_json_test_payload_structure_request() {
       34182  +
    #[::tracing_test::traced_test]
       34183  +
    async fn rest_json_http_payload_with_union_response() {
       34184  +
        let output = crate::output::HttpPayloadWithUnionOutput {
       34185  +
            nested: ::std::option::Option::Some(crate::model::UnionPayload::Greeting(
       34186  +
                "hello".to_owned(),
       34187  +
            )),
       34188  +
        };
       34189  +
        use ::aws_smithy_http_server::response::IntoResponse;
       34190  +
        let http_response = output.into_response();
       34191  +
        ::pretty_assertions::assert_eq!(
       34192  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       34193  +
            http_response.status()
       34194  +
        );
       34195  +
        let expected_headers = [("Content-Type", "application/json")];
       34196  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       34197  +
            http_response.headers(),
       34198  +
            expected_headers,
       34199  +
        ));
       34200  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       34201  +
            .await
       34202  +
            .expect("unable to extract body to bytes");
       34203  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       34204  +
            &body,
       34205  +
            "{\n    \"greeting\": \"hello\"\n}",
       34206  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       34207  +
        ));
       34208  +
    }
       34209  +
    /// No payload is sent if the union has no value.
       34210  +
    /// Test ID: RestJsonHttpPayloadWithUnsetUnion
       34211  +
    #[::tokio::test]
       34212  +
    #[::tracing_test::traced_test]
       34213  +
    async fn rest_json_http_payload_with_unset_union_response() {
       34214  +
        let output = crate::output::HttpPayloadWithUnionOutput {
       34215  +
            nested: ::std::option::Option::None,
       34216  +
        };
       34217  +
        use ::aws_smithy_http_server::response::IntoResponse;
       34218  +
        let http_response = output.into_response();
       34219  +
        ::pretty_assertions::assert_eq!(
       34220  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       34221  +
            http_response.status()
       34222  +
        );
       34223  +
        let expected_headers = [("Content-Length", "0")];
       34224  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       34225  +
            http_response.headers(),
       34226  +
            expected_headers,
       34227  +
        ));
       34228  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       34229  +
            .await
       34230  +
            .expect("unable to extract body to bytes");
       34231  +
        // No body.
       34232  +
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       34233  +
    }
       34234  +
}
       34235  +
       34236  +
static CONTENT_TYPE_HTTPSTRINGPAYLOAD: ::once_cell::sync::Lazy<::mime::Mime> =
       34237  +
    ::once_cell::sync::Lazy::new(|| {
       34238  +
        "text/plain"
       34239  +
            .parse::<::mime::Mime>()
       34240  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
       34241  +
    });
       34242  +
::pin_project_lite::pin_project! {
       34243  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       34244  +
    /// [`HttpStringPayloadInput`](crate::input::HttpStringPayloadInput) using modelled bindings.
       34245  +
    pub struct HttpStringPayloadInputFuture {
       34246  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpStringPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       34247  +
    }
       34248  +
}
       34249  +
       34250  +
impl std::future::Future for HttpStringPayloadInputFuture {
       34251  +
    type Output = Result<
       34252  +
        crate::input::HttpStringPayloadInput,
       34253  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       34254  +
    >;
       34255  +
       34256  +
    fn poll(
       34257  +
        self: std::pin::Pin<&mut Self>,
       34258  +
        cx: &mut std::task::Context<'_>,
       34259  +
    ) -> std::task::Poll<Self::Output> {
       34260  +
        let this = self.project();
       34261  +
        this.inner.as_mut().poll(cx)
       34262  +
    }
       34263  +
}
       34264  +
       34265  +
impl<B>
       34266  +
    ::aws_smithy_http_server::request::FromRequest<
       34267  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       34268  +
        B,
       34269  +
    > for crate::input::HttpStringPayloadInput
       34270  +
where
       34271  +
    B: ::aws_smithy_http_server::body::HttpBody + Send,
       34272  +
    B: 'static,
       34273  +
       34274  +
    B::Data: Send,
       34275  +
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
       34276  +
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
       34277  +
{
       34278  +
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
       34279  +
    type Future = HttpStringPayloadInputFuture;
       34280  +
       34281  +
    fn from_request(request: ::http::Request<B>) -> Self::Future {
       34282  +
        let fut = async move {
       34283  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       34284  +
                request.headers(),
       34285  +
                &CONTENT_TYPE_HTTPSTRINGPAYLOAD,
       34286  +
            ) {
       34287  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       34288  +
            }
       34289  +
            crate::protocol_serde::shape_http_string_payload::de_http_string_payload_http_request(
       34290  +
                request,
       34291  +
            )
       34292  +
            .await
       34293  +
            .map_err(Into::into)
       34294  +
        };
       34295  +
        use ::futures_util::future::TryFutureExt;
       34296  +
        let fut = fut.map_err(
       34297  +
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
       34298  +
                ::tracing::debug!(error = %e, "failed to deserialize request");
       34299  +
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
       34300  +
                    e,
       34301  +
                )
       34302  +
            },
       34303  +
        );
       34304  +
        HttpStringPayloadInputFuture {
       34305  +
            inner: Box::pin(fut),
       34306  +
        }
       34307  +
    }
       34308  +
}
       34309  +
impl
       34310  +
    ::aws_smithy_http_server::response::IntoResponse<
       34311  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       34312  +
    > for crate::output::HttpStringPayloadOutput
       34313  +
{
       34314  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       34315  +
        match crate::protocol_serde::shape_http_string_payload::ser_http_string_payload_http_response(self) {
       34316  +
                        Ok(response) => response,
       34317  +
                        Err(e) => {
       34318  +
                            ::tracing::error!(error = %e, "failed to serialize response");
       34319  +
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       34320  +
                        }
       34321  +
                    }
       34322  +
    }
       34323  +
}
       34324  +
       34325  +
#[allow(unreachable_code, unused_variables)]
       34326  +
#[cfg(test)]
       34327  +
mod http_string_payload_test {
       34328  +
       34329  +
    /// Test ID: RestJsonStringPayloadRequest
       34330  +
    #[::tokio::test]
       34331  +
    #[::tracing_test::traced_test]
       34332  +
    #[should_panic]
       34333  +
    async fn rest_json_string_payload_request_request() {
32612  34334   
        #[allow(unused_mut)]
32613  34335   
        let mut http_request = http::Request::builder()
32614         -
            .uri("/payload")
       34336  +
            .uri("/StringPayload")
32615  34337   
            .method("POST")
32616         -
            .header("Content-Type", "application/json")
32617  34338   
            .body(::aws_smithy_http_server::body::Body::from(
32618         -
                ::bytes::Bytes::from_static("{\"data\": 25\n}".as_bytes()),
       34339  +
                ::bytes::Bytes::from_static("rawstring".as_bytes()),
32619  34340   
            ))
32620  34341   
            .unwrap();
32621  34342   
        #[allow(unused_mut)]
32622  34343   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32623  34344   
        let config = crate::service::RestJsonConfig::builder().build();
32624  34345   
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32625         -
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
       34346  +
            .http_string_payload(move |input: crate::input::HttpStringPayloadInput| {
32626  34347   
                let sender = sender.clone();
32627  34348   
                async move {
32628  34349   
                    let result = {
32629         -
                        let expected = crate::input::TestPayloadStructureInput {
32630         -
                            payload_config: ::std::option::Option::Some(
32631         -
                                crate::model::PayloadConfig {
32632         -
                                    data: ::std::option::Option::Some(25),
32633         -
                                },
32634         -
                            ),
32635         -
                            test_id: ::std::option::Option::None,
       34350  +
                        let expected = crate::input::HttpStringPayloadInput {
       34351  +
                            payload: ::std::option::Option::Some("rawstring".to_owned()),
32636  34352   
                        };
32637  34353   
                        ::pretty_assertions::assert_eq!(input, expected);
32638         -
                        let response = crate::output::TestPayloadStructureOutput {
32639         -
                            payload_config: ::std::option::Option::Some(
32640         -
                                crate::model::PayloadConfig {
32641         -
                                    data: ::std::option::Option::None,
32642         -
                                },
32643         -
                            ),
32644         -
                            test_id: ::std::option::Option::None,
       34354  +
                        let response = crate::output::HttpStringPayloadOutput {
       34355  +
                            payload: ::std::option::Option::None,
32645  34356   
                        };
32646  34357   
                        response
32647  34358   
                    };
32648  34359   
                    sender.send(()).await.expect("receiver dropped early");
32649  34360   
                    result
32650  34361   
                }
32651  34362   
            })
32652  34363   
            .build_unchecked();
32653  34364   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32654  34365   
            .await
32655  34366   
            .expect("unable to make an HTTP request");
32656         -
        assert!(receiver.recv().await.is_some());
       34367  +
        assert!(
       34368  +
            receiver.recv().await.is_some(),
       34369  +
            "we expected operation handler to be invoked but it was not entered"
       34370  +
        );
32657  34371   
    }
32658         -
    /// Serializes an request with header members but no payload
32659         -
    /// Test ID: RestJsonHttpWithHeadersButNoPayload
       34372  +
    /// Test ID: RestJsonStringPayloadResponse
32660  34373   
    #[::tokio::test]
32661         -
    async fn rest_json_http_with_headers_but_no_payload_request() {
32662         -
        #[allow(unused_mut)]
32663         -
        let mut http_request = http::Request::builder()
32664         -
            .uri("/payload")
32665         -
            .method("POST")
32666         -
            .header("Content-Type", "application/json")
32667         -
            .header("X-Amz-Test-Id", "t-12345")
32668         -
            .body(::aws_smithy_http_server::body::Body::from(
32669         -
                ::bytes::Bytes::from_static("{}".as_bytes()),
32670         -
            ))
32671         -
            .unwrap();
32672         -
        #[allow(unused_mut)]
32673         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32674         -
        let config = crate::service::RestJsonConfig::builder().build();
32675         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32676         -
            .test_payload_structure(move |input: crate::input::TestPayloadStructureInput| {
32677         -
                let sender = sender.clone();
32678         -
                async move {
32679         -
                    let result = {
32680         -
                        let expected = crate::input::TestPayloadStructureInput {
32681         -
                            test_id: ::std::option::Option::Some("t-12345".to_owned()),
32682         -
                            payload_config: ::std::option::Option::Some(
32683         -
                                crate::model::PayloadConfig {
32684         -
                                    data: ::std::option::Option::None,
32685         -
                                },
32686         -
                            ),
32687         -
                        };
32688         -
                        ::pretty_assertions::assert_eq!(input, expected);
32689         -
                        let response = crate::output::TestPayloadStructureOutput {
32690         -
                            payload_config: ::std::option::Option::Some(
32691         -
                                crate::model::PayloadConfig {
32692         -
                                    data: ::std::option::Option::None,
32693         -
                                },
32694         -
                            ),
32695         -
                            test_id: ::std::option::Option::None,
32696         -
                        };
32697         -
                        response
32698         -
                    };
32699         -
                    sender.send(()).await.expect("receiver dropped early");
32700         -
                    result
32701         -
                }
32702         -
            })
32703         -
            .build_unchecked();
32704         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32705         -
            .await
32706         -
            .expect("unable to make an HTTP request");
32707         -
        assert!(receiver.recv().await.is_some());
32708         -
    }
32709         -
}
32710         -
#[cfg(test)]
32711         -
#[allow(unreachable_code, unused_variables)]
32712         -
mod server_timestamp_format_headers_test {
32713         -
    /// Tests how timestamp request headers are serialized
32714         -
    /// Test ID: RestJsonTimestampFormatHeaders
32715         -
    #[::tokio::test]
32716         -
    async fn rest_json_timestamp_format_headers_request() {
32717         -
        #[allow(unused_mut)]
32718         -
        let mut http_request = http::Request::builder()
32719         -
            .uri("/TimestampFormatHeaders")
32720         -
            .method("POST")
32721         -
            .header("X-defaultFormat", "Mon, 16 Dec 2019 23:48:18 GMT")
32722         -
            .header("X-memberDateTime", "2019-12-16T23:48:18Z")
32723         -
            .header("X-memberEpochSeconds", "1576540098")
32724         -
            .header("X-memberHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT")
32725         -
            .header("X-targetDateTime", "2019-12-16T23:48:18Z")
32726         -
            .header("X-targetEpochSeconds", "1576540098")
32727         -
            .header("X-targetHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT")
32728         -
            .body(::aws_smithy_http_server::body::Body::from(
32729         -
                ::bytes::Bytes::from_static("".as_bytes()),
32730         -
            ))
32731         -
            .unwrap();
32732         -
        #[allow(unused_mut)]
32733         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32734         -
        let config = crate::service::RestJsonConfig::builder().build();
32735         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32736         -
            .timestamp_format_headers(move |input: crate::input::TimestampFormatHeadersInput| {
32737         -
                let sender = sender.clone();
32738         -
                async move {
32739         -
                    let result = {
32740         -
                        let expected = crate::input::TimestampFormatHeadersInput {
32741         -
                            member_epoch_seconds: ::std::option::Option::Some(
32742         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
32743         -
                                    1576540098, 0_f64,
32744         -
                                ),
32745         -
                            ),
32746         -
                            member_http_date: ::std::option::Option::Some(
32747         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
32748         -
                                    1576540098, 0_f64,
32749         -
                                ),
32750         -
                            ),
32751         -
                            member_date_time: ::std::option::Option::Some(
32752         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
32753         -
                                    1576540098, 0_f64,
32754         -
                                ),
32755         -
                            ),
32756         -
                            default_format: ::std::option::Option::Some(
32757         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
32758         -
                                    1576540098, 0_f64,
32759         -
                                ),
32760         -
                            ),
32761         -
                            target_epoch_seconds: ::std::option::Option::Some(
32762         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
32763         -
                                    1576540098, 0_f64,
32764         -
                                ),
32765         -
                            ),
32766         -
                            target_http_date: ::std::option::Option::Some(
32767         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
32768         -
                                    1576540098, 0_f64,
32769         -
                                ),
32770         -
                            ),
32771         -
                            target_date_time: ::std::option::Option::Some(
32772         -
                                ::aws_smithy_types::DateTime::from_fractional_secs(
32773         -
                                    1576540098, 0_f64,
32774         -
                                ),
32775         -
                            ),
32776         -
                        };
32777         -
                        ::pretty_assertions::assert_eq!(input, expected);
32778         -
                        let response = crate::output::TimestampFormatHeadersOutput {
32779         -
                            member_epoch_seconds: ::std::option::Option::None,
32780         -
                            member_http_date: ::std::option::Option::None,
32781         -
                            member_date_time: ::std::option::Option::None,
32782         -
                            default_format: ::std::option::Option::None,
32783         -
                            target_epoch_seconds: ::std::option::Option::None,
32784         -
                            target_http_date: ::std::option::Option::None,
32785         -
                            target_date_time: ::std::option::Option::None,
32786         -
                        };
32787         -
                        response
32788         -
                    };
32789         -
                    sender.send(()).await.expect("receiver dropped early");
32790         -
                    result
32791         -
                }
32792         -
            })
32793         -
            .build_unchecked();
32794         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32795         -
            .await
32796         -
            .expect("unable to make an HTTP request");
32797         -
        assert!(receiver.recv().await.is_some());
32798         -
    }
32799         -
    /// Tests how timestamp response headers are serialized
32800         -
    /// Test ID: RestJsonTimestampFormatHeaders
32801         -
    #[::tokio::test]
32802         -
    async fn rest_json_timestamp_format_headers_response() {
32803         -
        let output = crate::output::TimestampFormatHeadersOutput {
32804         -
            member_epoch_seconds: ::std::option::Option::Some(
32805         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
32806         -
            ),
32807         -
            member_http_date: ::std::option::Option::Some(
32808         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
32809         -
            ),
32810         -
            member_date_time: ::std::option::Option::Some(
32811         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
32812         -
            ),
32813         -
            default_format: ::std::option::Option::Some(
32814         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
32815         -
            ),
32816         -
            target_epoch_seconds: ::std::option::Option::Some(
32817         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
32818         -
            ),
32819         -
            target_http_date: ::std::option::Option::Some(
32820         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
32821         -
            ),
32822         -
            target_date_time: ::std::option::Option::Some(
32823         -
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
32824         -
            ),
32825         -
        };
32826         -
        use ::aws_smithy_http_server::response::IntoResponse;
32827         -
        let http_response = output.into_response();
32828         -
        ::pretty_assertions::assert_eq!(
32829         -
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32830         -
            http_response.status()
32831         -
        );
32832         -
        let expected_headers = [
32833         -
            ("X-defaultFormat", "Mon, 16 Dec 2019 23:48:18 GMT"),
32834         -
            ("X-memberDateTime", "2019-12-16T23:48:18Z"),
32835         -
            ("X-memberEpochSeconds", "1576540098"),
32836         -
            ("X-memberHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT"),
32837         -
            ("X-targetDateTime", "2019-12-16T23:48:18Z"),
32838         -
            ("X-targetEpochSeconds", "1576540098"),
32839         -
            ("X-targetHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT"),
32840         -
        ];
32841         -
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
32842         -
            http_response.headers(),
32843         -
            expected_headers,
32844         -
        ));
32845         -
    }
32846         -
}
32847         -
#[cfg(test)]
32848         -
#[allow(unreachable_code, unused_variables)]
32849         -
mod server_unit_input_and_output_test {
32850         -
    /// A unit type input serializes no payload. When clients do not
32851         -
    /// need to serialize any data in the payload, they should omit
32852         -
    /// a payload altogether.
32853         -
    /// Test ID: RestJsonUnitInputAndOutput
32854         -
    #[::tokio::test]
32855         -
    async fn rest_json_unit_input_and_output_request() {
32856         -
        #[allow(unused_mut)]
32857         -
        let mut http_request = http::Request::builder()
32858         -
            .uri("/UnitInputAndOutput")
32859         -
            .method("POST")
32860         -
            .body(::aws_smithy_http_server::body::Body::from(
32861         -
                ::bytes::Bytes::from_static("".as_bytes()),
32862         -
            ))
32863         -
            .unwrap();
32864         -
        #[allow(unused_mut)]
32865         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32866         -
        let config = crate::service::RestJsonConfig::builder().build();
32867         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32868         -
            .unit_input_and_output(move |input: crate::input::UnitInputAndOutputInput| {
32869         -
                let sender = sender.clone();
32870         -
                async move {
32871         -
                    let result = {
32872         -
                        let expected = crate::input::UnitInputAndOutputInput {};
32873         -
                        ::pretty_assertions::assert_eq!(input, expected);
32874         -
                        let response = crate::output::UnitInputAndOutputOutput {};
32875         -
                        response
32876         -
                    };
32877         -
                    sender.send(()).await.expect("receiver dropped early");
32878         -
                    result
32879         -
                }
32880         -
            })
32881         -
            .build_unchecked();
32882         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32883         -
            .await
32884         -
            .expect("unable to make an HTTP request");
32885         -
        assert!(receiver.recv().await.is_some());
32886         -
    }
32887         -
    /// Servers should allow the accept header to be set to the
32888         -
    /// default content-type.
32889         -
    /// Test ID: RestJsonUnitInputAllowsAccept
32890         -
    #[::tokio::test]
32891         -
    async fn rest_json_unit_input_allows_accept_request() {
32892         -
        #[allow(unused_mut)]
32893         -
        let mut http_request = http::Request::builder()
32894         -
            .uri("/UnitInputAndOutput")
32895         -
            .method("POST")
32896         -
            .header("Accept", "application/json")
32897         -
            .body(::aws_smithy_http_server::body::Body::from(
32898         -
                ::bytes::Bytes::from_static("".as_bytes()),
32899         -
            ))
32900         -
            .unwrap();
32901         -
        #[allow(unused_mut)]
32902         -
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
32903         -
        let config = crate::service::RestJsonConfig::builder().build();
32904         -
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
32905         -
            .unit_input_and_output(move |input: crate::input::UnitInputAndOutputInput| {
32906         -
                let sender = sender.clone();
32907         -
                async move {
32908         -
                    let result = {
32909         -
                        let expected = crate::input::UnitInputAndOutputInput {};
32910         -
                        ::pretty_assertions::assert_eq!(input, expected);
32911         -
                        let response = crate::output::UnitInputAndOutputOutput {};
32912         -
                        response
       34374  +
    #[::tracing_test::traced_test]
       34375  +
    async fn rest_json_string_payload_response_response() {
       34376  +
        let output = crate::output::HttpStringPayloadOutput {
       34377  +
            payload: ::std::option::Option::Some("rawstring".to_owned()),
32913  34378   
        };
32914         -
                    sender.send(()).await.expect("receiver dropped early");
32915         -
                    result
32916         -
                }
32917         -
            })
32918         -
            .build_unchecked();
32919         -
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
32920         -
            .await
32921         -
            .expect("unable to make an HTTP request");
32922         -
        assert!(receiver.recv().await.is_some());
32923         -
    }
32924         -
    /// When an operation defines Unit output, the service will respond
32925         -
    /// with an empty payload, and may optionally include the content-type
32926         -
    /// header.
32927         -
    /// Test ID: RestJsonUnitInputAndOutputNoOutput
32928         -
    #[::tokio::test]
32929         -
    async fn rest_json_unit_input_and_output_no_output_response() {
32930         -
        let output = crate::output::UnitInputAndOutputOutput {};
32931  34379   
        use ::aws_smithy_http_server::response::IntoResponse;
32932  34380   
        let http_response = output.into_response();
32933  34381   
        ::pretty_assertions::assert_eq!(
32934  34382   
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
32935  34383   
            http_response.status()
32936  34384   
        );
32937  34385   
        let body = ::hyper::body::to_bytes(http_response.into_body())
32938  34386   
            .await
32939  34387   
            .expect("unable to extract body to bytes");
32940         -
        // No body.
32941         -
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       34388  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       34389  +
            &body,
       34390  +
            "rawstring",
       34391  +
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
       34392  +
        ));
32942  34393   
    }
32943  34394   
}
32944  34395   
32945         -
const CONTENT_TYPE_PUTWITHCONTENTENCODING: ::mime::Mime = ::mime::APPLICATION_JSON;
       34396  +
static CONTENT_TYPE_HTTPENUMPAYLOAD: ::once_cell::sync::Lazy<::mime::Mime> =
       34397  +
    ::once_cell::sync::Lazy::new(|| {
       34398  +
        "text/plain"
       34399  +
            .parse::<::mime::Mime>()
       34400  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
       34401  +
    });
32946  34402   
::pin_project_lite::pin_project! {
32947  34403   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
32948         -
    /// [`PutWithContentEncodingInput`](crate::input::PutWithContentEncodingInput) using modelled bindings.
32949         -
    pub struct PutWithContentEncodingInputFuture {
32950         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PutWithContentEncodingInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       34404  +
    /// [`HttpEnumPayloadInput`](crate::input::HttpEnumPayloadInput) using modelled bindings.
       34405  +
    pub struct HttpEnumPayloadInputFuture {
       34406  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpEnumPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
32951  34407   
    }
32952  34408   
}
32953  34409   
32954         -
impl std::future::Future for PutWithContentEncodingInputFuture {
       34410  +
impl std::future::Future for HttpEnumPayloadInputFuture {
32955  34411   
    type Output = Result<
32956         -
        crate::input::PutWithContentEncodingInput,
       34412  +
        crate::input::HttpEnumPayloadInput,
32957  34413   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
32958  34414   
    >;
32959  34415   
32960  34416   
    fn poll(
32961  34417   
        self: std::pin::Pin<&mut Self>,
32962  34418   
        cx: &mut std::task::Context<'_>,
32963  34419   
    ) -> std::task::Poll<Self::Output> {
32964  34420   
        let this = self.project();
32965  34421   
        this.inner.as_mut().poll(cx)
32966  34422   
    }
32967  34423   
}
32968  34424   
32969  34425   
impl<B>
32970  34426   
    ::aws_smithy_http_server::request::FromRequest<
32971  34427   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
32972  34428   
        B,
32973         -
    > for crate::input::PutWithContentEncodingInput
       34429  +
    > for crate::input::HttpEnumPayloadInput
32974  34430   
where
32975  34431   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
32976  34432   
    B: 'static,
32977  34433   
32978  34434   
    B::Data: Send,
32979  34435   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
32980  34436   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
32981  34437   
{
32982  34438   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
32983         -
    type Future = PutWithContentEncodingInputFuture;
       34439  +
    type Future = HttpEnumPayloadInputFuture;
32984  34440   
32985  34441   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
32986  34442   
        let fut = async move {
32987  34443   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
32988  34444   
                request.headers(),
32989         -
                &CONTENT_TYPE_PUTWITHCONTENTENCODING,
       34445  +
                &CONTENT_TYPE_HTTPENUMPAYLOAD,
32990  34446   
            ) {
32991  34447   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
32992  34448   
            }
32993         -
            crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding_http_request(request)
       34449  +
            crate::protocol_serde::shape_http_enum_payload::de_http_enum_payload_http_request(
       34450  +
                request,
       34451  +
            )
32994  34452   
            .await
32995  34453   
            .map_err(Into::into)
32996  34454   
        };
32997  34455   
        use ::futures_util::future::TryFutureExt;
32998  34456   
        let fut = fut.map_err(
32999  34457   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33000  34458   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33001  34459   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33002  34460   
                    e,
33003  34461   
                )
33004  34462   
            },
33005  34463   
        );
33006         -
        PutWithContentEncodingInputFuture {
       34464  +
        HttpEnumPayloadInputFuture {
33007  34465   
            inner: Box::pin(fut),
33008  34466   
        }
33009  34467   
    }
33010  34468   
}
33011  34469   
impl
33012  34470   
    ::aws_smithy_http_server::response::IntoResponse<
33013  34471   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33014         -
    > for crate::output::PutWithContentEncodingOutput
       34472  +
    > for crate::output::HttpEnumPayloadOutput
33015  34473   
{
33016  34474   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33017         -
        match crate::protocol_serde::shape_put_with_content_encoding::ser_put_with_content_encoding_http_response(self) {
       34475  +
        match crate::protocol_serde::shape_http_enum_payload::ser_http_enum_payload_http_response(
       34476  +
            self,
       34477  +
        ) {
33018  34478   
            Ok(response) => response,
33019  34479   
            Err(e) => {
33020  34480   
                ::tracing::error!(error = %e, "failed to serialize response");
33021  34481   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33022  34482   
            }
33023  34483   
        }
33024  34484   
    }
33025  34485   
}
33026         -
33027         -
const CONTENT_TYPE_FRACTIONALSECONDS: ::mime::Mime = ::mime::APPLICATION_JSON;
33028         -
::pin_project_lite::pin_project! {
33029         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33030         -
    /// [`FractionalSecondsInput`](crate::input::FractionalSecondsInput) using modelled bindings.
33031         -
    pub struct FractionalSecondsInputFuture {
33032         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::FractionalSecondsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33033         -
    }
33034         -
}
33035         -
33036         -
impl std::future::Future for FractionalSecondsInputFuture {
33037         -
    type Output = Result<
33038         -
        crate::input::FractionalSecondsInput,
33039         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33040         -
    >;
33041         -
33042         -
    fn poll(
33043         -
        self: std::pin::Pin<&mut Self>,
33044         -
        cx: &mut std::task::Context<'_>,
33045         -
    ) -> std::task::Poll<Self::Output> {
33046         -
        let this = self.project();
33047         -
        this.inner.as_mut().poll(cx)
33048         -
    }
33049         -
}
33050         -
33051         -
impl<B>
33052         -
    ::aws_smithy_http_server::request::FromRequest<
33053         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33054         -
        B,
33055         -
    > for crate::input::FractionalSecondsInput
33056         -
where
33057         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33058         -
    B: 'static,
33059         -
33060         -
    B::Data: Send,
33061         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33062         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33063         -
{
33064         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33065         -
    type Future = FractionalSecondsInputFuture;
33066         -
33067         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33068         -
        let fut = async move {
33069         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33070         -
                request.headers(),
33071         -
                &CONTENT_TYPE_FRACTIONALSECONDS,
33072         -
            ) {
33073         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33074         -
            }
33075         -
            crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_http_request(
33076         -
                request,
33077         -
            )
33078         -
            .await
33079         -
            .map_err(Into::into)
33080         -
        };
33081         -
        use ::futures_util::future::TryFutureExt;
33082         -
        let fut = fut.map_err(
33083         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33084         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
33085         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33086         -
                    e,
33087         -
                )
33088         -
            },
33089         -
        );
33090         -
        FractionalSecondsInputFuture {
33091         -
            inner: Box::pin(fut),
33092         -
        }
33093         -
    }
33094         -
}
33095  34486   
impl
33096  34487   
    ::aws_smithy_http_server::response::IntoResponse<
33097  34488   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33098         -
    > for crate::output::FractionalSecondsOutput
       34489  +
    > for crate::error::HttpEnumPayloadError
33099  34490   
{
33100  34491   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33101         -
        match crate::protocol_serde::shape_fractional_seconds::ser_fractional_seconds_http_response(
33102         -
            self,
       34492  +
        match crate::protocol_serde::shape_http_enum_payload::ser_http_enum_payload_http_error(
       34493  +
            &self,
33103  34494   
        ) {
33104         -
            Ok(response) => response,
       34495  +
            Ok(mut response) => {
       34496  +
                response.extensions_mut().insert(
       34497  +
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       34498  +
                );
       34499  +
                response
       34500  +
            }
33105  34501   
            Err(e) => {
33106  34502   
                ::tracing::error!(error = %e, "failed to serialize response");
33107  34503   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33108  34504   
            }
33109  34505   
        }
33110  34506   
    }
33111  34507   
}
33112  34508   
33113         -
const CONTENT_TYPE_DATETIMEOFFSETS: ::mime::Mime = ::mime::APPLICATION_JSON;
       34509  +
#[allow(unreachable_code, unused_variables)]
       34510  +
#[cfg(test)]
       34511  +
mod http_enum_payload_test {
       34512  +
       34513  +
    /// Test ID: RestJsonEnumPayloadRequest
       34514  +
    #[::tokio::test]
       34515  +
    #[::tracing_test::traced_test]
       34516  +
    #[should_panic]
       34517  +
    async fn rest_json_enum_payload_request_request() {
       34518  +
        #[allow(unused_mut)]
       34519  +
        let mut http_request = http::Request::builder()
       34520  +
            .uri("/EnumPayload")
       34521  +
            .method("POST")
       34522  +
            .body(::aws_smithy_http_server::body::Body::from(
       34523  +
                ::bytes::Bytes::from_static("enumvalue".as_bytes()),
       34524  +
            ))
       34525  +
            .unwrap();
       34526  +
        #[allow(unused_mut)]
       34527  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       34528  +
        let config = crate::service::RestJsonConfig::builder().build();
       34529  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       34530  +
            .http_enum_payload(move |input: crate::input::HttpEnumPayloadInput| {
       34531  +
                let sender = sender.clone();
       34532  +
                async move {
       34533  +
                    let result = {
       34534  +
                        let expected = crate::input::HttpEnumPayloadInput {
       34535  +
                            payload: ::std::option::Option::Some(
       34536  +
                                "enumvalue"
       34537  +
                                    .parse::<crate::model::StringEnum>()
       34538  +
                                    .expect("static value validated to member"),
       34539  +
                            ),
       34540  +
                        };
       34541  +
                        ::pretty_assertions::assert_eq!(input, expected);
       34542  +
                        let response = crate::output::HttpEnumPayloadOutput {
       34543  +
                            payload: ::std::option::Option::None,
       34544  +
                        };
       34545  +
                        Ok(response)
       34546  +
                    };
       34547  +
                    sender.send(()).await.expect("receiver dropped early");
       34548  +
                    result
       34549  +
                }
       34550  +
            })
       34551  +
            .build_unchecked();
       34552  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       34553  +
            .await
       34554  +
            .expect("unable to make an HTTP request");
       34555  +
        assert!(
       34556  +
            receiver.recv().await.is_some(),
       34557  +
            "we expected operation handler to be invoked but it was not entered"
       34558  +
        );
       34559  +
    }
       34560  +
    /// Test ID: RestJsonEnumPayloadResponse
       34561  +
    #[::tokio::test]
       34562  +
    #[::tracing_test::traced_test]
       34563  +
    async fn rest_json_enum_payload_response_response() {
       34564  +
        let output = crate::output::HttpEnumPayloadOutput {
       34565  +
            payload: ::std::option::Option::Some(
       34566  +
                "enumvalue"
       34567  +
                    .parse::<crate::model::StringEnum>()
       34568  +
                    .expect("static value validated to member"),
       34569  +
            ),
       34570  +
        };
       34571  +
        use ::aws_smithy_http_server::response::IntoResponse;
       34572  +
        let http_response = output.into_response();
       34573  +
        ::pretty_assertions::assert_eq!(
       34574  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       34575  +
            http_response.status()
       34576  +
        );
       34577  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       34578  +
            .await
       34579  +
            .expect("unable to extract body to bytes");
       34580  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       34581  +
            &body,
       34582  +
            "enumvalue",
       34583  +
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
       34584  +
        ));
       34585  +
    }
       34586  +
}
       34587  +
       34588  +
const CONTENT_TYPE_HTTPPAYLOADWITHSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
33114  34589   
::pin_project_lite::pin_project! {
33115  34590   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33116         -
    /// [`DatetimeOffsetsInput`](crate::input::DatetimeOffsetsInput) using modelled bindings.
33117         -
    pub struct DatetimeOffsetsInputFuture {
33118         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DatetimeOffsetsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       34591  +
    /// [`HttpPayloadWithStructureInput`](crate::input::HttpPayloadWithStructureInput) using modelled bindings.
       34592  +
    pub struct HttpPayloadWithStructureInputFuture {
       34593  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadWithStructureInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33119  34594   
    }
33120  34595   
}
33121  34596   
33122         -
impl std::future::Future for DatetimeOffsetsInputFuture {
       34597  +
impl std::future::Future for HttpPayloadWithStructureInputFuture {
33123  34598   
    type Output = Result<
33124         -
        crate::input::DatetimeOffsetsInput,
       34599  +
        crate::input::HttpPayloadWithStructureInput,
33125  34600   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33126  34601   
    >;
33127  34602   
33128  34603   
    fn poll(
33129  34604   
        self: std::pin::Pin<&mut Self>,
33130  34605   
        cx: &mut std::task::Context<'_>,
33131  34606   
    ) -> std::task::Poll<Self::Output> {
33132  34607   
        let this = self.project();
33133  34608   
        this.inner.as_mut().poll(cx)
33134  34609   
    }
33135  34610   
}
33136  34611   
33137  34612   
impl<B>
33138  34613   
    ::aws_smithy_http_server::request::FromRequest<
33139  34614   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33140  34615   
        B,
33141         -
    > for crate::input::DatetimeOffsetsInput
       34616  +
    > for crate::input::HttpPayloadWithStructureInput
33142  34617   
where
33143  34618   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33144  34619   
    B: 'static,
33145  34620   
33146  34621   
    B::Data: Send,
33147  34622   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33148  34623   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33149  34624   
{
33150  34625   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33151         -
    type Future = DatetimeOffsetsInputFuture;
       34626  +
    type Future = HttpPayloadWithStructureInputFuture;
33152  34627   
33153  34628   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33154  34629   
        let fut = async move {
33155  34630   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33156  34631   
                request.headers(),
33157         -
                &CONTENT_TYPE_DATETIMEOFFSETS,
       34632  +
                &CONTENT_TYPE_HTTPPAYLOADWITHSTRUCTURE,
33158  34633   
            ) {
33159  34634   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33160  34635   
            }
33161         -
            crate::protocol_serde::shape_datetime_offsets::de_datetime_offsets_http_request(request)
       34636  +
            crate::protocol_serde::shape_http_payload_with_structure::de_http_payload_with_structure_http_request(request)
33162  34637   
                            .await
33163  34638   
                            .map_err(Into::into)
33164  34639   
        };
33165  34640   
        use ::futures_util::future::TryFutureExt;
33166  34641   
        let fut = fut.map_err(
33167  34642   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33168  34643   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33169  34644   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33170  34645   
                    e,
33171  34646   
                )
33172  34647   
            },
33173  34648   
        );
33174         -
        DatetimeOffsetsInputFuture {
       34649  +
        HttpPayloadWithStructureInputFuture {
33175  34650   
            inner: Box::pin(fut),
33176  34651   
        }
33177  34652   
    }
33178  34653   
}
33179  34654   
impl
33180  34655   
    ::aws_smithy_http_server::response::IntoResponse<
33181  34656   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33182         -
    > for crate::output::DatetimeOffsetsOutput
       34657  +
    > for crate::output::HttpPayloadWithStructureOutput
33183  34658   
{
33184  34659   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33185         -
        match crate::protocol_serde::shape_datetime_offsets::ser_datetime_offsets_http_response(
33186         -
            self,
33187         -
        ) {
       34660  +
        match crate::protocol_serde::shape_http_payload_with_structure::ser_http_payload_with_structure_http_response(self) {
33188  34661   
                        Ok(response) => response,
33189  34662   
                        Err(e) => {
33190  34663   
                            ::tracing::error!(error = %e, "failed to serialize response");
33191  34664   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33192  34665   
                        }
33193  34666   
                    }
33194  34667   
    }
33195  34668   
}
33196  34669   
33197         -
const CONTENT_TYPE_TESTNOPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
33198         -
::pin_project_lite::pin_project! {
33199         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33200         -
    /// [`TestNoPayloadInput`](crate::input::TestNoPayloadInput) using modelled bindings.
33201         -
    pub struct TestNoPayloadInputFuture {
33202         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestNoPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33203         -
    }
33204         -
}
33205         -
33206         -
impl std::future::Future for TestNoPayloadInputFuture {
33207         -
    type Output = Result<
33208         -
        crate::input::TestNoPayloadInput,
33209         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33210         -
    >;
33211         -
33212         -
    fn poll(
33213         -
        self: std::pin::Pin<&mut Self>,
33214         -
        cx: &mut std::task::Context<'_>,
33215         -
    ) -> std::task::Poll<Self::Output> {
33216         -
        let this = self.project();
33217         -
        this.inner.as_mut().poll(cx)
33218         -
    }
33219         -
}
       34670  +
#[allow(unreachable_code, unused_variables)]
       34671  +
#[cfg(test)]
       34672  +
mod http_payload_with_structure_test {
33220  34673   
33221         -
impl<B>
33222         -
    ::aws_smithy_http_server::request::FromRequest<
33223         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       34674  +
    /// Serializes a structure in the payload
       34675  +
    /// Test ID: RestJsonHttpPayloadWithStructure
       34676  +
    #[::tokio::test]
       34677  +
    #[::tracing_test::traced_test]
       34678  +
    async fn rest_json_http_payload_with_structure_request() {
       34679  +
        #[allow(unused_mut)]
       34680  +
        let mut http_request = http::Request::builder()
       34681  +
            .uri("/HttpPayloadWithStructure")
       34682  +
            .method("PUT")
       34683  +
            .header("Content-Type", "application/json")
       34684  +
            .body(::aws_smithy_http_server::body::Body::from(
       34685  +
                ::bytes::Bytes::from_static(
       34686  +
                    "{\n    \"greeting\": \"hello\",\n    \"name\": \"Phreddy\"\n}".as_bytes(),
       34687  +
                ),
       34688  +
            ))
       34689  +
            .unwrap();
       34690  +
        #[allow(unused_mut)]
       34691  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       34692  +
        let config = crate::service::RestJsonConfig::builder().build();
       34693  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       34694  +
            .http_payload_with_structure(
       34695  +
                move |input: crate::input::HttpPayloadWithStructureInput| {
       34696  +
                    let sender = sender.clone();
       34697  +
                    async move {
       34698  +
                        let result = {
       34699  +
                            let expected = crate::input::HttpPayloadWithStructureInput {
       34700  +
                                nested: ::std::option::Option::Some(crate::model::NestedPayload {
       34701  +
                                    greeting: ::std::option::Option::Some("hello".to_owned()),
       34702  +
                                    name: ::std::option::Option::Some("Phreddy".to_owned()),
       34703  +
                                }),
       34704  +
                            };
       34705  +
                            ::pretty_assertions::assert_eq!(input, expected);
       34706  +
                            let response = crate::output::HttpPayloadWithStructureOutput {
       34707  +
                                nested: ::std::option::Option::Some(crate::model::NestedPayload {
       34708  +
                                    greeting: ::std::option::Option::None,
       34709  +
                                    name: ::std::option::Option::None,
       34710  +
                                }),
       34711  +
                            };
       34712  +
                            response
       34713  +
                        };
       34714  +
                        sender.send(()).await.expect("receiver dropped early");
       34715  +
                        result
       34716  +
                    }
       34717  +
                },
       34718  +
            )
       34719  +
            .build_unchecked();
       34720  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       34721  +
            .await
       34722  +
            .expect("unable to make an HTTP request");
       34723  +
        assert!(
       34724  +
            receiver.recv().await.is_some(),
       34725  +
            "we expected operation handler to be invoked but it was not entered"
       34726  +
        );
       34727  +
    }
       34728  +
    /// Serializes a structure in the payload
       34729  +
    /// Test ID: RestJsonHttpPayloadWithStructure
       34730  +
    #[::tokio::test]
       34731  +
    #[::tracing_test::traced_test]
       34732  +
    async fn rest_json_http_payload_with_structure_response() {
       34733  +
        let output = crate::output::HttpPayloadWithStructureOutput {
       34734  +
            nested: ::std::option::Option::Some(crate::model::NestedPayload {
       34735  +
                greeting: ::std::option::Option::Some("hello".to_owned()),
       34736  +
                name: ::std::option::Option::Some("Phreddy".to_owned()),
       34737  +
            }),
       34738  +
        };
       34739  +
        use ::aws_smithy_http_server::response::IntoResponse;
       34740  +
        let http_response = output.into_response();
       34741  +
        ::pretty_assertions::assert_eq!(
       34742  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       34743  +
            http_response.status()
       34744  +
        );
       34745  +
        let expected_headers = [("Content-Type", "application/json")];
       34746  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       34747  +
            http_response.headers(),
       34748  +
            expected_headers,
       34749  +
        ));
       34750  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       34751  +
            .await
       34752  +
            .expect("unable to extract body to bytes");
       34753  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       34754  +
            &body,
       34755  +
            "{\n    \"greeting\": \"hello\",\n    \"name\": \"Phreddy\"\n}",
       34756  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       34757  +
        ));
       34758  +
    }
       34759  +
}
       34760  +
       34761  +
static CONTENT_TYPE_HTTPPAYLOADTRAITSWITHMEDIATYPE: ::once_cell::sync::Lazy<::mime::Mime> =
       34762  +
    ::once_cell::sync::Lazy::new(|| {
       34763  +
        "text/plain"
       34764  +
            .parse::<::mime::Mime>()
       34765  +
            .expect("BUG: MIME parsing failed, content_type is not valid")
       34766  +
    });
       34767  +
::pin_project_lite::pin_project! {
       34768  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       34769  +
    /// [`HttpPayloadTraitsWithMediaTypeInput`](crate::input::HttpPayloadTraitsWithMediaTypeInput) using modelled bindings.
       34770  +
    pub struct HttpPayloadTraitsWithMediaTypeInputFuture {
       34771  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadTraitsWithMediaTypeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       34772  +
    }
       34773  +
}
       34774  +
       34775  +
impl std::future::Future for HttpPayloadTraitsWithMediaTypeInputFuture {
       34776  +
    type Output = Result<
       34777  +
        crate::input::HttpPayloadTraitsWithMediaTypeInput,
       34778  +
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
       34779  +
    >;
       34780  +
       34781  +
    fn poll(
       34782  +
        self: std::pin::Pin<&mut Self>,
       34783  +
        cx: &mut std::task::Context<'_>,
       34784  +
    ) -> std::task::Poll<Self::Output> {
       34785  +
        let this = self.project();
       34786  +
        this.inner.as_mut().poll(cx)
       34787  +
    }
       34788  +
}
       34789  +
       34790  +
impl<B>
       34791  +
    ::aws_smithy_http_server::request::FromRequest<
       34792  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33224  34793   
        B,
33225         -
    > for crate::input::TestNoPayloadInput
       34794  +
    > for crate::input::HttpPayloadTraitsWithMediaTypeInput
33226  34795   
where
33227  34796   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33228  34797   
    B: 'static,
33229  34798   
33230  34799   
    B::Data: Send,
33231  34800   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33232  34801   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33233  34802   
{
33234  34803   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33235         -
    type Future = TestNoPayloadInputFuture;
       34804  +
    type Future = HttpPayloadTraitsWithMediaTypeInputFuture;
33236  34805   
33237  34806   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33238  34807   
        let fut = async move {
33239  34808   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33240  34809   
                request.headers(),
33241         -
                &CONTENT_TYPE_TESTNOPAYLOAD,
       34810  +
                &CONTENT_TYPE_HTTPPAYLOADTRAITSWITHMEDIATYPE,
33242  34811   
            ) {
33243  34812   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33244  34813   
            }
33245         -
            crate::protocol_serde::shape_test_no_payload::de_test_no_payload_http_request(request)
       34814  +
            crate::protocol_serde::shape_http_payload_traits_with_media_type::de_http_payload_traits_with_media_type_http_request(request)
33246  34815   
                            .await
33247  34816   
                            .map_err(Into::into)
33248  34817   
        };
33249  34818   
        use ::futures_util::future::TryFutureExt;
33250  34819   
        let fut = fut.map_err(
33251  34820   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33252  34821   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33253  34822   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33254  34823   
                    e,
33255  34824   
                )
33256  34825   
            },
33257  34826   
        );
33258         -
        TestNoPayloadInputFuture {
       34827  +
        HttpPayloadTraitsWithMediaTypeInputFuture {
33259  34828   
            inner: Box::pin(fut),
33260  34829   
        }
33261  34830   
    }
33262  34831   
}
33263  34832   
impl
33264  34833   
    ::aws_smithy_http_server::response::IntoResponse<
33265  34834   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33266         -
    > for crate::output::TestNoPayloadOutput
       34835  +
    > for crate::output::HttpPayloadTraitsWithMediaTypeOutput
33267  34836   
{
33268  34837   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33269         -
        match crate::protocol_serde::shape_test_no_payload::ser_test_no_payload_http_response(self)
33270         -
        {
       34838  +
        match crate::protocol_serde::shape_http_payload_traits_with_media_type::ser_http_payload_traits_with_media_type_http_response(self) {
33271  34839   
                        Ok(response) => response,
33272  34840   
                        Err(e) => {
33273  34841   
                            ::tracing::error!(error = %e, "failed to serialize response");
33274  34842   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33275  34843   
                        }
33276  34844   
                    }
33277  34845   
    }
33278  34846   
}
33279  34847   
       34848  +
#[allow(unreachable_code, unused_variables)]
       34849  +
#[cfg(test)]
       34850  +
mod http_payload_traits_with_media_type_test {
       34851  +
       34852  +
    /// Serializes a blob in the HTTP payload with a content-type
       34853  +
    /// Test ID: RestJsonHttpPayloadTraitsWithMediaTypeWithBlob
       34854  +
    #[::tokio::test]
       34855  +
    #[::tracing_test::traced_test]
       34856  +
    async fn rest_json_http_payload_traits_with_media_type_with_blob_request() {
       34857  +
        #[allow(unused_mut)]
       34858  +
        let mut http_request = http::Request::builder()
       34859  +
            .uri("/HttpPayloadTraitsWithMediaType")
       34860  +
            .method("POST")
       34861  +
            .header("Content-Type", "text/plain")
       34862  +
            .header("X-Foo", "Foo")
       34863  +
            .body(::aws_smithy_http_server::body::Body::from(
       34864  +
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
       34865  +
            ))
       34866  +
            .unwrap();
       34867  +
        #[allow(unused_mut)]
       34868  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       34869  +
        let config = crate::service::RestJsonConfig::builder().build();
       34870  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       34871  +
            .http_payload_traits_with_media_type(
       34872  +
                move |input: crate::input::HttpPayloadTraitsWithMediaTypeInput| {
       34873  +
                    let sender = sender.clone();
       34874  +
                    async move {
       34875  +
                        let result = {
       34876  +
                            let expected = crate::input::HttpPayloadTraitsWithMediaTypeInput {
       34877  +
                                foo: ::std::option::Option::Some("Foo".to_owned()),
       34878  +
                                blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
       34879  +
                                    "blobby blob blob",
       34880  +
                                )),
       34881  +
                            };
       34882  +
                            ::pretty_assertions::assert_eq!(input, expected);
       34883  +
                            let response = crate::output::HttpPayloadTraitsWithMediaTypeOutput {
       34884  +
                                foo: ::std::option::Option::None,
       34885  +
                                blob: ::std::option::Option::None,
       34886  +
                            };
       34887  +
                            response
       34888  +
                        };
       34889  +
                        sender.send(()).await.expect("receiver dropped early");
       34890  +
                        result
       34891  +
                    }
       34892  +
                },
       34893  +
            )
       34894  +
            .build_unchecked();
       34895  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       34896  +
            .await
       34897  +
            .expect("unable to make an HTTP request");
       34898  +
        assert!(
       34899  +
            receiver.recv().await.is_some(),
       34900  +
            "we expected operation handler to be invoked but it was not entered"
       34901  +
        );
       34902  +
    }
       34903  +
    /// Serializes a blob in the HTTP payload with a content-type
       34904  +
    /// Test ID: RestJsonHttpPayloadTraitsWithMediaTypeWithBlob
       34905  +
    #[::tokio::test]
       34906  +
    #[::tracing_test::traced_test]
       34907  +
    async fn rest_json_http_payload_traits_with_media_type_with_blob_response() {
       34908  +
        let output = crate::output::HttpPayloadTraitsWithMediaTypeOutput {
       34909  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
       34910  +
            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")),
       34911  +
        };
       34912  +
        use ::aws_smithy_http_server::response::IntoResponse;
       34913  +
        let http_response = output.into_response();
       34914  +
        ::pretty_assertions::assert_eq!(
       34915  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       34916  +
            http_response.status()
       34917  +
        );
       34918  +
        let expected_headers = [("Content-Type", "text/plain"), ("X-Foo", "Foo")];
       34919  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       34920  +
            http_response.headers(),
       34921  +
            expected_headers,
       34922  +
        ));
       34923  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       34924  +
            .await
       34925  +
            .expect("unable to extract body to bytes");
       34926  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       34927  +
            &body,
       34928  +
            "blobby blob blob",
       34929  +
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
       34930  +
        ));
       34931  +
    }
       34932  +
}
       34933  +
33280  34934   
::pin_project_lite::pin_project! {
33281  34935   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33282         -
    /// [`TestPayloadBlobInput`](crate::input::TestPayloadBlobInput) using modelled bindings.
33283         -
    pub struct TestPayloadBlobInputFuture {
33284         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestPayloadBlobInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       34936  +
    /// [`HttpPayloadTraitsInput`](crate::input::HttpPayloadTraitsInput) using modelled bindings.
       34937  +
    pub struct HttpPayloadTraitsInputFuture {
       34938  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadTraitsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33285  34939   
    }
33286  34940   
}
33287  34941   
33288         -
impl std::future::Future for TestPayloadBlobInputFuture {
       34942  +
impl std::future::Future for HttpPayloadTraitsInputFuture {
33289  34943   
    type Output = Result<
33290         -
        crate::input::TestPayloadBlobInput,
       34944  +
        crate::input::HttpPayloadTraitsInput,
33291  34945   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33292  34946   
    >;
33293  34947   
33294  34948   
    fn poll(
33295  34949   
        self: std::pin::Pin<&mut Self>,
33296  34950   
        cx: &mut std::task::Context<'_>,
33297  34951   
    ) -> std::task::Poll<Self::Output> {
33298  34952   
        let this = self.project();
33299  34953   
        this.inner.as_mut().poll(cx)
33300  34954   
    }
33301  34955   
}
33302  34956   
33303  34957   
impl<B>
33304  34958   
    ::aws_smithy_http_server::request::FromRequest<
33305  34959   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33306  34960   
        B,
33307         -
    > for crate::input::TestPayloadBlobInput
       34961  +
    > for crate::input::HttpPayloadTraitsInput
33308  34962   
where
33309  34963   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33310  34964   
    B: 'static,
33311  34965   
33312  34966   
    B::Data: Send,
33313  34967   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33314  34968   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33315  34969   
{
33316  34970   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33317         -
    type Future = TestPayloadBlobInputFuture;
       34971  +
    type Future = HttpPayloadTraitsInputFuture;
33318  34972   
33319  34973   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33320  34974   
        let fut = async move {
33321         -
            crate::protocol_serde::shape_test_payload_blob::de_test_payload_blob_http_request(
       34975  +
            crate::protocol_serde::shape_http_payload_traits::de_http_payload_traits_http_request(
33322  34976   
                request,
33323  34977   
            )
33324  34978   
            .await
33325  34979   
            .map_err(Into::into)
33326  34980   
        };
33327  34981   
        use ::futures_util::future::TryFutureExt;
33328  34982   
        let fut = fut.map_err(
33329  34983   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33330  34984   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33331  34985   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33332  34986   
                    e,
33333  34987   
                )
33334  34988   
            },
33335  34989   
        );
33336         -
        TestPayloadBlobInputFuture {
       34990  +
        HttpPayloadTraitsInputFuture {
33337  34991   
            inner: Box::pin(fut),
33338  34992   
        }
33339  34993   
    }
33340  34994   
}
33341  34995   
impl
33342  34996   
    ::aws_smithy_http_server::response::IntoResponse<
33343  34997   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33344         -
    > for crate::output::TestPayloadBlobOutput
       34998  +
    > for crate::output::HttpPayloadTraitsOutput
33345  34999   
{
33346  35000   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33347         -
        match crate::protocol_serde::shape_test_payload_blob::ser_test_payload_blob_http_response(
33348         -
            self,
33349         -
        ) {
       35001  +
        match crate::protocol_serde::shape_http_payload_traits::ser_http_payload_traits_http_response(self) {
33350  35002   
                        Ok(response) => response,
33351  35003   
                        Err(e) => {
33352  35004   
                            ::tracing::error!(error = %e, "failed to serialize response");
33353  35005   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33354  35006   
                        }
33355  35007   
                    }
33356  35008   
    }
33357  35009   
}
33358  35010   
33359         -
const CONTENT_TYPE_TESTPAYLOADSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
       35011  +
#[allow(unreachable_code, unused_variables)]
       35012  +
#[cfg(test)]
       35013  +
mod http_payload_traits_test {
       35014  +
       35015  +
    /// Serializes a blob in the HTTP payload
       35016  +
    /// Test ID: RestJsonHttpPayloadTraitsWithBlob
       35017  +
    #[::tokio::test]
       35018  +
    #[::tracing_test::traced_test]
       35019  +
    async fn rest_json_http_payload_traits_with_blob_request() {
       35020  +
        #[allow(unused_mut)]
       35021  +
        let mut http_request = http::Request::builder()
       35022  +
            .uri("/HttpPayloadTraits")
       35023  +
            .method("POST")
       35024  +
            .header("Content-Type", "application/octet-stream")
       35025  +
            .header("X-Foo", "Foo")
       35026  +
            .body(::aws_smithy_http_server::body::Body::from(
       35027  +
                ::bytes::Bytes::from_static("blobby blob blob".as_bytes()),
       35028  +
            ))
       35029  +
            .unwrap();
       35030  +
        #[allow(unused_mut)]
       35031  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       35032  +
        let config = crate::service::RestJsonConfig::builder().build();
       35033  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       35034  +
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
       35035  +
                let sender = sender.clone();
       35036  +
                async move {
       35037  +
                    let result = {
       35038  +
                        let expected = crate::input::HttpPayloadTraitsInput {
       35039  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
       35040  +
                            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
       35041  +
                                "blobby blob blob",
       35042  +
                            )),
       35043  +
                        };
       35044  +
                        ::pretty_assertions::assert_eq!(input, expected);
       35045  +
                        let response = crate::output::HttpPayloadTraitsOutput {
       35046  +
                            foo: ::std::option::Option::None,
       35047  +
                            blob: ::std::option::Option::None,
       35048  +
                        };
       35049  +
                        response
       35050  +
                    };
       35051  +
                    sender.send(()).await.expect("receiver dropped early");
       35052  +
                    result
       35053  +
                }
       35054  +
            })
       35055  +
            .build_unchecked();
       35056  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       35057  +
            .await
       35058  +
            .expect("unable to make an HTTP request");
       35059  +
        assert!(
       35060  +
            receiver.recv().await.is_some(),
       35061  +
            "we expected operation handler to be invoked but it was not entered"
       35062  +
        );
       35063  +
    }
       35064  +
    /// Serializes an empty blob in the HTTP payload
       35065  +
    /// Test ID: RestJsonHttpPayloadTraitsWithNoBlobBody
       35066  +
    #[::tokio::test]
       35067  +
    #[::tracing_test::traced_test]
       35068  +
    async fn rest_json_http_payload_traits_with_no_blob_body_request() {
       35069  +
        #[allow(unused_mut)]
       35070  +
        let mut http_request = http::Request::builder()
       35071  +
            .uri("/HttpPayloadTraits")
       35072  +
            .method("POST")
       35073  +
            .header("X-Foo", "Foo")
       35074  +
            .body(::aws_smithy_http_server::body::Body::from(
       35075  +
                ::bytes::Bytes::from_static("".as_bytes()),
       35076  +
            ))
       35077  +
            .unwrap();
       35078  +
        #[allow(unused_mut)]
       35079  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       35080  +
        let config = crate::service::RestJsonConfig::builder().build();
       35081  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       35082  +
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
       35083  +
                let sender = sender.clone();
       35084  +
                async move {
       35085  +
                    let result = {
       35086  +
                        let expected = crate::input::HttpPayloadTraitsInput {
       35087  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
       35088  +
                            blob: ::std::option::Option::None,
       35089  +
                        };
       35090  +
                        ::pretty_assertions::assert_eq!(input, expected);
       35091  +
                        let response = crate::output::HttpPayloadTraitsOutput {
       35092  +
                            foo: ::std::option::Option::None,
       35093  +
                            blob: ::std::option::Option::None,
       35094  +
                        };
       35095  +
                        response
       35096  +
                    };
       35097  +
                    sender.send(()).await.expect("receiver dropped early");
       35098  +
                    result
       35099  +
                }
       35100  +
            })
       35101  +
            .build_unchecked();
       35102  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       35103  +
            .await
       35104  +
            .expect("unable to make an HTTP request");
       35105  +
        assert!(
       35106  +
            receiver.recv().await.is_some(),
       35107  +
            "we expected operation handler to be invoked but it was not entered"
       35108  +
        );
       35109  +
    }
       35110  +
    /// Servers must accept any content type for blob inputs
       35111  +
    /// without the media type trait.
       35112  +
    /// Test ID: RestJsonHttpPayloadTraitsWithBlobAcceptsAllContentTypes
       35113  +
    #[::tokio::test]
       35114  +
    #[::tracing_test::traced_test]
       35115  +
    async fn rest_json_http_payload_traits_with_blob_accepts_all_content_types_request() {
       35116  +
        #[allow(unused_mut)]
       35117  +
        let mut http_request = http::Request::builder()
       35118  +
            .uri("/HttpPayloadTraits")
       35119  +
            .method("POST")
       35120  +
            .header("Content-Type", "image/jpeg")
       35121  +
            .header("X-Foo", "Foo")
       35122  +
            .body(::aws_smithy_http_server::body::Body::from(
       35123  +
                ::bytes::Bytes::from_static("This is definitely a jpeg".as_bytes()),
       35124  +
            ))
       35125  +
            .unwrap();
       35126  +
        #[allow(unused_mut)]
       35127  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       35128  +
        let config = crate::service::RestJsonConfig::builder().build();
       35129  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       35130  +
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
       35131  +
                let sender = sender.clone();
       35132  +
                async move {
       35133  +
                    let result = {
       35134  +
                        let expected = crate::input::HttpPayloadTraitsInput {
       35135  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
       35136  +
                            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
       35137  +
                                "This is definitely a jpeg",
       35138  +
                            )),
       35139  +
                        };
       35140  +
                        ::pretty_assertions::assert_eq!(input, expected);
       35141  +
                        let response = crate::output::HttpPayloadTraitsOutput {
       35142  +
                            foo: ::std::option::Option::None,
       35143  +
                            blob: ::std::option::Option::None,
       35144  +
                        };
       35145  +
                        response
       35146  +
                    };
       35147  +
                    sender.send(()).await.expect("receiver dropped early");
       35148  +
                    result
       35149  +
                }
       35150  +
            })
       35151  +
            .build_unchecked();
       35152  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       35153  +
            .await
       35154  +
            .expect("unable to make an HTTP request");
       35155  +
        assert!(
       35156  +
            receiver.recv().await.is_some(),
       35157  +
            "we expected operation handler to be invoked but it was not entered"
       35158  +
        );
       35159  +
    }
       35160  +
    /// Servers must accept any accept header for blob inputs
       35161  +
    /// without the media type trait.
       35162  +
    /// Test ID: RestJsonHttpPayloadTraitsWithBlobAcceptsAllAccepts
       35163  +
    #[::tokio::test]
       35164  +
    #[::tracing_test::traced_test]
       35165  +
    async fn rest_json_http_payload_traits_with_blob_accepts_all_accepts_request() {
       35166  +
        #[allow(unused_mut)]
       35167  +
        let mut http_request = http::Request::builder()
       35168  +
            .uri("/HttpPayloadTraits")
       35169  +
            .method("POST")
       35170  +
            .header("Accept", "image/jpeg")
       35171  +
            .header("X-Foo", "Foo")
       35172  +
            .body(::aws_smithy_http_server::body::Body::from(
       35173  +
                ::bytes::Bytes::from_static("This is definitely a jpeg".as_bytes()),
       35174  +
            ))
       35175  +
            .unwrap();
       35176  +
        #[allow(unused_mut)]
       35177  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       35178  +
        let config = crate::service::RestJsonConfig::builder().build();
       35179  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       35180  +
            .http_payload_traits(move |input: crate::input::HttpPayloadTraitsInput| {
       35181  +
                let sender = sender.clone();
       35182  +
                async move {
       35183  +
                    let result = {
       35184  +
                        let expected = crate::input::HttpPayloadTraitsInput {
       35185  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
       35186  +
                            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
       35187  +
                                "This is definitely a jpeg",
       35188  +
                            )),
       35189  +
                        };
       35190  +
                        ::pretty_assertions::assert_eq!(input, expected);
       35191  +
                        let response = crate::output::HttpPayloadTraitsOutput {
       35192  +
                            foo: ::std::option::Option::None,
       35193  +
                            blob: ::std::option::Option::None,
       35194  +
                        };
       35195  +
                        response
       35196  +
                    };
       35197  +
                    sender.send(()).await.expect("receiver dropped early");
       35198  +
                    result
       35199  +
                }
       35200  +
            })
       35201  +
            .build_unchecked();
       35202  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       35203  +
            .await
       35204  +
            .expect("unable to make an HTTP request");
       35205  +
        assert!(
       35206  +
            receiver.recv().await.is_some(),
       35207  +
            "we expected operation handler to be invoked but it was not entered"
       35208  +
        );
       35209  +
    }
       35210  +
    /// Serializes a blob in the HTTP payload
       35211  +
    /// Test ID: RestJsonHttpPayloadTraitsWithBlob
       35212  +
    #[::tokio::test]
       35213  +
    #[::tracing_test::traced_test]
       35214  +
    async fn rest_json_http_payload_traits_with_blob_response() {
       35215  +
        let output = crate::output::HttpPayloadTraitsOutput {
       35216  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
       35217  +
            blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")),
       35218  +
        };
       35219  +
        use ::aws_smithy_http_server::response::IntoResponse;
       35220  +
        let http_response = output.into_response();
       35221  +
        ::pretty_assertions::assert_eq!(
       35222  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       35223  +
            http_response.status()
       35224  +
        );
       35225  +
        let expected_headers = [("X-Foo", "Foo")];
       35226  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       35227  +
            http_response.headers(),
       35228  +
            expected_headers,
       35229  +
        ));
       35230  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       35231  +
            .await
       35232  +
            .expect("unable to extract body to bytes");
       35233  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       35234  +
            &body,
       35235  +
            "blobby blob blob",
       35236  +
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
       35237  +
        ));
       35238  +
    }
       35239  +
    /// Serializes an empty blob in the HTTP payload
       35240  +
    /// Test ID: RestJsonHttpPayloadTraitsWithNoBlobBody
       35241  +
    #[::tokio::test]
       35242  +
    #[::tracing_test::traced_test]
       35243  +
    async fn rest_json_http_payload_traits_with_no_blob_body_response() {
       35244  +
        let output = crate::output::HttpPayloadTraitsOutput {
       35245  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
       35246  +
            blob: ::std::option::Option::None,
       35247  +
        };
       35248  +
        use ::aws_smithy_http_server::response::IntoResponse;
       35249  +
        let http_response = output.into_response();
       35250  +
        ::pretty_assertions::assert_eq!(
       35251  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       35252  +
            http_response.status()
       35253  +
        );
       35254  +
        let expected_headers = [("X-Foo", "Foo")];
       35255  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       35256  +
            http_response.headers(),
       35257  +
            expected_headers,
       35258  +
        ));
       35259  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       35260  +
            .await
       35261  +
            .expect("unable to extract body to bytes");
       35262  +
        // No body.
       35263  +
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       35264  +
    }
       35265  +
}
       35266  +
       35267  +
const CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE: ::mime::Mime = ::mime::APPLICATION_JSON;
33360  35268   
::pin_project_lite::pin_project! {
33361  35269   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33362         -
    /// [`TestPayloadStructureInput`](crate::input::TestPayloadStructureInput) using modelled bindings.
33363         -
    pub struct TestPayloadStructureInputFuture {
33364         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestPayloadStructureInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       35270  +
    /// [`HttpPrefixHeadersInResponseInput`](crate::input::HttpPrefixHeadersInResponseInput) using modelled bindings.
       35271  +
    pub struct HttpPrefixHeadersInResponseInputFuture {
       35272  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPrefixHeadersInResponseInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33365  35273   
    }
33366  35274   
}
33367  35275   
33368         -
impl std::future::Future for TestPayloadStructureInputFuture {
       35276  +
impl std::future::Future for HttpPrefixHeadersInResponseInputFuture {
33369  35277   
    type Output = Result<
33370         -
        crate::input::TestPayloadStructureInput,
       35278  +
        crate::input::HttpPrefixHeadersInResponseInput,
33371  35279   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33372  35280   
    >;
33373  35281   
33374  35282   
    fn poll(
33375  35283   
        self: std::pin::Pin<&mut Self>,
33376  35284   
        cx: &mut std::task::Context<'_>,
33377  35285   
    ) -> std::task::Poll<Self::Output> {
33378  35286   
        let this = self.project();
33379  35287   
        this.inner.as_mut().poll(cx)
33380  35288   
    }
33381  35289   
}
33382  35290   
33383  35291   
impl<B>
33384  35292   
    ::aws_smithy_http_server::request::FromRequest<
33385  35293   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33386  35294   
        B,
33387         -
    > for crate::input::TestPayloadStructureInput
       35295  +
    > for crate::input::HttpPrefixHeadersInResponseInput
33388  35296   
where
33389  35297   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33390  35298   
    B: 'static,
33391  35299   
33392  35300   
    B::Data: Send,
33393  35301   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33394  35302   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33395  35303   
{
33396  35304   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33397         -
    type Future = TestPayloadStructureInputFuture;
       35305  +
    type Future = HttpPrefixHeadersInResponseInputFuture;
33398  35306   
33399  35307   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33400  35308   
        let fut = async move {
33401  35309   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33402  35310   
                request.headers(),
33403         -
                &CONTENT_TYPE_TESTPAYLOADSTRUCTURE,
       35311  +
                &CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE,
33404  35312   
            ) {
33405  35313   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33406  35314   
            }
33407         -
            crate::protocol_serde::shape_test_payload_structure::de_test_payload_structure_http_request(request)
       35315  +
            crate::protocol_serde::shape_http_prefix_headers_in_response::de_http_prefix_headers_in_response_http_request(request)
33408  35316   
                            .await
33409  35317   
                            .map_err(Into::into)
33410  35318   
        };
33411  35319   
        use ::futures_util::future::TryFutureExt;
33412  35320   
        let fut = fut.map_err(
33413  35321   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33414  35322   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33415  35323   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33416  35324   
                    e,
33417  35325   
                )
33418  35326   
            },
33419  35327   
        );
33420         -
        TestPayloadStructureInputFuture {
       35328  +
        HttpPrefixHeadersInResponseInputFuture {
33421  35329   
            inner: Box::pin(fut),
33422  35330   
        }
33423  35331   
    }
33424  35332   
}
33425  35333   
impl
33426  35334   
    ::aws_smithy_http_server::response::IntoResponse<
33427  35335   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33428         -
    > for crate::output::TestPayloadStructureOutput
       35336  +
    > for crate::output::HttpPrefixHeadersInResponseOutput
33429  35337   
{
33430  35338   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33431         -
        match crate::protocol_serde::shape_test_payload_structure::ser_test_payload_structure_http_response(self) {
       35339  +
        match crate::protocol_serde::shape_http_prefix_headers_in_response::ser_http_prefix_headers_in_response_http_response(self) {
33432  35340   
                        Ok(response) => response,
33433  35341   
                        Err(e) => {
33434  35342   
                            ::tracing::error!(error = %e, "failed to serialize response");
33435  35343   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33436  35344   
                        }
33437  35345   
                    }
33438  35346   
    }
33439  35347   
}
33440  35348   
33441         -
const CONTENT_TYPE_TESTBODYSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
33442         -
::pin_project_lite::pin_project! {
33443         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33444         -
    /// [`TestBodyStructureInput`](crate::input::TestBodyStructureInput) using modelled bindings.
33445         -
    pub struct TestBodyStructureInputFuture {
33446         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TestBodyStructureInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33447         -
    }
33448         -
}
       35349  +
#[allow(unreachable_code, unused_variables)]
       35350  +
#[cfg(test)]
       35351  +
mod http_prefix_headers_in_response_test {
33449  35352   
33450         -
impl std::future::Future for TestBodyStructureInputFuture {
       35353  +
    /// (de)serializes all response headers
       35354  +
    /// Test ID: HttpPrefixHeadersResponse
       35355  +
    #[::tokio::test]
       35356  +
    #[::tracing_test::traced_test]
       35357  +
    async fn http_prefix_headers_response_response() {
       35358  +
        let output = crate::output::HttpPrefixHeadersInResponseOutput {
       35359  +
            prefix_headers: ::std::option::Option::Some({
       35360  +
                let mut ret = ::std::collections::HashMap::new();
       35361  +
                ret.insert("X-Foo".to_owned().to_ascii_lowercase(), "Foo".to_owned());
       35362  +
                ret.insert("Hello".to_owned().to_ascii_lowercase(), "Hello".to_owned());
       35363  +
                ret
       35364  +
            }),
       35365  +
        };
       35366  +
        use ::aws_smithy_http_server::response::IntoResponse;
       35367  +
        let http_response = output.into_response();
       35368  +
        ::pretty_assertions::assert_eq!(
       35369  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       35370  +
            http_response.status()
       35371  +
        );
       35372  +
        let expected_headers = [("Hello", "Hello"), ("X-Foo", "Foo")];
       35373  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       35374  +
            http_response.headers(),
       35375  +
            expected_headers,
       35376  +
        ));
       35377  +
    }
       35378  +
}
       35379  +
       35380  +
const CONTENT_TYPE_HTTPPREFIXHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
       35381  +
::pin_project_lite::pin_project! {
       35382  +
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
       35383  +
    /// [`HttpPrefixHeadersInput`](crate::input::HttpPrefixHeadersInput) using modelled bindings.
       35384  +
    pub struct HttpPrefixHeadersInputFuture {
       35385  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPrefixHeadersInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       35386  +
    }
       35387  +
}
       35388  +
       35389  +
impl std::future::Future for HttpPrefixHeadersInputFuture {
33451  35390   
    type Output = Result<
33452         -
        crate::input::TestBodyStructureInput,
       35391  +
        crate::input::HttpPrefixHeadersInput,
33453  35392   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33454  35393   
    >;
33455  35394   
33456  35395   
    fn poll(
33457  35396   
        self: std::pin::Pin<&mut Self>,
33458  35397   
        cx: &mut std::task::Context<'_>,
33459  35398   
    ) -> std::task::Poll<Self::Output> {
33460  35399   
        let this = self.project();
33461  35400   
        this.inner.as_mut().poll(cx)
33462  35401   
    }
33463  35402   
}
33464  35403   
33465  35404   
impl<B>
33466  35405   
    ::aws_smithy_http_server::request::FromRequest<
33467  35406   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33468  35407   
        B,
33469         -
    > for crate::input::TestBodyStructureInput
       35408  +
    > for crate::input::HttpPrefixHeadersInput
33470  35409   
where
33471  35410   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33472  35411   
    B: 'static,
33473  35412   
33474  35413   
    B::Data: Send,
33475  35414   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33476  35415   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33477  35416   
{
33478  35417   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33479         -
    type Future = TestBodyStructureInputFuture;
       35418  +
    type Future = HttpPrefixHeadersInputFuture;
33480  35419   
33481  35420   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33482  35421   
        let fut = async move {
33483  35422   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33484  35423   
                request.headers(),
33485         -
                &CONTENT_TYPE_TESTBODYSTRUCTURE,
       35424  +
                &CONTENT_TYPE_HTTPPREFIXHEADERS,
33486  35425   
            ) {
33487  35426   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33488  35427   
            }
33489         -
            crate::protocol_serde::shape_test_body_structure::de_test_body_structure_http_request(
       35428  +
            crate::protocol_serde::shape_http_prefix_headers::de_http_prefix_headers_http_request(
33490  35429   
                request,
33491  35430   
            )
33492  35431   
            .await
33493  35432   
            .map_err(Into::into)
33494  35433   
        };
33495  35434   
        use ::futures_util::future::TryFutureExt;
33496  35435   
        let fut = fut.map_err(
33497  35436   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33498  35437   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33499  35438   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33500  35439   
                    e,
33501  35440   
                )
33502  35441   
            },
33503  35442   
        );
33504         -
        TestBodyStructureInputFuture {
       35443  +
        HttpPrefixHeadersInputFuture {
33505  35444   
            inner: Box::pin(fut),
33506  35445   
        }
33507  35446   
    }
33508  35447   
}
33509  35448   
impl
33510  35449   
    ::aws_smithy_http_server::response::IntoResponse<
33511  35450   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33512         -
    > for crate::output::TestBodyStructureOutput
       35451  +
    > for crate::output::HttpPrefixHeadersOutput
33513  35452   
{
33514  35453   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33515         -
        match crate::protocol_serde::shape_test_body_structure::ser_test_body_structure_http_response(self) {
       35454  +
        match crate::protocol_serde::shape_http_prefix_headers::ser_http_prefix_headers_http_response(self) {
33516  35455   
                        Ok(response) => response,
33517  35456   
                        Err(e) => {
33518  35457   
                            ::tracing::error!(error = %e, "failed to serialize response");
33519  35458   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33520  35459   
                        }
33521  35460   
                    }
33522  35461   
    }
33523  35462   
}
33524  35463   
33525         -
static CONTENT_TYPE_MALFORMEDACCEPTWITHGENERICSTRING: ::once_cell::sync::Lazy<::mime::Mime> =
33526         -
    ::once_cell::sync::Lazy::new(|| {
33527         -
        "text/plain"
33528         -
            .parse::<::mime::Mime>()
33529         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
33530         -
    });
       35464  +
#[allow(unreachable_code, unused_variables)]
       35465  +
#[cfg(test)]
       35466  +
mod http_prefix_headers_test {
       35467  +
       35468  +
    /// Adds headers by prefix
       35469  +
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
       35470  +
    #[::tokio::test]
       35471  +
    #[::tracing_test::traced_test]
       35472  +
    async fn rest_json_http_prefix_headers_are_present_request() {
       35473  +
        #[allow(unused_mut)]
       35474  +
        let mut http_request = http::Request::builder()
       35475  +
            .uri("/HttpPrefixHeaders")
       35476  +
            .method("GET")
       35477  +
            .header("X-Foo", "Foo")
       35478  +
            .header("X-Foo-Abc", "Abc value")
       35479  +
            .header("X-Foo-Def", "Def value")
       35480  +
            .body(::aws_smithy_http_server::body::Body::from(
       35481  +
                ::bytes::Bytes::from_static("".as_bytes()),
       35482  +
            ))
       35483  +
            .unwrap();
       35484  +
        #[allow(unused_mut)]
       35485  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       35486  +
        let config = crate::service::RestJsonConfig::builder().build();
       35487  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       35488  +
            .http_prefix_headers(move |input: crate::input::HttpPrefixHeadersInput| {
       35489  +
                let sender = sender.clone();
       35490  +
                async move {
       35491  +
                    let result = {
       35492  +
                        let expected = crate::input::HttpPrefixHeadersInput {
       35493  +
                            foo: ::std::option::Option::Some("Foo".to_owned()),
       35494  +
                            foo_map: ::std::option::Option::Some({
       35495  +
                                let mut ret = ::std::collections::HashMap::new();
       35496  +
                                ret.insert(
       35497  +
                                    "Abc".to_owned().to_ascii_lowercase(),
       35498  +
                                    "Abc value".to_owned(),
       35499  +
                                );
       35500  +
                                ret.insert(
       35501  +
                                    "Def".to_owned().to_ascii_lowercase(),
       35502  +
                                    "Def value".to_owned(),
       35503  +
                                );
       35504  +
                                ret
       35505  +
                            }),
       35506  +
                        };
       35507  +
                        ::pretty_assertions::assert_eq!(input, expected);
       35508  +
                        let response = crate::output::HttpPrefixHeadersOutput {
       35509  +
                            foo: ::std::option::Option::None,
       35510  +
                            foo_map: ::std::option::Option::None,
       35511  +
                        };
       35512  +
                        response
       35513  +
                    };
       35514  +
                    sender.send(()).await.expect("receiver dropped early");
       35515  +
                    result
       35516  +
                }
       35517  +
            })
       35518  +
            .build_unchecked();
       35519  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       35520  +
            .await
       35521  +
            .expect("unable to make an HTTP request");
       35522  +
        assert!(
       35523  +
            receiver.recv().await.is_some(),
       35524  +
            "we expected operation handler to be invoked but it was not entered"
       35525  +
        );
       35526  +
    }
       35527  +
    /// Adds headers by prefix
       35528  +
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
       35529  +
    #[::tokio::test]
       35530  +
    #[::tracing_test::traced_test]
       35531  +
    async fn rest_json_http_prefix_headers_are_present_response() {
       35532  +
        let output = crate::output::HttpPrefixHeadersOutput {
       35533  +
            foo: ::std::option::Option::Some("Foo".to_owned()),
       35534  +
            foo_map: ::std::option::Option::Some({
       35535  +
                let mut ret = ::std::collections::HashMap::new();
       35536  +
                ret.insert(
       35537  +
                    "Abc".to_owned().to_ascii_lowercase(),
       35538  +
                    "Abc value".to_owned(),
       35539  +
                );
       35540  +
                ret.insert(
       35541  +
                    "Def".to_owned().to_ascii_lowercase(),
       35542  +
                    "Def value".to_owned(),
       35543  +
                );
       35544  +
                ret
       35545  +
            }),
       35546  +
        };
       35547  +
        use ::aws_smithy_http_server::response::IntoResponse;
       35548  +
        let http_response = output.into_response();
       35549  +
        ::pretty_assertions::assert_eq!(
       35550  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       35551  +
            http_response.status()
       35552  +
        );
       35553  +
        let expected_headers = [
       35554  +
            ("X-Foo", "Foo"),
       35555  +
            ("X-Foo-Abc", "Abc value"),
       35556  +
            ("X-Foo-Def", "Def value"),
       35557  +
        ];
       35558  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       35559  +
            http_response.headers(),
       35560  +
            expected_headers,
       35561  +
        ));
       35562  +
    }
       35563  +
}
       35564  +
       35565  +
const CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP: ::mime::Mime = ::mime::APPLICATION_JSON;
33531  35566   
::pin_project_lite::pin_project! {
33532  35567   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33533         -
    /// [`MalformedAcceptWithGenericStringInput`](crate::input::MalformedAcceptWithGenericStringInput) using modelled bindings.
33534         -
    pub struct MalformedAcceptWithGenericStringInputFuture {
33535         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedAcceptWithGenericStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       35568  +
    /// [`QueryParamsAsStringListMapInput`](crate::input::QueryParamsAsStringListMapInput) using modelled bindings.
       35569  +
    pub struct QueryParamsAsStringListMapInputFuture {
       35570  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::QueryParamsAsStringListMapInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33536  35571   
    }
33537  35572   
}
33538  35573   
33539         -
impl std::future::Future for MalformedAcceptWithGenericStringInputFuture {
       35574  +
impl std::future::Future for QueryParamsAsStringListMapInputFuture {
33540  35575   
    type Output = Result<
33541         -
        crate::input::MalformedAcceptWithGenericStringInput,
       35576  +
        crate::input::QueryParamsAsStringListMapInput,
33542  35577   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33543  35578   
    >;
33544  35579   
33545  35580   
    fn poll(
33546  35581   
        self: std::pin::Pin<&mut Self>,
33547  35582   
        cx: &mut std::task::Context<'_>,
33548  35583   
    ) -> std::task::Poll<Self::Output> {
33549  35584   
        let this = self.project();
33550  35585   
        this.inner.as_mut().poll(cx)
33551  35586   
    }
33552  35587   
}
33553  35588   
33554  35589   
impl<B>
33555  35590   
    ::aws_smithy_http_server::request::FromRequest<
33556  35591   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33557  35592   
        B,
33558         -
    > for crate::input::MalformedAcceptWithGenericStringInput
       35593  +
    > for crate::input::QueryParamsAsStringListMapInput
33559  35594   
where
33560  35595   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33561  35596   
    B: 'static,
33562  35597   
33563  35598   
    B::Data: Send,
33564  35599   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33565  35600   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33566  35601   
{
33567  35602   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33568         -
    type Future = MalformedAcceptWithGenericStringInputFuture;
       35603  +
    type Future = QueryParamsAsStringListMapInputFuture;
33569  35604   
33570  35605   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33571  35606   
        let fut = async move {
33572  35607   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33573  35608   
                request.headers(),
33574         -
                &CONTENT_TYPE_MALFORMEDACCEPTWITHGENERICSTRING,
       35609  +
                &CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP,
33575  35610   
            ) {
33576  35611   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33577  35612   
            }
33578         -
            crate::protocol_serde::shape_malformed_accept_with_generic_string::de_malformed_accept_with_generic_string_http_request(request)
       35613  +
            crate::protocol_serde::shape_query_params_as_string_list_map::de_query_params_as_string_list_map_http_request(request)
33579  35614   
                            .await
33580  35615   
                            .map_err(Into::into)
33581  35616   
        };
33582  35617   
        use ::futures_util::future::TryFutureExt;
33583  35618   
        let fut = fut.map_err(
33584  35619   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33585  35620   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33586  35621   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33587  35622   
                    e,
33588  35623   
                )
33589  35624   
            },
33590  35625   
        );
33591         -
        MalformedAcceptWithGenericStringInputFuture {
       35626  +
        QueryParamsAsStringListMapInputFuture {
33592  35627   
            inner: Box::pin(fut),
33593  35628   
        }
33594  35629   
    }
33595  35630   
}
33596  35631   
impl
33597  35632   
    ::aws_smithy_http_server::response::IntoResponse<
33598  35633   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33599         -
    > for crate::output::MalformedAcceptWithGenericStringOutput
       35634  +
    > for crate::output::QueryParamsAsStringListMapOutput
33600  35635   
{
33601  35636   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33602         -
        match crate::protocol_serde::shape_malformed_accept_with_generic_string::ser_malformed_accept_with_generic_string_http_response(self) {
       35637  +
        match crate::protocol_serde::shape_query_params_as_string_list_map::ser_query_params_as_string_list_map_http_response(self) {
33603  35638   
                        Ok(response) => response,
33604  35639   
                        Err(e) => {
33605  35640   
                            ::tracing::error!(error = %e, "failed to serialize response");
33606  35641   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33607  35642   
                        }
33608  35643   
                    }
33609  35644   
    }
33610  35645   
}
33611  35646   
33612         -
static CONTENT_TYPE_MALFORMEDACCEPTWITHPAYLOAD: ::once_cell::sync::Lazy<::mime::Mime> =
33613         -
    ::once_cell::sync::Lazy::new(|| {
33614         -
        "image/jpeg"
33615         -
            .parse::<::mime::Mime>()
33616         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
33617         -
    });
       35647  +
#[allow(unreachable_code, unused_variables)]
       35648  +
#[cfg(test)]
       35649  +
mod query_params_as_string_list_map_test {
       35650  +
       35651  +
    /// Servers put all query params in map
       35652  +
    /// Test ID: RestJsonServersQueryParamsStringListMap
       35653  +
    #[::tokio::test]
       35654  +
    #[::tracing_test::traced_test]
       35655  +
    async fn rest_json_servers_query_params_string_list_map_request() {
       35656  +
        #[allow(unused_mut)]
       35657  +
        let mut http_request = http::Request::builder()
       35658  +
            .uri("/StringListMap")
       35659  +
            .method("POST")
       35660  +
            .body(::aws_smithy_http_server::body::Body::from(
       35661  +
                ::bytes::Bytes::from_static("".as_bytes()),
       35662  +
            ))
       35663  +
            .unwrap();
       35664  +
        *http_request.uri_mut() = "/StringListMap?corge=named&baz=bar&baz=qux"
       35665  +
            .parse()
       35666  +
            .unwrap();
       35667  +
        #[allow(unused_mut)]
       35668  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       35669  +
        let config = crate::service::RestJsonConfig::builder().build();
       35670  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       35671  +
            .query_params_as_string_list_map(
       35672  +
                move |input: crate::input::QueryParamsAsStringListMapInput| {
       35673  +
                    let sender = sender.clone();
       35674  +
                    async move {
       35675  +
                        let result = {
       35676  +
                            let expected = crate::input::QueryParamsAsStringListMapInput {
       35677  +
                                qux: ::std::option::Option::Some("named".to_owned()),
       35678  +
                                foo: ::std::option::Option::Some({
       35679  +
                                    let mut ret = ::std::collections::HashMap::new();
       35680  +
                                    ret.insert("corge".to_owned(), vec!["named".to_owned()]);
       35681  +
                                    ret.insert(
       35682  +
                                        "baz".to_owned(),
       35683  +
                                        vec!["bar".to_owned(), "qux".to_owned()],
       35684  +
                                    );
       35685  +
                                    ret
       35686  +
                                }),
       35687  +
                            };
       35688  +
                            ::pretty_assertions::assert_eq!(input, expected);
       35689  +
                            let response = crate::output::QueryParamsAsStringListMapOutput {};
       35690  +
                            response
       35691  +
                        };
       35692  +
                        sender.send(()).await.expect("receiver dropped early");
       35693  +
                        result
       35694  +
                    }
       35695  +
                },
       35696  +
            )
       35697  +
            .build_unchecked();
       35698  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       35699  +
            .await
       35700  +
            .expect("unable to make an HTTP request");
       35701  +
        assert!(
       35702  +
            receiver.recv().await.is_some(),
       35703  +
            "we expected operation handler to be invoked but it was not entered"
       35704  +
        );
       35705  +
    }
       35706  +
}
       35707  +
       35708  +
const CONTENT_TYPE_QUERYPRECEDENCE: ::mime::Mime = ::mime::APPLICATION_JSON;
33618  35709   
::pin_project_lite::pin_project! {
33619  35710   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33620         -
    /// [`MalformedAcceptWithPayloadInput`](crate::input::MalformedAcceptWithPayloadInput) using modelled bindings.
33621         -
    pub struct MalformedAcceptWithPayloadInputFuture {
33622         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedAcceptWithPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       35711  +
    /// [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput) using modelled bindings.
       35712  +
    pub struct QueryPrecedenceInputFuture {
       35713  +
        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>>
33623  35714   
    }
33624  35715   
}
33625  35716   
33626         -
impl std::future::Future for MalformedAcceptWithPayloadInputFuture {
       35717  +
impl std::future::Future for QueryPrecedenceInputFuture {
33627  35718   
    type Output = Result<
33628         -
        crate::input::MalformedAcceptWithPayloadInput,
       35719  +
        crate::input::QueryPrecedenceInput,
33629  35720   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33630  35721   
    >;
33631  35722   
33632  35723   
    fn poll(
33633  35724   
        self: std::pin::Pin<&mut Self>,
33634  35725   
        cx: &mut std::task::Context<'_>,
33635  35726   
    ) -> std::task::Poll<Self::Output> {
33636  35727   
        let this = self.project();
33637  35728   
        this.inner.as_mut().poll(cx)
33638  35729   
    }
33639  35730   
}
33640  35731   
33641  35732   
impl<B>
33642  35733   
    ::aws_smithy_http_server::request::FromRequest<
33643  35734   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33644  35735   
        B,
33645         -
    > for crate::input::MalformedAcceptWithPayloadInput
       35736  +
    > for crate::input::QueryPrecedenceInput
33646  35737   
where
33647  35738   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33648  35739   
    B: 'static,
33649  35740   
33650  35741   
    B::Data: Send,
33651  35742   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33652  35743   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33653  35744   
{
33654  35745   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33655         -
    type Future = MalformedAcceptWithPayloadInputFuture;
       35746  +
    type Future = QueryPrecedenceInputFuture;
33656  35747   
33657  35748   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33658  35749   
        let fut = async move {
33659  35750   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33660  35751   
                request.headers(),
33661         -
                &CONTENT_TYPE_MALFORMEDACCEPTWITHPAYLOAD,
       35752  +
                &CONTENT_TYPE_QUERYPRECEDENCE,
33662  35753   
            ) {
33663  35754   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33664  35755   
            }
33665         -
            crate::protocol_serde::shape_malformed_accept_with_payload::de_malformed_accept_with_payload_http_request(request)
       35756  +
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_request(request)
33666  35757   
                .await
33667  35758   
                .map_err(Into::into)
33668  35759   
        };
33669  35760   
        use ::futures_util::future::TryFutureExt;
33670  35761   
        let fut = fut.map_err(
33671  35762   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33672  35763   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33673  35764   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33674  35765   
                    e,
33675  35766   
                )
33676  35767   
            },
33677  35768   
        );
33678         -
        MalformedAcceptWithPayloadInputFuture {
       35769  +
        QueryPrecedenceInputFuture {
33679  35770   
            inner: Box::pin(fut),
33680  35771   
        }
33681  35772   
    }
33682  35773   
}
33683  35774   
impl
33684  35775   
    ::aws_smithy_http_server::response::IntoResponse<
33685  35776   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33686         -
    > for crate::output::MalformedAcceptWithPayloadOutput
       35777  +
    > for crate::output::QueryPrecedenceOutput
33687  35778   
{
33688  35779   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33689         -
        match crate::protocol_serde::shape_malformed_accept_with_payload::ser_malformed_accept_with_payload_http_response(self) {
       35780  +
        match crate::protocol_serde::shape_query_precedence::ser_query_precedence_http_response(
       35781  +
            self,
       35782  +
        ) {
33690  35783   
            Ok(response) => response,
33691  35784   
            Err(e) => {
33692  35785   
                ::tracing::error!(error = %e, "failed to serialize response");
33693  35786   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33694  35787   
            }
33695  35788   
        }
33696  35789   
    }
33697  35790   
}
33698  35791   
33699         -
const CONTENT_TYPE_MALFORMEDACCEPTWITHBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
       35792  +
#[allow(unreachable_code, unused_variables)]
       35793  +
#[cfg(test)]
       35794  +
mod query_precedence_test {
       35795  +
       35796  +
    /// Servers put all query params in map
       35797  +
    /// Test ID: RestJsonServersPutAllQueryParamsInMap
       35798  +
    #[::tokio::test]
       35799  +
    #[::tracing_test::traced_test]
       35800  +
    async fn rest_json_servers_put_all_query_params_in_map_request() {
       35801  +
        #[allow(unused_mut)]
       35802  +
        let mut http_request = http::Request::builder()
       35803  +
            .uri("/Precedence")
       35804  +
            .method("POST")
       35805  +
            .body(::aws_smithy_http_server::body::Body::from(
       35806  +
                ::bytes::Bytes::from_static("".as_bytes()),
       35807  +
            ))
       35808  +
            .unwrap();
       35809  +
        *http_request.uri_mut() = "/Precedence?bar=named&qux=fromMap".parse().unwrap();
       35810  +
        #[allow(unused_mut)]
       35811  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       35812  +
        let config = crate::service::RestJsonConfig::builder().build();
       35813  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       35814  +
            .query_precedence(move |input: crate::input::QueryPrecedenceInput| {
       35815  +
                let sender = sender.clone();
       35816  +
                async move {
       35817  +
                    let result = {
       35818  +
                        let expected = crate::input::QueryPrecedenceInput {
       35819  +
                            foo: ::std::option::Option::Some("named".to_owned()),
       35820  +
                            baz: ::std::option::Option::Some({
       35821  +
                                let mut ret = ::std::collections::HashMap::new();
       35822  +
                                ret.insert("bar".to_owned(), "named".to_owned());
       35823  +
                                ret.insert("qux".to_owned(), "fromMap".to_owned());
       35824  +
                                ret
       35825  +
                            }),
       35826  +
                        };
       35827  +
                        ::pretty_assertions::assert_eq!(input, expected);
       35828  +
                        let response = crate::output::QueryPrecedenceOutput {};
       35829  +
                        response
       35830  +
                    };
       35831  +
                    sender.send(()).await.expect("receiver dropped early");
       35832  +
                    result
       35833  +
                }
       35834  +
            })
       35835  +
            .build_unchecked();
       35836  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       35837  +
            .await
       35838  +
            .expect("unable to make an HTTP request");
       35839  +
        assert!(
       35840  +
            receiver.recv().await.is_some(),
       35841  +
            "we expected operation handler to be invoked but it was not entered"
       35842  +
        );
       35843  +
    }
       35844  +
}
       35845  +
       35846  +
const CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL: ::mime::Mime = ::mime::APPLICATION_JSON;
33700  35847   
::pin_project_lite::pin_project! {
33701  35848   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33702         -
    /// [`MalformedAcceptWithBodyInput`](crate::input::MalformedAcceptWithBodyInput) using modelled bindings.
33703         -
    pub struct MalformedAcceptWithBodyInputFuture {
33704         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedAcceptWithBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       35849  +
    /// [`QueryIdempotencyTokenAutoFillInput`](crate::input::QueryIdempotencyTokenAutoFillInput) using modelled bindings.
       35850  +
    pub struct QueryIdempotencyTokenAutoFillInputFuture {
       35851  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::QueryIdempotencyTokenAutoFillInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33705  35852   
    }
33706  35853   
}
33707  35854   
33708         -
impl std::future::Future for MalformedAcceptWithBodyInputFuture {
       35855  +
impl std::future::Future for QueryIdempotencyTokenAutoFillInputFuture {
33709  35856   
    type Output = Result<
33710         -
        crate::input::MalformedAcceptWithBodyInput,
       35857  +
        crate::input::QueryIdempotencyTokenAutoFillInput,
33711  35858   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33712  35859   
    >;
33713  35860   
33714  35861   
    fn poll(
33715  35862   
        self: std::pin::Pin<&mut Self>,
33716  35863   
        cx: &mut std::task::Context<'_>,
33717  35864   
    ) -> std::task::Poll<Self::Output> {
33718  35865   
        let this = self.project();
33719  35866   
        this.inner.as_mut().poll(cx)
33720  35867   
    }
33721  35868   
}
33722  35869   
33723  35870   
impl<B>
33724  35871   
    ::aws_smithy_http_server::request::FromRequest<
33725  35872   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33726  35873   
        B,
33727         -
    > for crate::input::MalformedAcceptWithBodyInput
       35874  +
    > for crate::input::QueryIdempotencyTokenAutoFillInput
33728  35875   
where
33729  35876   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33730  35877   
    B: 'static,
33731  35878   
33732  35879   
    B::Data: Send,
33733  35880   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33734  35881   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33735  35882   
{
33736  35883   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33737         -
    type Future = MalformedAcceptWithBodyInputFuture;
       35884  +
    type Future = QueryIdempotencyTokenAutoFillInputFuture;
33738  35885   
33739  35886   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33740  35887   
        let fut = async move {
33741  35888   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33742  35889   
                request.headers(),
33743         -
                &CONTENT_TYPE_MALFORMEDACCEPTWITHBODY,
       35890  +
                &CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL,
33744  35891   
            ) {
33745  35892   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33746  35893   
            }
33747         -
            crate::protocol_serde::shape_malformed_accept_with_body::de_malformed_accept_with_body_http_request(request)
       35894  +
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_request(request)
33748  35895   
                            .await
33749  35896   
                            .map_err(Into::into)
33750  35897   
        };
33751  35898   
        use ::futures_util::future::TryFutureExt;
33752  35899   
        let fut = fut.map_err(
33753  35900   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33754  35901   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33755  35902   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33756  35903   
                    e,
33757  35904   
                )
33758  35905   
            },
33759  35906   
        );
33760         -
        MalformedAcceptWithBodyInputFuture {
       35907  +
        QueryIdempotencyTokenAutoFillInputFuture {
33761  35908   
            inner: Box::pin(fut),
33762  35909   
        }
33763  35910   
    }
33764  35911   
}
33765  35912   
impl
33766  35913   
    ::aws_smithy_http_server::response::IntoResponse<
33767  35914   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33768         -
    > for crate::output::MalformedAcceptWithBodyOutput
       35915  +
    > for crate::output::QueryIdempotencyTokenAutoFillOutput
33769  35916   
{
33770  35917   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33771         -
        match crate::protocol_serde::shape_malformed_accept_with_body::ser_malformed_accept_with_body_http_response(self) {
       35918  +
        match crate::protocol_serde::shape_query_idempotency_token_auto_fill::ser_query_idempotency_token_auto_fill_http_response(self) {
33772  35919   
                        Ok(response) => response,
33773  35920   
                        Err(e) => {
33774  35921   
                            ::tracing::error!(error = %e, "failed to serialize response");
33775  35922   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33776  35923   
                        }
33777  35924   
                    }
33778  35925   
    }
33779  35926   
}
33780  35927   
33781         -
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHGENERICSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
       35928  +
const CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
33782  35929   
::pin_project_lite::pin_project! {
33783  35930   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33784         -
    /// [`MalformedContentTypeWithGenericStringInput`](crate::input::MalformedContentTypeWithGenericStringInput) using modelled bindings.
33785         -
    pub struct MalformedContentTypeWithGenericStringInputFuture {
33786         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithGenericStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       35931  +
    /// [`OmitsSerializingEmptyListsInput`](crate::input::OmitsSerializingEmptyListsInput) using modelled bindings.
       35932  +
    pub struct OmitsSerializingEmptyListsInputFuture {
       35933  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OmitsSerializingEmptyListsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33787  35934   
    }
33788  35935   
}
33789  35936   
33790         -
impl std::future::Future for MalformedContentTypeWithGenericStringInputFuture {
       35937  +
impl std::future::Future for OmitsSerializingEmptyListsInputFuture {
33791  35938   
    type Output = Result<
33792         -
        crate::input::MalformedContentTypeWithGenericStringInput,
       35939  +
        crate::input::OmitsSerializingEmptyListsInput,
33793  35940   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33794  35941   
    >;
33795  35942   
33796  35943   
    fn poll(
33797  35944   
        self: std::pin::Pin<&mut Self>,
33798  35945   
        cx: &mut std::task::Context<'_>,
33799  35946   
    ) -> std::task::Poll<Self::Output> {
33800  35947   
        let this = self.project();
33801  35948   
        this.inner.as_mut().poll(cx)
33802  35949   
    }
33803  35950   
}
33804  35951   
33805  35952   
impl<B>
33806  35953   
    ::aws_smithy_http_server::request::FromRequest<
33807  35954   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33808  35955   
        B,
33809         -
    > for crate::input::MalformedContentTypeWithGenericStringInput
       35956  +
    > for crate::input::OmitsSerializingEmptyListsInput
33810  35957   
where
33811  35958   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33812  35959   
    B: 'static,
33813  35960   
33814  35961   
    B::Data: Send,
33815  35962   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33816  35963   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33817  35964   
{
33818  35965   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33819         -
    type Future = MalformedContentTypeWithGenericStringInputFuture;
       35966  +
    type Future = OmitsSerializingEmptyListsInputFuture;
33820  35967   
33821  35968   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33822  35969   
        let fut = async move {
33823  35970   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33824  35971   
                request.headers(),
33825         -
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHGENERICSTRING,
       35972  +
                &CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS,
33826  35973   
            ) {
33827  35974   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33828  35975   
            }
33829         -
            crate::protocol_serde::shape_malformed_content_type_with_generic_string::de_malformed_content_type_with_generic_string_http_request(request)
       35976  +
            crate::protocol_serde::shape_omits_serializing_empty_lists::de_omits_serializing_empty_lists_http_request(request)
33830  35977   
                            .await
33831  35978   
                            .map_err(Into::into)
33832  35979   
        };
33833  35980   
        use ::futures_util::future::TryFutureExt;
33834  35981   
        let fut = fut.map_err(
33835  35982   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33836  35983   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33837  35984   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33838  35985   
                    e,
33839  35986   
                )
33840  35987   
            },
33841  35988   
        );
33842         -
        MalformedContentTypeWithGenericStringInputFuture {
       35989  +
        OmitsSerializingEmptyListsInputFuture {
33843  35990   
            inner: Box::pin(fut),
33844  35991   
        }
33845  35992   
    }
33846  35993   
}
33847  35994   
impl
33848  35995   
    ::aws_smithy_http_server::response::IntoResponse<
33849  35996   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33850         -
    > for crate::output::MalformedContentTypeWithGenericStringOutput
       35997  +
    > for crate::output::OmitsSerializingEmptyListsOutput
33851  35998   
{
33852  35999   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33853         -
        match crate::protocol_serde::shape_malformed_content_type_with_generic_string::ser_malformed_content_type_with_generic_string_http_response(self) {
       36000  +
        match crate::protocol_serde::shape_omits_serializing_empty_lists::ser_omits_serializing_empty_lists_http_response(self) {
33854  36001   
                        Ok(response) => response,
33855  36002   
                        Err(e) => {
33856  36003   
                            ::tracing::error!(error = %e, "failed to serialize response");
33857  36004   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33858  36005   
                        }
33859  36006   
                    }
33860  36007   
    }
33861  36008   
}
       36009  +
impl
       36010  +
    ::aws_smithy_http_server::response::IntoResponse<
       36011  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       36012  +
    > for crate::error::OmitsSerializingEmptyListsError
       36013  +
{
       36014  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       36015  +
        match crate::protocol_serde::shape_omits_serializing_empty_lists::ser_omits_serializing_empty_lists_http_error(&self) {
       36016  +
            Ok(mut response) => {
       36017  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       36018  +
                response
       36019  +
            },
       36020  +
            Err(e) => {
       36021  +
                ::tracing::error!(error = %e, "failed to serialize response");
       36022  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       36023  +
            }
       36024  +
        }
       36025  +
    }
       36026  +
}
33862  36027   
33863         -
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
       36028  +
#[allow(unreachable_code, unused_variables)]
       36029  +
#[cfg(test)]
       36030  +
mod omits_serializing_empty_lists_test {
       36031  +
       36032  +
    /// Supports omitting empty lists.
       36033  +
    /// Test ID: RestJsonOmitsEmptyListQueryValues
       36034  +
    #[::tokio::test]
       36035  +
    #[::tracing_test::traced_test]
       36036  +
    #[should_panic]
       36037  +
    async fn rest_json_omits_empty_list_query_values_request() {
       36038  +
        #[allow(unused_mut)]
       36039  +
        let mut http_request = http::Request::builder()
       36040  +
            .uri("/OmitsSerializingEmptyLists")
       36041  +
            .method("POST")
       36042  +
            .body(::aws_smithy_http_server::body::Body::from(
       36043  +
                ::bytes::Bytes::from_static("".as_bytes()),
       36044  +
            ))
       36045  +
            .unwrap();
       36046  +
        #[allow(unused_mut)]
       36047  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       36048  +
        let config = crate::service::RestJsonConfig::builder().build();
       36049  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       36050  +
            .omits_serializing_empty_lists(
       36051  +
                move |input: crate::input::OmitsSerializingEmptyListsInput| {
       36052  +
                    let sender = sender.clone();
       36053  +
                    async move {
       36054  +
                        let result = {
       36055  +
                            let expected = crate::input::OmitsSerializingEmptyListsInput {
       36056  +
                                query_string_list: ::std::option::Option::Some(vec![]),
       36057  +
                                query_integer_list: ::std::option::Option::Some(vec![]),
       36058  +
                                query_double_list: ::std::option::Option::Some(vec![]),
       36059  +
                                query_boolean_list: ::std::option::Option::Some(vec![]),
       36060  +
                                query_timestamp_list: ::std::option::Option::Some(vec![]),
       36061  +
                                query_enum_list: ::std::option::Option::Some(vec![]),
       36062  +
                                query_integer_enum_list: ::std::option::Option::Some(vec![]),
       36063  +
                            };
       36064  +
                            ::pretty_assertions::assert_eq!(input, expected);
       36065  +
                            let response = crate::output::OmitsSerializingEmptyListsOutput {};
       36066  +
                            Ok(response)
       36067  +
                        };
       36068  +
                        sender.send(()).await.expect("receiver dropped early");
       36069  +
                        result
       36070  +
                    }
       36071  +
                },
       36072  +
            )
       36073  +
            .build_unchecked();
       36074  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       36075  +
            .await
       36076  +
            .expect("unable to make an HTTP request");
       36077  +
        assert!(
       36078  +
            receiver.recv().await.is_some(),
       36079  +
            "we expected operation handler to be invoked but it was not entered"
       36080  +
        );
       36081  +
    }
       36082  +
}
       36083  +
       36084  +
const CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
33864  36085   
::pin_project_lite::pin_project! {
33865  36086   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33866         -
    /// [`MalformedContentTypeWithPayloadInput`](crate::input::MalformedContentTypeWithPayloadInput) using modelled bindings.
33867         -
    pub struct MalformedContentTypeWithPayloadInputFuture {
33868         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       36087  +
    /// [`OmitsNullSerializesEmptyStringInput`](crate::input::OmitsNullSerializesEmptyStringInput) using modelled bindings.
       36088  +
    pub struct OmitsNullSerializesEmptyStringInputFuture {
       36089  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OmitsNullSerializesEmptyStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33869  36090   
    }
33870  36091   
}
33871  36092   
33872         -
impl std::future::Future for MalformedContentTypeWithPayloadInputFuture {
       36093  +
impl std::future::Future for OmitsNullSerializesEmptyStringInputFuture {
33873  36094   
    type Output = Result<
33874         -
        crate::input::MalformedContentTypeWithPayloadInput,
       36095  +
        crate::input::OmitsNullSerializesEmptyStringInput,
33875  36096   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33876  36097   
    >;
33877  36098   
33878  36099   
    fn poll(
33879  36100   
        self: std::pin::Pin<&mut Self>,
33880  36101   
        cx: &mut std::task::Context<'_>,
33881  36102   
    ) -> std::task::Poll<Self::Output> {
33882  36103   
        let this = self.project();
33883  36104   
        this.inner.as_mut().poll(cx)
33884  36105   
    }
33885  36106   
}
33886  36107   
33887  36108   
impl<B>
33888  36109   
    ::aws_smithy_http_server::request::FromRequest<
33889  36110   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33890  36111   
        B,
33891         -
    > for crate::input::MalformedContentTypeWithPayloadInput
       36112  +
    > for crate::input::OmitsNullSerializesEmptyStringInput
33892  36113   
where
33893  36114   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33894  36115   
    B: 'static,
33895  36116   
33896  36117   
    B::Data: Send,
33897  36118   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33898  36119   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33899  36120   
{
33900  36121   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33901         -
    type Future = MalformedContentTypeWithPayloadInputFuture;
       36122  +
    type Future = OmitsNullSerializesEmptyStringInputFuture;
33902  36123   
33903  36124   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33904  36125   
        let fut = async move {
33905  36126   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33906  36127   
                request.headers(),
33907         -
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHPAYLOAD,
       36128  +
                &CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING,
33908  36129   
            ) {
33909  36130   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33910  36131   
            }
33911         -
            crate::protocol_serde::shape_malformed_content_type_with_payload::de_malformed_content_type_with_payload_http_request(request)
       36132  +
            crate::protocol_serde::shape_omits_null_serializes_empty_string::de_omits_null_serializes_empty_string_http_request(request)
33912  36133   
                            .await
33913  36134   
                            .map_err(Into::into)
33914  36135   
        };
33915  36136   
        use ::futures_util::future::TryFutureExt;
33916  36137   
        let fut = fut.map_err(
33917  36138   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
33918  36139   
                ::tracing::debug!(error = %e, "failed to deserialize request");
33919  36140   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
33920  36141   
                    e,
33921  36142   
                )
33922  36143   
            },
33923  36144   
        );
33924         -
        MalformedContentTypeWithPayloadInputFuture {
       36145  +
        OmitsNullSerializesEmptyStringInputFuture {
33925  36146   
            inner: Box::pin(fut),
33926  36147   
        }
33927  36148   
    }
33928  36149   
}
33929  36150   
impl
33930  36151   
    ::aws_smithy_http_server::response::IntoResponse<
33931  36152   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33932         -
    > for crate::output::MalformedContentTypeWithPayloadOutput
       36153  +
    > for crate::output::OmitsNullSerializesEmptyStringOutput
33933  36154   
{
33934  36155   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
33935         -
        match crate::protocol_serde::shape_malformed_content_type_with_payload::ser_malformed_content_type_with_payload_http_response(self) {
       36156  +
        match crate::protocol_serde::shape_omits_null_serializes_empty_string::ser_omits_null_serializes_empty_string_http_response(self) {
33936  36157   
                        Ok(response) => response,
33937  36158   
                        Err(e) => {
33938  36159   
                            ::tracing::error!(error = %e, "failed to serialize response");
33939  36160   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
33940  36161   
                        }
33941  36162   
                    }
33942  36163   
    }
33943  36164   
}
33944  36165   
33945         -
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
33946         -
::pin_project_lite::pin_project! {
33947         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
33948         -
    /// [`MalformedContentTypeWithBodyInput`](crate::input::MalformedContentTypeWithBodyInput) using modelled bindings.
33949         -
    pub struct MalformedContentTypeWithBodyInputFuture {
33950         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
33951         -
    }
33952         -
}
33953         -
33954         -
impl std::future::Future for MalformedContentTypeWithBodyInputFuture {
33955         -
    type Output = Result<
33956         -
        crate::input::MalformedContentTypeWithBodyInput,
33957         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
33958         -
    >;
33959         -
33960         -
    fn poll(
33961         -
        self: std::pin::Pin<&mut Self>,
33962         -
        cx: &mut std::task::Context<'_>,
33963         -
    ) -> std::task::Poll<Self::Output> {
33964         -
        let this = self.project();
33965         -
        this.inner.as_mut().poll(cx)
33966         -
    }
33967         -
}
33968         -
33969         -
impl<B>
33970         -
    ::aws_smithy_http_server::request::FromRequest<
33971         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
33972         -
        B,
33973         -
    > for crate::input::MalformedContentTypeWithBodyInput
33974         -
where
33975         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
33976         -
    B: 'static,
33977         -
33978         -
    B::Data: Send,
33979         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
33980         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
33981         -
{
33982         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
33983         -
    type Future = MalformedContentTypeWithBodyInputFuture;
       36166  +
#[allow(unreachable_code, unused_variables)]
       36167  +
#[cfg(test)]
       36168  +
mod omits_null_serializes_empty_string_test {
33984  36169   
33985         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
33986         -
        let fut = async move {
33987         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
33988         -
                request.headers(),
33989         -
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHBODY,
33990         -
            ) {
33991         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
33992         -
            }
33993         -
            crate::protocol_serde::shape_malformed_content_type_with_body::de_malformed_content_type_with_body_http_request(request)
33994         -
                            .await
33995         -
                            .map_err(Into::into)
       36170  +
    /// Serializes empty query strings
       36171  +
    /// Test ID: RestJsonSerializesEmptyQueryValue
       36172  +
    #[::tokio::test]
       36173  +
    #[::tracing_test::traced_test]
       36174  +
    async fn rest_json_serializes_empty_query_value_request() {
       36175  +
        #[allow(unused_mut)]
       36176  +
        let mut http_request = http::Request::builder()
       36177  +
            .uri("/OmitsNullSerializesEmptyString")
       36178  +
            .method("GET")
       36179  +
            .body(::aws_smithy_http_server::body::Body::from(
       36180  +
                ::bytes::Bytes::from_static("".as_bytes()),
       36181  +
            ))
       36182  +
            .unwrap();
       36183  +
        *http_request.uri_mut() = "/OmitsNullSerializesEmptyString?Empty=".parse().unwrap();
       36184  +
        #[allow(unused_mut)]
       36185  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       36186  +
        let config = crate::service::RestJsonConfig::builder().build();
       36187  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       36188  +
            .omits_null_serializes_empty_string(
       36189  +
                move |input: crate::input::OmitsNullSerializesEmptyStringInput| {
       36190  +
                    let sender = sender.clone();
       36191  +
                    async move {
       36192  +
                        let result = {
       36193  +
                            let expected = crate::input::OmitsNullSerializesEmptyStringInput {
       36194  +
                                empty_string: ::std::option::Option::Some("".to_owned()),
       36195  +
                                null_value: ::std::option::Option::None,
33996  36196   
                            };
33997         -
        use ::futures_util::future::TryFutureExt;
33998         -
        let fut = fut.map_err(
33999         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34000         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34001         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34002         -
                    e,
34003         -
                )
       36197  +
                            ::pretty_assertions::assert_eq!(input, expected);
       36198  +
                            let response = crate::output::OmitsNullSerializesEmptyStringOutput {};
       36199  +
                            response
       36200  +
                        };
       36201  +
                        sender.send(()).await.expect("receiver dropped early");
       36202  +
                        result
       36203  +
                    }
34004  36204   
                },
       36205  +
            )
       36206  +
            .build_unchecked();
       36207  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       36208  +
            .await
       36209  +
            .expect("unable to make an HTTP request");
       36210  +
        assert!(
       36211  +
            receiver.recv().await.is_some(),
       36212  +
            "we expected operation handler to be invoked but it was not entered"
34005  36213   
        );
34006         -
        MalformedContentTypeWithBodyInputFuture {
34007         -
            inner: Box::pin(fut),
34008         -
        }
34009         -
    }
34010         -
}
34011         -
impl
34012         -
    ::aws_smithy_http_server::response::IntoResponse<
34013         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34014         -
    > for crate::output::MalformedContentTypeWithBodyOutput
34015         -
{
34016         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34017         -
        match crate::protocol_serde::shape_malformed_content_type_with_body::ser_malformed_content_type_with_body_http_response(self) {
34018         -
                        Ok(response) => response,
34019         -
                        Err(e) => {
34020         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34021         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34022  36214   
    }
       36215  +
    /// Servers accept static query params as empty strings.
       36216  +
    /// Test ID: RestJsonServersAcceptStaticQueryParamAsEmptyString
       36217  +
    #[::tokio::test]
       36218  +
    #[::tracing_test::traced_test]
       36219  +
    async fn rest_json_servers_accept_static_query_param_as_empty_string_request() {
       36220  +
        #[allow(unused_mut)]
       36221  +
        let mut http_request = http::Request::builder()
       36222  +
            .uri("/OmitsNullSerializesEmptyString")
       36223  +
            .method("GET")
       36224  +
            .body(::aws_smithy_http_server::body::Body::from(
       36225  +
                ::bytes::Bytes::from_static("".as_bytes()),
       36226  +
            ))
       36227  +
            .unwrap();
       36228  +
        *http_request.uri_mut() = "/OmitsNullSerializesEmptyString?Empty".parse().unwrap();
       36229  +
        #[allow(unused_mut)]
       36230  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       36231  +
        let config = crate::service::RestJsonConfig::builder().build();
       36232  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       36233  +
            .omits_null_serializes_empty_string(
       36234  +
                move |input: crate::input::OmitsNullSerializesEmptyStringInput| {
       36235  +
                    let sender = sender.clone();
       36236  +
                    async move {
       36237  +
                        let result = {
       36238  +
                            let expected = crate::input::OmitsNullSerializesEmptyStringInput {
       36239  +
                                empty_string: ::std::option::Option::Some("".to_owned()),
       36240  +
                                null_value: ::std::option::Option::None,
       36241  +
                            };
       36242  +
                            ::pretty_assertions::assert_eq!(input, expected);
       36243  +
                            let response = crate::output::OmitsNullSerializesEmptyStringOutput {};
       36244  +
                            response
       36245  +
                        };
       36246  +
                        sender.send(()).await.expect("receiver dropped early");
       36247  +
                        result
34023  36248   
                    }
       36249  +
                },
       36250  +
            )
       36251  +
            .build_unchecked();
       36252  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       36253  +
            .await
       36254  +
            .expect("unable to make an HTTP request");
       36255  +
        assert!(
       36256  +
            receiver.recv().await.is_some(),
       36257  +
            "we expected operation handler to be invoked but it was not entered"
       36258  +
        );
34024  36259   
    }
34025  36260   
}
34026  36261   
34027         -
const CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHOUTBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
       36262  +
const CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE: ::mime::Mime = ::mime::APPLICATION_JSON;
34028  36263   
::pin_project_lite::pin_project! {
34029  36264   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34030         -
    /// [`MalformedContentTypeWithoutBodyInput`](crate::input::MalformedContentTypeWithoutBodyInput) using modelled bindings.
34031         -
    pub struct MalformedContentTypeWithoutBodyInputFuture {
34032         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedContentTypeWithoutBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       36265  +
    /// [`IgnoreQueryParamsInResponseInput`](crate::input::IgnoreQueryParamsInResponseInput) using modelled bindings.
       36266  +
    pub struct IgnoreQueryParamsInResponseInputFuture {
       36267  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::IgnoreQueryParamsInResponseInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34033  36268   
    }
34034  36269   
}
34035  36270   
34036         -
impl std::future::Future for MalformedContentTypeWithoutBodyInputFuture {
       36271  +
impl std::future::Future for IgnoreQueryParamsInResponseInputFuture {
34037  36272   
    type Output = Result<
34038         -
        crate::input::MalformedContentTypeWithoutBodyInput,
       36273  +
        crate::input::IgnoreQueryParamsInResponseInput,
34039  36274   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34040  36275   
    >;
34041  36276   
34042  36277   
    fn poll(
34043  36278   
        self: std::pin::Pin<&mut Self>,
34044  36279   
        cx: &mut std::task::Context<'_>,
34045  36280   
    ) -> std::task::Poll<Self::Output> {
34046  36281   
        let this = self.project();
34047  36282   
        this.inner.as_mut().poll(cx)
34048  36283   
    }
34049  36284   
}
34050  36285   
34051  36286   
impl<B>
34052  36287   
    ::aws_smithy_http_server::request::FromRequest<
34053  36288   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34054  36289   
        B,
34055         -
    > for crate::input::MalformedContentTypeWithoutBodyInput
       36290  +
    > for crate::input::IgnoreQueryParamsInResponseInput
34056  36291   
where
34057  36292   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34058  36293   
    B: 'static,
34059  36294   
34060  36295   
    B::Data: Send,
34061  36296   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34062  36297   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34063  36298   
{
34064  36299   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34065         -
    type Future = MalformedContentTypeWithoutBodyInputFuture;
       36300  +
    type Future = IgnoreQueryParamsInResponseInputFuture;
34066  36301   
34067  36302   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34068  36303   
        let fut = async move {
34069  36304   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34070  36305   
                request.headers(),
34071         -
                &CONTENT_TYPE_MALFORMEDCONTENTTYPEWITHOUTBODY,
       36306  +
                &CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE,
34072  36307   
            ) {
34073  36308   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34074  36309   
            }
34075         -
            crate::protocol_serde::shape_malformed_content_type_without_body::de_malformed_content_type_without_body_http_request(request)
       36310  +
            crate::protocol_serde::shape_ignore_query_params_in_response::de_ignore_query_params_in_response_http_request(request)
34076  36311   
                            .await
34077  36312   
                            .map_err(Into::into)
34078  36313   
        };
34079  36314   
        use ::futures_util::future::TryFutureExt;
34080  36315   
        let fut = fut.map_err(
34081  36316   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34082  36317   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34083  36318   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34084  36319   
                    e,
34085  36320   
                )
34086  36321   
            },
34087  36322   
        );
34088         -
        MalformedContentTypeWithoutBodyInputFuture {
       36323  +
        IgnoreQueryParamsInResponseInputFuture {
34089  36324   
            inner: Box::pin(fut),
34090  36325   
        }
34091  36326   
    }
34092  36327   
}
34093  36328   
impl
34094  36329   
    ::aws_smithy_http_server::response::IntoResponse<
34095  36330   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34096         -
    > for crate::output::MalformedContentTypeWithoutBodyOutput
       36331  +
    > for crate::output::IgnoreQueryParamsInResponseOutput
34097  36332   
{
34098  36333   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34099         -
        match crate::protocol_serde::shape_malformed_content_type_without_body::ser_malformed_content_type_without_body_http_response(self) {
       36334  +
        match crate::protocol_serde::shape_ignore_query_params_in_response::ser_ignore_query_params_in_response_http_response(self) {
34100  36335   
                        Ok(response) => response,
34101  36336   
                        Err(e) => {
34102  36337   
                            ::tracing::error!(error = %e, "failed to serialize response");
34103  36338   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34104  36339   
                        }
34105  36340   
                    }
34106  36341   
    }
34107  36342   
}
34108  36343   
34109         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
       36344  +
#[allow(unreachable_code, unused_variables)]
       36345  +
#[cfg(test)]
       36346  +
mod ignore_query_params_in_response_test {
       36347  +
       36348  +
    /// Query parameters must be ignored when serializing the output
       36349  +
    /// of an operation. As of January 2021, server implementations
       36350  +
    /// are expected to respond with a JSON object regardless of
       36351  +
    /// if the output parameters are empty.
       36352  +
    /// Test ID: RestJsonIgnoreQueryParamsInResponse
       36353  +
    #[::tokio::test]
       36354  +
    #[::tracing_test::traced_test]
       36355  +
    async fn rest_json_ignore_query_params_in_response_response() {
       36356  +
        let output = crate::output::IgnoreQueryParamsInResponseOutput {
       36357  +
            baz: ::std::option::Option::None,
       36358  +
        };
       36359  +
        use ::aws_smithy_http_server::response::IntoResponse;
       36360  +
        let http_response = output.into_response();
       36361  +
        ::pretty_assertions::assert_eq!(
       36362  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       36363  +
            http_response.status()
       36364  +
        );
       36365  +
        let expected_headers = [("Content-Type", "application/json")];
       36366  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       36367  +
            http_response.headers(),
       36368  +
            expected_headers,
       36369  +
        ));
       36370  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       36371  +
            .await
       36372  +
            .expect("unable to extract body to bytes");
       36373  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       36374  +
            &body,
       36375  +
            "{}",
       36376  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       36377  +
        ));
       36378  +
    }
       36379  +
}
       36380  +
       36381  +
const CONTENT_TYPE_CONSTANTANDVARIABLEQUERYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
34110  36382   
::pin_project_lite::pin_project! {
34111  36383   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34112         -
    /// [`MalformedTimestampBodyHttpDateInput`](crate::input::MalformedTimestampBodyHttpDateInput) using modelled bindings.
34113         -
    pub struct MalformedTimestampBodyHttpDateInputFuture {
34114         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampBodyHttpDateInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       36384  +
    /// [`ConstantAndVariableQueryStringInput`](crate::input::ConstantAndVariableQueryStringInput) using modelled bindings.
       36385  +
    pub struct ConstantAndVariableQueryStringInputFuture {
       36386  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ConstantAndVariableQueryStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34115  36387   
    }
34116  36388   
}
34117  36389   
34118         -
impl std::future::Future for MalformedTimestampBodyHttpDateInputFuture {
       36390  +
impl std::future::Future for ConstantAndVariableQueryStringInputFuture {
34119  36391   
    type Output = Result<
34120         -
        crate::input::MalformedTimestampBodyHttpDateInput,
       36392  +
        crate::input::ConstantAndVariableQueryStringInput,
34121  36393   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34122  36394   
    >;
34123  36395   
34124  36396   
    fn poll(
34125  36397   
        self: std::pin::Pin<&mut Self>,
34126  36398   
        cx: &mut std::task::Context<'_>,
34127  36399   
    ) -> std::task::Poll<Self::Output> {
34128  36400   
        let this = self.project();
34129  36401   
        this.inner.as_mut().poll(cx)
34130  36402   
    }
34131  36403   
}
34132  36404   
34133  36405   
impl<B>
34134  36406   
    ::aws_smithy_http_server::request::FromRequest<
34135  36407   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34136  36408   
        B,
34137         -
    > for crate::input::MalformedTimestampBodyHttpDateInput
       36409  +
    > for crate::input::ConstantAndVariableQueryStringInput
34138  36410   
where
34139  36411   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34140  36412   
    B: 'static,
34141  36413   
34142  36414   
    B::Data: Send,
34143  36415   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34144  36416   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34145  36417   
{
34146  36418   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34147         -
    type Future = MalformedTimestampBodyHttpDateInputFuture;
       36419  +
    type Future = ConstantAndVariableQueryStringInputFuture;
34148  36420   
34149  36421   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34150  36422   
        let fut = async move {
34151  36423   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34152  36424   
                request.headers(),
34153         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYHTTPDATE,
       36425  +
                &CONTENT_TYPE_CONSTANTANDVARIABLEQUERYSTRING,
34154  36426   
            ) {
34155  36427   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34156  36428   
            }
34157         -
            crate::protocol_serde::shape_malformed_timestamp_body_http_date::de_malformed_timestamp_body_http_date_http_request(request)
       36429  +
            crate::protocol_serde::shape_constant_and_variable_query_string::de_constant_and_variable_query_string_http_request(request)
34158  36430   
                            .await
34159  36431   
                            .map_err(Into::into)
34160  36432   
        };
34161  36433   
        use ::futures_util::future::TryFutureExt;
34162  36434   
        let fut = fut.map_err(
34163  36435   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34164  36436   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34165  36437   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34166  36438   
                    e,
34167  36439   
                )
34168  36440   
            },
34169  36441   
        );
34170         -
        MalformedTimestampBodyHttpDateInputFuture {
       36442  +
        ConstantAndVariableQueryStringInputFuture {
34171  36443   
            inner: Box::pin(fut),
34172  36444   
        }
34173  36445   
    }
34174  36446   
}
34175  36447   
impl
34176  36448   
    ::aws_smithy_http_server::response::IntoResponse<
34177  36449   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34178         -
    > for crate::output::MalformedTimestampBodyHttpDateOutput
       36450  +
    > for crate::output::ConstantAndVariableQueryStringOutput
34179  36451   
{
34180  36452   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34181         -
        match crate::protocol_serde::shape_malformed_timestamp_body_http_date::ser_malformed_timestamp_body_http_date_http_response(self) {
       36453  +
        match crate::protocol_serde::shape_constant_and_variable_query_string::ser_constant_and_variable_query_string_http_response(self) {
34182  36454   
                        Ok(response) => response,
34183  36455   
                        Err(e) => {
34184  36456   
                            ::tracing::error!(error = %e, "failed to serialize response");
34185  36457   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34186  36458   
                        }
34187  36459   
                    }
34188  36460   
    }
34189  36461   
}
34190         -
impl
34191         -
    ::aws_smithy_http_server::response::IntoResponse<
34192         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34193         -
    > for crate::error::MalformedTimestampBodyHttpDateError
34194         -
{
34195         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34196         -
        match crate::protocol_serde::shape_malformed_timestamp_body_http_date::ser_malformed_timestamp_body_http_date_http_error(&self) {
34197         -
            Ok(mut response) => {
34198         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       36462  +
       36463  +
#[allow(unreachable_code, unused_variables)]
       36464  +
#[cfg(test)]
       36465  +
mod constant_and_variable_query_string_test {
       36466  +
       36467  +
    /// Mixes constant and variable query string parameters
       36468  +
    /// Test ID: RestJsonConstantAndVariableQueryStringMissingOneValue
       36469  +
    #[::tokio::test]
       36470  +
    #[::tracing_test::traced_test]
       36471  +
    async fn rest_json_constant_and_variable_query_string_missing_one_value_request() {
       36472  +
        #[allow(unused_mut)]
       36473  +
        let mut http_request = http::Request::builder()
       36474  +
            .uri("/ConstantAndVariableQueryString")
       36475  +
            .method("GET")
       36476  +
            .body(::aws_smithy_http_server::body::Body::from(
       36477  +
                ::bytes::Bytes::from_static("".as_bytes()),
       36478  +
            ))
       36479  +
            .unwrap();
       36480  +
        *http_request.uri_mut() = "/ConstantAndVariableQueryString?foo=bar&baz=bam"
       36481  +
            .parse()
       36482  +
            .unwrap();
       36483  +
        #[allow(unused_mut)]
       36484  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       36485  +
        let config = crate::service::RestJsonConfig::builder().build();
       36486  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       36487  +
            .constant_and_variable_query_string(
       36488  +
                move |input: crate::input::ConstantAndVariableQueryStringInput| {
       36489  +
                    let sender = sender.clone();
       36490  +
                    async move {
       36491  +
                        let result = {
       36492  +
                            let expected = crate::input::ConstantAndVariableQueryStringInput {
       36493  +
                                baz: ::std::option::Option::Some("bam".to_owned()),
       36494  +
                                maybe_set: ::std::option::Option::None,
       36495  +
                            };
       36496  +
                            ::pretty_assertions::assert_eq!(input, expected);
       36497  +
                            let response = crate::output::ConstantAndVariableQueryStringOutput {};
34199  36498   
                            response
       36499  +
                        };
       36500  +
                        sender.send(()).await.expect("receiver dropped early");
       36501  +
                        result
       36502  +
                    }
34200  36503   
                },
34201         -
            Err(e) => {
34202         -
                ::tracing::error!(error = %e, "failed to serialize response");
34203         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       36504  +
            )
       36505  +
            .build_unchecked();
       36506  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       36507  +
            .await
       36508  +
            .expect("unable to make an HTTP request");
       36509  +
        assert!(
       36510  +
            receiver.recv().await.is_some(),
       36511  +
            "we expected operation handler to be invoked but it was not entered"
       36512  +
        );
34204  36513   
    }
       36514  +
    /// Mixes constant and variable query string parameters
       36515  +
    /// Test ID: RestJsonConstantAndVariableQueryStringAllValues
       36516  +
    #[::tokio::test]
       36517  +
    #[::tracing_test::traced_test]
       36518  +
    async fn rest_json_constant_and_variable_query_string_all_values_request() {
       36519  +
        #[allow(unused_mut)]
       36520  +
        let mut http_request = http::Request::builder()
       36521  +
            .uri("/ConstantAndVariableQueryString")
       36522  +
            .method("GET")
       36523  +
            .body(::aws_smithy_http_server::body::Body::from(
       36524  +
                ::bytes::Bytes::from_static("".as_bytes()),
       36525  +
            ))
       36526  +
            .unwrap();
       36527  +
        *http_request.uri_mut() = "/ConstantAndVariableQueryString?foo=bar&baz=bam&maybeSet=yes"
       36528  +
            .parse()
       36529  +
            .unwrap();
       36530  +
        #[allow(unused_mut)]
       36531  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       36532  +
        let config = crate::service::RestJsonConfig::builder().build();
       36533  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       36534  +
            .constant_and_variable_query_string(
       36535  +
                move |input: crate::input::ConstantAndVariableQueryStringInput| {
       36536  +
                    let sender = sender.clone();
       36537  +
                    async move {
       36538  +
                        let result = {
       36539  +
                            let expected = crate::input::ConstantAndVariableQueryStringInput {
       36540  +
                                baz: ::std::option::Option::Some("bam".to_owned()),
       36541  +
                                maybe_set: ::std::option::Option::Some("yes".to_owned()),
       36542  +
                            };
       36543  +
                            ::pretty_assertions::assert_eq!(input, expected);
       36544  +
                            let response = crate::output::ConstantAndVariableQueryStringOutput {};
       36545  +
                            response
       36546  +
                        };
       36547  +
                        sender.send(()).await.expect("receiver dropped early");
       36548  +
                        result
34205  36549   
                    }
       36550  +
                },
       36551  +
            )
       36552  +
            .build_unchecked();
       36553  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       36554  +
            .await
       36555  +
            .expect("unable to make an HTTP request");
       36556  +
        assert!(
       36557  +
            receiver.recv().await.is_some(),
       36558  +
            "we expected operation handler to be invoked but it was not entered"
       36559  +
        );
34206  36560   
    }
34207  36561   
}
34208  36562   
34209         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDATETIME: ::mime::Mime = ::mime::APPLICATION_JSON;
       36563  +
const CONTENT_TYPE_CONSTANTQUERYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
34210  36564   
::pin_project_lite::pin_project! {
34211  36565   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34212         -
    /// [`MalformedTimestampBodyDateTimeInput`](crate::input::MalformedTimestampBodyDateTimeInput) using modelled bindings.
34213         -
    pub struct MalformedTimestampBodyDateTimeInputFuture {
34214         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampBodyDateTimeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       36566  +
    /// [`ConstantQueryStringInput`](crate::input::ConstantQueryStringInput) using modelled bindings.
       36567  +
    pub struct ConstantQueryStringInputFuture {
       36568  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ConstantQueryStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34215  36569   
    }
34216  36570   
}
34217  36571   
34218         -
impl std::future::Future for MalformedTimestampBodyDateTimeInputFuture {
       36572  +
impl std::future::Future for ConstantQueryStringInputFuture {
34219  36573   
    type Output = Result<
34220         -
        crate::input::MalformedTimestampBodyDateTimeInput,
       36574  +
        crate::input::ConstantQueryStringInput,
34221  36575   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34222  36576   
    >;
34223  36577   
34224  36578   
    fn poll(
34225  36579   
        self: std::pin::Pin<&mut Self>,
34226  36580   
        cx: &mut std::task::Context<'_>,
34227  36581   
    ) -> std::task::Poll<Self::Output> {
34228  36582   
        let this = self.project();
34229  36583   
        this.inner.as_mut().poll(cx)
34230  36584   
    }
34231  36585   
}
34232  36586   
34233  36587   
impl<B>
34234  36588   
    ::aws_smithy_http_server::request::FromRequest<
34235  36589   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34236  36590   
        B,
34237         -
    > for crate::input::MalformedTimestampBodyDateTimeInput
       36591  +
    > for crate::input::ConstantQueryStringInput
34238  36592   
where
34239  36593   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34240  36594   
    B: 'static,
34241  36595   
34242  36596   
    B::Data: Send,
34243  36597   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34244  36598   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34245  36599   
{
34246  36600   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34247         -
    type Future = MalformedTimestampBodyDateTimeInputFuture;
       36601  +
    type Future = ConstantQueryStringInputFuture;
34248  36602   
34249  36603   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34250  36604   
        let fut = async move {
34251  36605   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34252  36606   
                request.headers(),
34253         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDATETIME,
       36607  +
                &CONTENT_TYPE_CONSTANTQUERYSTRING,
34254  36608   
            ) {
34255  36609   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34256  36610   
            }
34257         -
            crate::protocol_serde::shape_malformed_timestamp_body_date_time::de_malformed_timestamp_body_date_time_http_request(request)
       36611  +
            crate::protocol_serde::shape_constant_query_string::de_constant_query_string_http_request(request)
34258  36612   
                            .await
34259  36613   
                            .map_err(Into::into)
34260  36614   
        };
34261  36615   
        use ::futures_util::future::TryFutureExt;
34262  36616   
        let fut = fut.map_err(
34263  36617   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34264  36618   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34265  36619   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34266  36620   
                    e,
34267  36621   
                )
34268  36622   
            },
34269  36623   
        );
34270         -
        MalformedTimestampBodyDateTimeInputFuture {
       36624  +
        ConstantQueryStringInputFuture {
34271  36625   
            inner: Box::pin(fut),
34272  36626   
        }
34273  36627   
    }
34274  36628   
}
34275  36629   
impl
34276  36630   
    ::aws_smithy_http_server::response::IntoResponse<
34277  36631   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34278         -
    > for crate::output::MalformedTimestampBodyDateTimeOutput
       36632  +
    > for crate::output::ConstantQueryStringOutput
34279  36633   
{
34280  36634   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34281         -
        match crate::protocol_serde::shape_malformed_timestamp_body_date_time::ser_malformed_timestamp_body_date_time_http_response(self) {
       36635  +
        match crate::protocol_serde::shape_constant_query_string::ser_constant_query_string_http_response(self) {
34282  36636   
                        Ok(response) => response,
34283  36637   
                        Err(e) => {
34284  36638   
                            ::tracing::error!(error = %e, "failed to serialize response");
34285  36639   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34286  36640   
                        }
34287  36641   
                    }
34288  36642   
    }
34289  36643   
}
34290  36644   
impl
34291  36645   
    ::aws_smithy_http_server::response::IntoResponse<
34292  36646   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34293         -
    > for crate::error::MalformedTimestampBodyDateTimeError
       36647  +
    > for crate::error::ConstantQueryStringError
34294  36648   
{
34295  36649   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34296         -
        match crate::protocol_serde::shape_malformed_timestamp_body_date_time::ser_malformed_timestamp_body_date_time_http_error(&self) {
       36650  +
        match crate::protocol_serde::shape_constant_query_string::ser_constant_query_string_http_error(&self) {
34297  36651   
            Ok(mut response) => {
34298  36652   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34299  36653   
                response
34300  36654   
            },
34301  36655   
            Err(e) => {
34302  36656   
                ::tracing::error!(error = %e, "failed to serialize response");
34303  36657   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34304  36658   
            }
34305  36659   
        }
34306  36660   
    }
34307  36661   
}
34308  36662   
34309         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
34310         -
::pin_project_lite::pin_project! {
34311         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34312         -
    /// [`MalformedTimestampBodyDefaultInput`](crate::input::MalformedTimestampBodyDefaultInput) using modelled bindings.
34313         -
    pub struct MalformedTimestampBodyDefaultInputFuture {
34314         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampBodyDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34315         -
    }
34316         -
}
34317         -
34318         -
impl std::future::Future for MalformedTimestampBodyDefaultInputFuture {
34319         -
    type Output = Result<
34320         -
        crate::input::MalformedTimestampBodyDefaultInput,
34321         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34322         -
    >;
34323         -
34324         -
    fn poll(
34325         -
        self: std::pin::Pin<&mut Self>,
34326         -
        cx: &mut std::task::Context<'_>,
34327         -
    ) -> std::task::Poll<Self::Output> {
34328         -
        let this = self.project();
34329         -
        this.inner.as_mut().poll(cx)
34330         -
    }
34331         -
}
34332         -
34333         -
impl<B>
34334         -
    ::aws_smithy_http_server::request::FromRequest<
34335         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34336         -
        B,
34337         -
    > for crate::input::MalformedTimestampBodyDefaultInput
34338         -
where
34339         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34340         -
    B: 'static,
34341         -
34342         -
    B::Data: Send,
34343         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34344         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34345         -
{
34346         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34347         -
    type Future = MalformedTimestampBodyDefaultInputFuture;
       36663  +
#[allow(unreachable_code, unused_variables)]
       36664  +
#[cfg(test)]
       36665  +
mod constant_query_string_test {
34348  36666   
34349         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34350         -
        let fut = async move {
34351         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34352         -
                request.headers(),
34353         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPBODYDEFAULT,
34354         -
            ) {
34355         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       36667  +
    /// Includes constant query string parameters
       36668  +
    /// Test ID: RestJsonConstantQueryString
       36669  +
    #[::tokio::test]
       36670  +
    #[::tracing_test::traced_test]
       36671  +
    async fn rest_json_constant_query_string_request() {
       36672  +
        #[allow(unused_mut)]
       36673  +
        let mut http_request = http::Request::builder()
       36674  +
            .uri("/ConstantQueryString/hi")
       36675  +
            .method("GET")
       36676  +
            .body(::aws_smithy_http_server::body::Body::from(
       36677  +
                ::bytes::Bytes::from_static("".as_bytes()),
       36678  +
            ))
       36679  +
            .unwrap();
       36680  +
        *http_request.uri_mut() = "/ConstantQueryString/hi?foo=bar&hello".parse().unwrap();
       36681  +
        #[allow(unused_mut)]
       36682  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       36683  +
        let config = crate::service::RestJsonConfig::builder().build();
       36684  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       36685  +
            .constant_query_string(move |input: crate::input::ConstantQueryStringInput| {
       36686  +
                let sender = sender.clone();
       36687  +
                async move {
       36688  +
                    let result = {
       36689  +
                        let expected = crate::input::ConstantQueryStringInput {
       36690  +
                            hello: "hi".to_owned(),
       36691  +
                        };
       36692  +
                        ::pretty_assertions::assert_eq!(input, expected);
       36693  +
                        let response = crate::output::ConstantQueryStringOutput {};
       36694  +
                        Ok(response)
       36695  +
                    };
       36696  +
                    sender.send(()).await.expect("receiver dropped early");
       36697  +
                    result
34356  36698   
                }
34357         -
            crate::protocol_serde::shape_malformed_timestamp_body_default::de_malformed_timestamp_body_default_http_request(request)
       36699  +
            })
       36700  +
            .build_unchecked();
       36701  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
34358  36702   
            .await
34359         -
                            .map_err(Into::into)
34360         -
        };
34361         -
        use ::futures_util::future::TryFutureExt;
34362         -
        let fut = fut.map_err(
34363         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34364         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34365         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34366         -
                    e,
34367         -
                )
34368         -
            },
       36703  +
            .expect("unable to make an HTTP request");
       36704  +
        assert!(
       36705  +
            receiver.recv().await.is_some(),
       36706  +
            "we expected operation handler to be invoked but it was not entered"
34369  36707   
        );
34370         -
        MalformedTimestampBodyDefaultInputFuture {
34371         -
            inner: Box::pin(fut),
34372         -
        }
34373         -
    }
34374         -
}
34375         -
impl
34376         -
    ::aws_smithy_http_server::response::IntoResponse<
34377         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34378         -
    > for crate::output::MalformedTimestampBodyDefaultOutput
34379         -
{
34380         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34381         -
        match crate::protocol_serde::shape_malformed_timestamp_body_default::ser_malformed_timestamp_body_default_http_response(self) {
34382         -
                        Ok(response) => response,
34383         -
                        Err(e) => {
34384         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34385         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34386         -
                        }
34387         -
                    }
34388         -
    }
34389         -
}
34390         -
impl
34391         -
    ::aws_smithy_http_server::response::IntoResponse<
34392         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34393         -
    > for crate::error::MalformedTimestampBodyDefaultError
34394         -
{
34395         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34396         -
        match crate::protocol_serde::shape_malformed_timestamp_body_default::ser_malformed_timestamp_body_default_http_error(&self) {
34397         -
            Ok(mut response) => {
34398         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34399         -
                response
34400         -
            },
34401         -
            Err(e) => {
34402         -
                ::tracing::error!(error = %e, "failed to serialize response");
34403         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34404         -
            }
34405         -
        }
34406  36708   
    }
34407  36709   
}
34408  36710   
34409         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADEREPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
       36711  +
const CONTENT_TYPE_ALLQUERYSTRINGTYPES: ::mime::Mime = ::mime::APPLICATION_JSON;
34410  36712   
::pin_project_lite::pin_project! {
34411  36713   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34412         -
    /// [`MalformedTimestampHeaderEpochInput`](crate::input::MalformedTimestampHeaderEpochInput) using modelled bindings.
34413         -
    pub struct MalformedTimestampHeaderEpochInputFuture {
34414         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampHeaderEpochInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       36714  +
    /// [`AllQueryStringTypesInput`](crate::input::AllQueryStringTypesInput) using modelled bindings.
       36715  +
    pub struct AllQueryStringTypesInputFuture {
       36716  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::AllQueryStringTypesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34415  36717   
    }
34416  36718   
}
34417  36719   
34418         -
impl std::future::Future for MalformedTimestampHeaderEpochInputFuture {
       36720  +
impl std::future::Future for AllQueryStringTypesInputFuture {
34419  36721   
    type Output = Result<
34420         -
        crate::input::MalformedTimestampHeaderEpochInput,
       36722  +
        crate::input::AllQueryStringTypesInput,
34421  36723   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34422  36724   
    >;
34423  36725   
34424  36726   
    fn poll(
34425  36727   
        self: std::pin::Pin<&mut Self>,
34426  36728   
        cx: &mut std::task::Context<'_>,
34427  36729   
    ) -> std::task::Poll<Self::Output> {
34428  36730   
        let this = self.project();
34429  36731   
        this.inner.as_mut().poll(cx)
34430  36732   
    }
34431  36733   
}
34432  36734   
34433  36735   
impl<B>
34434  36736   
    ::aws_smithy_http_server::request::FromRequest<
34435  36737   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34436  36738   
        B,
34437         -
    > for crate::input::MalformedTimestampHeaderEpochInput
       36739  +
    > for crate::input::AllQueryStringTypesInput
34438  36740   
where
34439  36741   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34440  36742   
    B: 'static,
34441  36743   
34442  36744   
    B::Data: Send,
34443  36745   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34444  36746   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34445  36747   
{
34446  36748   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34447         -
    type Future = MalformedTimestampHeaderEpochInputFuture;
       36749  +
    type Future = AllQueryStringTypesInputFuture;
34448  36750   
34449  36751   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34450  36752   
        let fut = async move {
34451  36753   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34452  36754   
                request.headers(),
34453         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADEREPOCH,
       36755  +
                &CONTENT_TYPE_ALLQUERYSTRINGTYPES,
34454  36756   
            ) {
34455  36757   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34456  36758   
            }
34457         -
            crate::protocol_serde::shape_malformed_timestamp_header_epoch::de_malformed_timestamp_header_epoch_http_request(request)
       36759  +
            crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_http_request(request)
34458  36760   
                            .await
34459  36761   
                            .map_err(Into::into)
34460  36762   
        };
34461  36763   
        use ::futures_util::future::TryFutureExt;
34462  36764   
        let fut = fut.map_err(
34463  36765   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34464  36766   
                ::tracing::debug!(error = %e, "failed to deserialize request");
34465  36767   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34466  36768   
                    e,
34467  36769   
                )
34468  36770   
            },
34469  36771   
        );
34470         -
        MalformedTimestampHeaderEpochInputFuture {
       36772  +
        AllQueryStringTypesInputFuture {
34471  36773   
            inner: Box::pin(fut),
34472  36774   
        }
34473  36775   
    }
34474  36776   
}
34475  36777   
impl
34476  36778   
    ::aws_smithy_http_server::response::IntoResponse<
34477  36779   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34478         -
    > for crate::output::MalformedTimestampHeaderEpochOutput
       36780  +
    > for crate::output::AllQueryStringTypesOutput
34479  36781   
{
34480  36782   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34481         -
        match crate::protocol_serde::shape_malformed_timestamp_header_epoch::ser_malformed_timestamp_header_epoch_http_response(self) {
       36783  +
        match crate::protocol_serde::shape_all_query_string_types::ser_all_query_string_types_http_response(self) {
34482  36784   
                        Ok(response) => response,
34483  36785   
                        Err(e) => {
34484  36786   
                            ::tracing::error!(error = %e, "failed to serialize response");
34485  36787   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34486  36788   
                        }
34487  36789   
                    }
34488  36790   
    }
34489  36791   
}
34490  36792   
impl
34491  36793   
    ::aws_smithy_http_server::response::IntoResponse<
34492  36794   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34493         -
    > for crate::error::MalformedTimestampHeaderEpochError
       36795  +
    > for crate::error::AllQueryStringTypesError
34494  36796   
{
34495  36797   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34496         -
        match crate::protocol_serde::shape_malformed_timestamp_header_epoch::ser_malformed_timestamp_header_epoch_http_error(&self) {
       36798  +
        match crate::protocol_serde::shape_all_query_string_types::ser_all_query_string_types_http_error(&self) {
34497  36799   
            Ok(mut response) => {
34498  36800   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34499  36801   
                response
34500  36802   
            },
34501  36803   
            Err(e) => {
34502  36804   
                ::tracing::error!(error = %e, "failed to serialize response");
34503  36805   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34504  36806   
            }
34505  36807   
        }
34506  36808   
    }
34507  36809   
}
34508  36810   
34509         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDATETIME: ::mime::Mime = ::mime::APPLICATION_JSON;
34510         -
::pin_project_lite::pin_project! {
34511         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34512         -
    /// [`MalformedTimestampHeaderDateTimeInput`](crate::input::MalformedTimestampHeaderDateTimeInput) using modelled bindings.
34513         -
    pub struct MalformedTimestampHeaderDateTimeInputFuture {
34514         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampHeaderDateTimeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34515         -
    }
34516         -
}
34517         -
34518         -
impl std::future::Future for MalformedTimestampHeaderDateTimeInputFuture {
34519         -
    type Output = Result<
34520         -
        crate::input::MalformedTimestampHeaderDateTimeInput,
34521         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34522         -
    >;
34523         -
34524         -
    fn poll(
34525         -
        self: std::pin::Pin<&mut Self>,
34526         -
        cx: &mut std::task::Context<'_>,
34527         -
    ) -> std::task::Poll<Self::Output> {
34528         -
        let this = self.project();
34529         -
        this.inner.as_mut().poll(cx)
34530         -
    }
34531         -
}
       36811  +
#[allow(unreachable_code, unused_variables)]
       36812  +
#[cfg(test)]
       36813  +
mod all_query_string_types_test {
34532  36814   
34533         -
impl<B>
34534         -
    ::aws_smithy_http_server::request::FromRequest<
34535         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34536         -
        B,
34537         -
    > for crate::input::MalformedTimestampHeaderDateTimeInput
34538         -
where
34539         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34540         -
    B: 'static,
34541         -
34542         -
    B::Data: Send,
34543         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34544         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34545         -
{
34546         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34547         -
    type Future = MalformedTimestampHeaderDateTimeInputFuture;
34548         -
34549         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34550         -
        let fut = async move {
34551         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34552         -
                request.headers(),
34553         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDATETIME,
34554         -
            ) {
34555         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34556         -
            }
34557         -
            crate::protocol_serde::shape_malformed_timestamp_header_date_time::de_malformed_timestamp_header_date_time_http_request(request)
34558         -
                            .await
34559         -
                            .map_err(Into::into)
34560         -
        };
34561         -
        use ::futures_util::future::TryFutureExt;
34562         -
        let fut = fut.map_err(
34563         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34564         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34565         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34566         -
                    e,
34567         -
                )
34568         -
            },
34569         -
        );
34570         -
        MalformedTimestampHeaderDateTimeInputFuture {
34571         -
            inner: Box::pin(fut),
34572         -
        }
34573         -
    }
34574         -
}
34575         -
impl
34576         -
    ::aws_smithy_http_server::response::IntoResponse<
34577         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34578         -
    > for crate::output::MalformedTimestampHeaderDateTimeOutput
34579         -
{
34580         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34581         -
        match crate::protocol_serde::shape_malformed_timestamp_header_date_time::ser_malformed_timestamp_header_date_time_http_response(self) {
34582         -
                        Ok(response) => response,
34583         -
                        Err(e) => {
34584         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34585         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34586         -
                        }
34587         -
                    }
34588         -
    }
34589         -
}
34590         -
impl
34591         -
    ::aws_smithy_http_server::response::IntoResponse<
34592         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34593         -
    > for crate::error::MalformedTimestampHeaderDateTimeError
34594         -
{
34595         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34596         -
        match crate::protocol_serde::shape_malformed_timestamp_header_date_time::ser_malformed_timestamp_header_date_time_http_error(&self) {
34597         -
            Ok(mut response) => {
34598         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34599         -
                response
34600         -
            },
34601         -
            Err(e) => {
34602         -
                ::tracing::error!(error = %e, "failed to serialize response");
34603         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34604         -
            }
34605         -
        }
34606         -
    }
34607         -
}
34608         -
34609         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
34610         -
::pin_project_lite::pin_project! {
34611         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34612         -
    /// [`MalformedTimestampHeaderDefaultInput`](crate::input::MalformedTimestampHeaderDefaultInput) using modelled bindings.
34613         -
    pub struct MalformedTimestampHeaderDefaultInputFuture {
34614         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampHeaderDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34615         -
    }
34616         -
}
34617         -
34618         -
impl std::future::Future for MalformedTimestampHeaderDefaultInputFuture {
34619         -
    type Output = Result<
34620         -
        crate::input::MalformedTimestampHeaderDefaultInput,
34621         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34622         -
    >;
34623         -
34624         -
    fn poll(
34625         -
        self: std::pin::Pin<&mut Self>,
34626         -
        cx: &mut std::task::Context<'_>,
34627         -
    ) -> std::task::Poll<Self::Output> {
34628         -
        let this = self.project();
34629         -
        this.inner.as_mut().poll(cx)
34630         -
    }
34631         -
}
34632         -
34633         -
impl<B>
34634         -
    ::aws_smithy_http_server::request::FromRequest<
34635         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34636         -
        B,
34637         -
    > for crate::input::MalformedTimestampHeaderDefaultInput
34638         -
where
34639         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34640         -
    B: 'static,
34641         -
34642         -
    B::Data: Send,
34643         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34644         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34645         -
{
34646         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34647         -
    type Future = MalformedTimestampHeaderDefaultInputFuture;
34648         -
34649         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34650         -
        let fut = async move {
34651         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34652         -
                request.headers(),
34653         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPHEADERDEFAULT,
34654         -
            ) {
34655         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34656         -
            }
34657         -
            crate::protocol_serde::shape_malformed_timestamp_header_default::de_malformed_timestamp_header_default_http_request(request)
34658         -
                            .await
34659         -
                            .map_err(Into::into)
34660         -
        };
34661         -
        use ::futures_util::future::TryFutureExt;
34662         -
        let fut = fut.map_err(
34663         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34664         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34665         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34666         -
                    e,
34667         -
                )
34668         -
            },
34669         -
        );
34670         -
        MalformedTimestampHeaderDefaultInputFuture {
34671         -
            inner: Box::pin(fut),
34672         -
        }
34673         -
    }
34674         -
}
34675         -
impl
34676         -
    ::aws_smithy_http_server::response::IntoResponse<
34677         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34678         -
    > for crate::output::MalformedTimestampHeaderDefaultOutput
34679         -
{
34680         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34681         -
        match crate::protocol_serde::shape_malformed_timestamp_header_default::ser_malformed_timestamp_header_default_http_response(self) {
34682         -
                        Ok(response) => response,
34683         -
                        Err(e) => {
34684         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34685         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34686         -
                        }
34687         -
                    }
34688         -
    }
34689         -
}
34690         -
impl
34691         -
    ::aws_smithy_http_server::response::IntoResponse<
34692         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34693         -
    > for crate::error::MalformedTimestampHeaderDefaultError
34694         -
{
34695         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34696         -
        match crate::protocol_serde::shape_malformed_timestamp_header_default::ser_malformed_timestamp_header_default_http_error(&self) {
34697         -
            Ok(mut response) => {
34698         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34699         -
                response
34700         -
            },
34701         -
            Err(e) => {
34702         -
                ::tracing::error!(error = %e, "failed to serialize response");
34703         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34704         -
            }
34705         -
        }
34706         -
    }
34707         -
}
34708         -
34709         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYEPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
34710         -
::pin_project_lite::pin_project! {
34711         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34712         -
    /// [`MalformedTimestampQueryEpochInput`](crate::input::MalformedTimestampQueryEpochInput) using modelled bindings.
34713         -
    pub struct MalformedTimestampQueryEpochInputFuture {
34714         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampQueryEpochInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34715         -
    }
34716         -
}
34717         -
34718         -
impl std::future::Future for MalformedTimestampQueryEpochInputFuture {
34719         -
    type Output = Result<
34720         -
        crate::input::MalformedTimestampQueryEpochInput,
34721         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34722         -
    >;
34723         -
34724         -
    fn poll(
34725         -
        self: std::pin::Pin<&mut Self>,
34726         -
        cx: &mut std::task::Context<'_>,
34727         -
    ) -> std::task::Poll<Self::Output> {
34728         -
        let this = self.project();
34729         -
        this.inner.as_mut().poll(cx)
34730         -
    }
34731         -
}
34732         -
34733         -
impl<B>
34734         -
    ::aws_smithy_http_server::request::FromRequest<
34735         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34736         -
        B,
34737         -
    > for crate::input::MalformedTimestampQueryEpochInput
34738         -
where
34739         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34740         -
    B: 'static,
34741         -
34742         -
    B::Data: Send,
34743         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34744         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34745         -
{
34746         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34747         -
    type Future = MalformedTimestampQueryEpochInputFuture;
34748         -
34749         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34750         -
        let fut = async move {
34751         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34752         -
                request.headers(),
34753         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYEPOCH,
34754         -
            ) {
34755         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34756         -
            }
34757         -
            crate::protocol_serde::shape_malformed_timestamp_query_epoch::de_malformed_timestamp_query_epoch_http_request(request)
34758         -
                            .await
34759         -
                            .map_err(Into::into)
34760         -
        };
34761         -
        use ::futures_util::future::TryFutureExt;
34762         -
        let fut = fut.map_err(
34763         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34764         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34765         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34766         -
                    e,
34767         -
                )
34768         -
            },
34769         -
        );
34770         -
        MalformedTimestampQueryEpochInputFuture {
34771         -
            inner: Box::pin(fut),
34772         -
        }
34773         -
    }
34774         -
}
34775         -
impl
34776         -
    ::aws_smithy_http_server::response::IntoResponse<
34777         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34778         -
    > for crate::output::MalformedTimestampQueryEpochOutput
34779         -
{
34780         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34781         -
        match crate::protocol_serde::shape_malformed_timestamp_query_epoch::ser_malformed_timestamp_query_epoch_http_response(self) {
34782         -
                        Ok(response) => response,
34783         -
                        Err(e) => {
34784         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34785         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34786         -
                        }
34787         -
                    }
34788         -
    }
34789         -
}
34790         -
impl
34791         -
    ::aws_smithy_http_server::response::IntoResponse<
34792         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34793         -
    > for crate::error::MalformedTimestampQueryEpochError
34794         -
{
34795         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34796         -
        match crate::protocol_serde::shape_malformed_timestamp_query_epoch::ser_malformed_timestamp_query_epoch_http_error(&self) {
34797         -
            Ok(mut response) => {
34798         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34799         -
                response
34800         -
            },
34801         -
            Err(e) => {
34802         -
                ::tracing::error!(error = %e, "failed to serialize response");
34803         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34804         -
            }
34805         -
        }
34806         -
    }
34807         -
}
34808         -
34809         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
34810         -
::pin_project_lite::pin_project! {
34811         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34812         -
    /// [`MalformedTimestampQueryHttpDateInput`](crate::input::MalformedTimestampQueryHttpDateInput) using modelled bindings.
34813         -
    pub struct MalformedTimestampQueryHttpDateInputFuture {
34814         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampQueryHttpDateInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34815         -
    }
34816         -
}
34817         -
34818         -
impl std::future::Future for MalformedTimestampQueryHttpDateInputFuture {
34819         -
    type Output = Result<
34820         -
        crate::input::MalformedTimestampQueryHttpDateInput,
34821         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34822         -
    >;
34823         -
34824         -
    fn poll(
34825         -
        self: std::pin::Pin<&mut Self>,
34826         -
        cx: &mut std::task::Context<'_>,
34827         -
    ) -> std::task::Poll<Self::Output> {
34828         -
        let this = self.project();
34829         -
        this.inner.as_mut().poll(cx)
34830         -
    }
34831         -
}
34832         -
34833         -
impl<B>
34834         -
    ::aws_smithy_http_server::request::FromRequest<
34835         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34836         -
        B,
34837         -
    > for crate::input::MalformedTimestampQueryHttpDateInput
34838         -
where
34839         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34840         -
    B: 'static,
34841         -
34842         -
    B::Data: Send,
34843         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34844         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34845         -
{
34846         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34847         -
    type Future = MalformedTimestampQueryHttpDateInputFuture;
34848         -
34849         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34850         -
        let fut = async move {
34851         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34852         -
                request.headers(),
34853         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYHTTPDATE,
34854         -
            ) {
34855         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34856         -
            }
34857         -
            crate::protocol_serde::shape_malformed_timestamp_query_http_date::de_malformed_timestamp_query_http_date_http_request(request)
34858         -
                            .await
34859         -
                            .map_err(Into::into)
34860         -
        };
34861         -
        use ::futures_util::future::TryFutureExt;
34862         -
        let fut = fut.map_err(
34863         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34864         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34865         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34866         -
                    e,
34867         -
                )
34868         -
            },
34869         -
        );
34870         -
        MalformedTimestampQueryHttpDateInputFuture {
34871         -
            inner: Box::pin(fut),
34872         -
        }
34873         -
    }
34874         -
}
34875         -
impl
34876         -
    ::aws_smithy_http_server::response::IntoResponse<
34877         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34878         -
    > for crate::output::MalformedTimestampQueryHttpDateOutput
34879         -
{
34880         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34881         -
        match crate::protocol_serde::shape_malformed_timestamp_query_http_date::ser_malformed_timestamp_query_http_date_http_response(self) {
34882         -
                        Ok(response) => response,
34883         -
                        Err(e) => {
34884         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34885         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34886         -
                        }
34887         -
                    }
34888         -
    }
34889         -
}
34890         -
impl
34891         -
    ::aws_smithy_http_server::response::IntoResponse<
34892         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34893         -
    > for crate::error::MalformedTimestampQueryHttpDateError
34894         -
{
34895         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34896         -
        match crate::protocol_serde::shape_malformed_timestamp_query_http_date::ser_malformed_timestamp_query_http_date_http_error(&self) {
34897         -
            Ok(mut response) => {
34898         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34899         -
                response
34900         -
            },
34901         -
            Err(e) => {
34902         -
                ::tracing::error!(error = %e, "failed to serialize response");
34903         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34904         -
            }
34905         -
        }
34906         -
    }
34907         -
}
34908         -
34909         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
34910         -
::pin_project_lite::pin_project! {
34911         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
34912         -
    /// [`MalformedTimestampQueryDefaultInput`](crate::input::MalformedTimestampQueryDefaultInput) using modelled bindings.
34913         -
    pub struct MalformedTimestampQueryDefaultInputFuture {
34914         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampQueryDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
34915         -
    }
34916         -
}
34917         -
34918         -
impl std::future::Future for MalformedTimestampQueryDefaultInputFuture {
34919         -
    type Output = Result<
34920         -
        crate::input::MalformedTimestampQueryDefaultInput,
34921         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
34922         -
    >;
34923         -
34924         -
    fn poll(
34925         -
        self: std::pin::Pin<&mut Self>,
34926         -
        cx: &mut std::task::Context<'_>,
34927         -
    ) -> std::task::Poll<Self::Output> {
34928         -
        let this = self.project();
34929         -
        this.inner.as_mut().poll(cx)
34930         -
    }
34931         -
}
34932         -
34933         -
impl<B>
34934         -
    ::aws_smithy_http_server::request::FromRequest<
34935         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34936         -
        B,
34937         -
    > for crate::input::MalformedTimestampQueryDefaultInput
34938         -
where
34939         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
34940         -
    B: 'static,
34941         -
34942         -
    B::Data: Send,
34943         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
34944         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
34945         -
{
34946         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
34947         -
    type Future = MalformedTimestampQueryDefaultInputFuture;
34948         -
34949         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
34950         -
        let fut = async move {
34951         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
34952         -
                request.headers(),
34953         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPQUERYDEFAULT,
34954         -
            ) {
34955         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
34956         -
            }
34957         -
            crate::protocol_serde::shape_malformed_timestamp_query_default::de_malformed_timestamp_query_default_http_request(request)
34958         -
                            .await
34959         -
                            .map_err(Into::into)
34960         -
        };
34961         -
        use ::futures_util::future::TryFutureExt;
34962         -
        let fut = fut.map_err(
34963         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
34964         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
34965         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
34966         -
                    e,
34967         -
                )
34968         -
            },
34969         -
        );
34970         -
        MalformedTimestampQueryDefaultInputFuture {
34971         -
            inner: Box::pin(fut),
34972         -
        }
34973         -
    }
34974         -
}
34975         -
impl
34976         -
    ::aws_smithy_http_server::response::IntoResponse<
34977         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34978         -
    > for crate::output::MalformedTimestampQueryDefaultOutput
34979         -
{
34980         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34981         -
        match crate::protocol_serde::shape_malformed_timestamp_query_default::ser_malformed_timestamp_query_default_http_response(self) {
34982         -
                        Ok(response) => response,
34983         -
                        Err(e) => {
34984         -
                            ::tracing::error!(error = %e, "failed to serialize response");
34985         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
34986         -
                        }
34987         -
                    }
34988         -
    }
34989         -
}
34990         -
impl
34991         -
    ::aws_smithy_http_server::response::IntoResponse<
34992         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
34993         -
    > for crate::error::MalformedTimestampQueryDefaultError
34994         -
{
34995         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
34996         -
        match crate::protocol_serde::shape_malformed_timestamp_query_default::ser_malformed_timestamp_query_default_http_error(&self) {
34997         -
            Ok(mut response) => {
34998         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
34999         -
                response
35000         -
            },
35001         -
            Err(e) => {
35002         -
                ::tracing::error!(error = %e, "failed to serialize response");
35003         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35004         -
            }
35005         -
        }
35006         -
    }
35007         -
}
35008         -
35009         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHEPOCH: ::mime::Mime = ::mime::APPLICATION_JSON;
35010         -
::pin_project_lite::pin_project! {
35011         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35012         -
    /// [`MalformedTimestampPathEpochInput`](crate::input::MalformedTimestampPathEpochInput) using modelled bindings.
35013         -
    pub struct MalformedTimestampPathEpochInputFuture {
35014         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampPathEpochInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35015         -
    }
35016         -
}
35017         -
35018         -
impl std::future::Future for MalformedTimestampPathEpochInputFuture {
35019         -
    type Output = Result<
35020         -
        crate::input::MalformedTimestampPathEpochInput,
35021         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35022         -
    >;
35023         -
35024         -
    fn poll(
35025         -
        self: std::pin::Pin<&mut Self>,
35026         -
        cx: &mut std::task::Context<'_>,
35027         -
    ) -> std::task::Poll<Self::Output> {
35028         -
        let this = self.project();
35029         -
        this.inner.as_mut().poll(cx)
35030         -
    }
35031         -
}
35032         -
35033         -
impl<B>
35034         -
    ::aws_smithy_http_server::request::FromRequest<
35035         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35036         -
        B,
35037         -
    > for crate::input::MalformedTimestampPathEpochInput
35038         -
where
35039         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35040         -
    B: 'static,
35041         -
35042         -
    B::Data: Send,
35043         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35044         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35045         -
{
35046         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35047         -
    type Future = MalformedTimestampPathEpochInputFuture;
35048         -
35049         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35050         -
        let fut = async move {
35051         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35052         -
                request.headers(),
35053         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHEPOCH,
35054         -
            ) {
35055         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35056         -
            }
35057         -
            crate::protocol_serde::shape_malformed_timestamp_path_epoch::de_malformed_timestamp_path_epoch_http_request(request)
35058         -
                            .await
35059         -
                            .map_err(Into::into)
35060         -
        };
35061         -
        use ::futures_util::future::TryFutureExt;
35062         -
        let fut = fut.map_err(
35063         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35064         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35065         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35066         -
                    e,
35067         -
                )
35068         -
            },
35069         -
        );
35070         -
        MalformedTimestampPathEpochInputFuture {
35071         -
            inner: Box::pin(fut),
35072         -
        }
35073         -
    }
35074         -
}
35075         -
impl
35076         -
    ::aws_smithy_http_server::response::IntoResponse<
35077         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35078         -
    > for crate::output::MalformedTimestampPathEpochOutput
35079         -
{
35080         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35081         -
        match crate::protocol_serde::shape_malformed_timestamp_path_epoch::ser_malformed_timestamp_path_epoch_http_response(self) {
35082         -
                        Ok(response) => response,
35083         -
                        Err(e) => {
35084         -
                            ::tracing::error!(error = %e, "failed to serialize response");
35085         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35086         -
                        }
35087         -
                    }
35088         -
    }
35089         -
}
35090         -
impl
35091         -
    ::aws_smithy_http_server::response::IntoResponse<
35092         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35093         -
    > for crate::error::MalformedTimestampPathEpochError
35094         -
{
35095         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35096         -
        match crate::protocol_serde::shape_malformed_timestamp_path_epoch::ser_malformed_timestamp_path_epoch_http_error(&self) {
35097         -
            Ok(mut response) => {
35098         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
35099         -
                response
35100         -
            },
35101         -
            Err(e) => {
35102         -
                ::tracing::error!(error = %e, "failed to serialize response");
35103         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35104         -
            }
35105         -
        }
35106         -
    }
35107         -
}
35108         -
35109         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHHTTPDATE: ::mime::Mime = ::mime::APPLICATION_JSON;
35110         -
::pin_project_lite::pin_project! {
35111         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35112         -
    /// [`MalformedTimestampPathHttpDateInput`](crate::input::MalformedTimestampPathHttpDateInput) using modelled bindings.
35113         -
    pub struct MalformedTimestampPathHttpDateInputFuture {
35114         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampPathHttpDateInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35115         -
    }
35116         -
}
35117         -
35118         -
impl std::future::Future for MalformedTimestampPathHttpDateInputFuture {
35119         -
    type Output = Result<
35120         -
        crate::input::MalformedTimestampPathHttpDateInput,
35121         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35122         -
    >;
35123         -
35124         -
    fn poll(
35125         -
        self: std::pin::Pin<&mut Self>,
35126         -
        cx: &mut std::task::Context<'_>,
35127         -
    ) -> std::task::Poll<Self::Output> {
35128         -
        let this = self.project();
35129         -
        this.inner.as_mut().poll(cx)
35130         -
    }
35131         -
}
35132         -
35133         -
impl<B>
35134         -
    ::aws_smithy_http_server::request::FromRequest<
35135         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35136         -
        B,
35137         -
    > for crate::input::MalformedTimestampPathHttpDateInput
35138         -
where
35139         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35140         -
    B: 'static,
35141         -
35142         -
    B::Data: Send,
35143         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35144         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35145         -
{
35146         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35147         -
    type Future = MalformedTimestampPathHttpDateInputFuture;
35148         -
35149         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35150         -
        let fut = async move {
35151         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35152         -
                request.headers(),
35153         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHHTTPDATE,
35154         -
            ) {
35155         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35156         -
            }
35157         -
            crate::protocol_serde::shape_malformed_timestamp_path_http_date::de_malformed_timestamp_path_http_date_http_request(request)
35158         -
                            .await
35159         -
                            .map_err(Into::into)
35160         -
        };
35161         -
        use ::futures_util::future::TryFutureExt;
35162         -
        let fut = fut.map_err(
35163         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35164         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35165         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35166         -
                    e,
35167         -
                )
35168         -
            },
35169         -
        );
35170         -
        MalformedTimestampPathHttpDateInputFuture {
35171         -
            inner: Box::pin(fut),
35172         -
        }
35173         -
    }
35174         -
}
35175         -
impl
35176         -
    ::aws_smithy_http_server::response::IntoResponse<
35177         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35178         -
    > for crate::output::MalformedTimestampPathHttpDateOutput
35179         -
{
35180         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35181         -
        match crate::protocol_serde::shape_malformed_timestamp_path_http_date::ser_malformed_timestamp_path_http_date_http_response(self) {
35182         -
                        Ok(response) => response,
35183         -
                        Err(e) => {
35184         -
                            ::tracing::error!(error = %e, "failed to serialize response");
35185         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35186         -
                        }
35187         -
                    }
35188         -
    }
35189         -
}
35190         -
impl
35191         -
    ::aws_smithy_http_server::response::IntoResponse<
35192         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35193         -
    > for crate::error::MalformedTimestampPathHttpDateError
35194         -
{
35195         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35196         -
        match crate::protocol_serde::shape_malformed_timestamp_path_http_date::ser_malformed_timestamp_path_http_date_http_error(&self) {
35197         -
            Ok(mut response) => {
35198         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
35199         -
                response
35200         -
            },
35201         -
            Err(e) => {
35202         -
                ::tracing::error!(error = %e, "failed to serialize response");
35203         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35204         -
            }
35205         -
        }
35206         -
    }
35207         -
}
35208         -
35209         -
const CONTENT_TYPE_MALFORMEDTIMESTAMPPATHDEFAULT: ::mime::Mime = ::mime::APPLICATION_JSON;
35210         -
::pin_project_lite::pin_project! {
35211         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35212         -
    /// [`MalformedTimestampPathDefaultInput`](crate::input::MalformedTimestampPathDefaultInput) using modelled bindings.
35213         -
    pub struct MalformedTimestampPathDefaultInputFuture {
35214         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedTimestampPathDefaultInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35215         -
    }
35216         -
}
35217         -
35218         -
impl std::future::Future for MalformedTimestampPathDefaultInputFuture {
35219         -
    type Output = Result<
35220         -
        crate::input::MalformedTimestampPathDefaultInput,
35221         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35222         -
    >;
35223         -
35224         -
    fn poll(
35225         -
        self: std::pin::Pin<&mut Self>,
35226         -
        cx: &mut std::task::Context<'_>,
35227         -
    ) -> std::task::Poll<Self::Output> {
35228         -
        let this = self.project();
35229         -
        this.inner.as_mut().poll(cx)
35230         -
    }
35231         -
}
35232         -
35233         -
impl<B>
35234         -
    ::aws_smithy_http_server::request::FromRequest<
35235         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35236         -
        B,
35237         -
    > for crate::input::MalformedTimestampPathDefaultInput
35238         -
where
35239         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35240         -
    B: 'static,
35241         -
35242         -
    B::Data: Send,
35243         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35244         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35245         -
{
35246         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35247         -
    type Future = MalformedTimestampPathDefaultInputFuture;
35248         -
35249         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35250         -
        let fut = async move {
35251         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35252         -
                request.headers(),
35253         -
                &CONTENT_TYPE_MALFORMEDTIMESTAMPPATHDEFAULT,
35254         -
            ) {
35255         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35256         -
            }
35257         -
            crate::protocol_serde::shape_malformed_timestamp_path_default::de_malformed_timestamp_path_default_http_request(request)
35258         -
                            .await
35259         -
                            .map_err(Into::into)
35260         -
        };
35261         -
        use ::futures_util::future::TryFutureExt;
35262         -
        let fut = fut.map_err(
35263         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35264         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35265         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35266         -
                    e,
35267         -
                )
35268         -
            },
35269         -
        );
35270         -
        MalformedTimestampPathDefaultInputFuture {
35271         -
            inner: Box::pin(fut),
35272         -
        }
35273         -
    }
35274         -
}
35275         -
impl
35276         -
    ::aws_smithy_http_server::response::IntoResponse<
35277         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35278         -
    > for crate::output::MalformedTimestampPathDefaultOutput
35279         -
{
35280         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35281         -
        match crate::protocol_serde::shape_malformed_timestamp_path_default::ser_malformed_timestamp_path_default_http_response(self) {
35282         -
                        Ok(response) => response,
35283         -
                        Err(e) => {
35284         -
                            ::tracing::error!(error = %e, "failed to serialize response");
35285         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35286         -
                        }
35287         -
                    }
35288         -
    }
35289         -
}
35290         -
impl
35291         -
    ::aws_smithy_http_server::response::IntoResponse<
35292         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35293         -
    > for crate::error::MalformedTimestampPathDefaultError
35294         -
{
35295         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35296         -
        match crate::protocol_serde::shape_malformed_timestamp_path_default::ser_malformed_timestamp_path_default_http_error(&self) {
35297         -
            Ok(mut response) => {
35298         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
35299         -
                response
35300         -
            },
35301         -
            Err(e) => {
35302         -
                ::tracing::error!(error = %e, "failed to serialize response");
35303         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35304         -
            }
35305         -
        }
35306         -
    }
35307         -
}
35308         -
35309         -
const CONTENT_TYPE_MALFORMEDSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
35310         -
::pin_project_lite::pin_project! {
35311         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35312         -
    /// [`MalformedStringInput`](crate::input::MalformedStringInput) using modelled bindings.
35313         -
    pub struct MalformedStringInputFuture {
35314         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35315         -
    }
35316         -
}
35317         -
35318         -
impl std::future::Future for MalformedStringInputFuture {
35319         -
    type Output = Result<
35320         -
        crate::input::MalformedStringInput,
35321         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35322         -
    >;
35323         -
35324         -
    fn poll(
35325         -
        self: std::pin::Pin<&mut Self>,
35326         -
        cx: &mut std::task::Context<'_>,
35327         -
    ) -> std::task::Poll<Self::Output> {
35328         -
        let this = self.project();
35329         -
        this.inner.as_mut().poll(cx)
35330         -
    }
35331         -
}
35332         -
35333         -
impl<B>
35334         -
    ::aws_smithy_http_server::request::FromRequest<
35335         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35336         -
        B,
35337         -
    > for crate::input::MalformedStringInput
35338         -
where
35339         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35340         -
    B: 'static,
35341         -
35342         -
    B::Data: Send,
35343         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35344         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35345         -
{
35346         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35347         -
    type Future = MalformedStringInputFuture;
35348         -
35349         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35350         -
        let fut = async move {
35351         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35352         -
                request.headers(),
35353         -
                &CONTENT_TYPE_MALFORMEDSTRING,
35354         -
            ) {
35355         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35356         -
            }
35357         -
            crate::protocol_serde::shape_malformed_string::de_malformed_string_http_request(request)
35358         -
                .await
35359         -
                .map_err(Into::into)
35360         -
        };
35361         -
        use ::futures_util::future::TryFutureExt;
35362         -
        let fut = fut.map_err(
35363         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35364         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35365         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35366         -
                    e,
35367         -
                )
35368         -
            },
35369         -
        );
35370         -
        MalformedStringInputFuture {
35371         -
            inner: Box::pin(fut),
35372         -
        }
35373         -
    }
35374         -
}
35375         -
impl
35376         -
    ::aws_smithy_http_server::response::IntoResponse<
35377         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35378         -
    > for crate::output::MalformedStringOutput
35379         -
{
35380         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35381         -
        match crate::protocol_serde::shape_malformed_string::ser_malformed_string_http_response(
35382         -
            self,
35383         -
        ) {
35384         -
            Ok(response) => response,
35385         -
            Err(e) => {
35386         -
                ::tracing::error!(error = %e, "failed to serialize response");
35387         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35388         -
            }
35389         -
        }
35390         -
    }
35391         -
}
35392         -
35393         -
const CONTENT_TYPE_MALFORMEDDOUBLE: ::mime::Mime = ::mime::APPLICATION_JSON;
35394         -
::pin_project_lite::pin_project! {
35395         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35396         -
    /// [`MalformedDoubleInput`](crate::input::MalformedDoubleInput) using modelled bindings.
35397         -
    pub struct MalformedDoubleInputFuture {
35398         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedDoubleInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35399         -
    }
35400         -
}
35401         -
35402         -
impl std::future::Future for MalformedDoubleInputFuture {
35403         -
    type Output = Result<
35404         -
        crate::input::MalformedDoubleInput,
35405         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35406         -
    >;
35407         -
35408         -
    fn poll(
35409         -
        self: std::pin::Pin<&mut Self>,
35410         -
        cx: &mut std::task::Context<'_>,
35411         -
    ) -> std::task::Poll<Self::Output> {
35412         -
        let this = self.project();
35413         -
        this.inner.as_mut().poll(cx)
35414         -
    }
35415         -
}
35416         -
35417         -
impl<B>
35418         -
    ::aws_smithy_http_server::request::FromRequest<
35419         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35420         -
        B,
35421         -
    > for crate::input::MalformedDoubleInput
35422         -
where
35423         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35424         -
    B: 'static,
35425         -
35426         -
    B::Data: Send,
35427         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35428         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35429         -
{
35430         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35431         -
    type Future = MalformedDoubleInputFuture;
35432         -
35433         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35434         -
        let fut = async move {
35435         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35436         -
                request.headers(),
35437         -
                &CONTENT_TYPE_MALFORMEDDOUBLE,
35438         -
            ) {
35439         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35440         -
            }
35441         -
            crate::protocol_serde::shape_malformed_double::de_malformed_double_http_request(request)
35442         -
                .await
35443         -
                .map_err(Into::into)
35444         -
        };
35445         -
        use ::futures_util::future::TryFutureExt;
35446         -
        let fut = fut.map_err(
35447         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35448         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35449         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35450         -
                    e,
35451         -
                )
35452         -
            },
35453         -
        );
35454         -
        MalformedDoubleInputFuture {
35455         -
            inner: Box::pin(fut),
35456         -
        }
35457         -
    }
35458         -
}
35459         -
impl
35460         -
    ::aws_smithy_http_server::response::IntoResponse<
35461         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35462         -
    > for crate::output::MalformedDoubleOutput
35463         -
{
35464         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35465         -
        match crate::protocol_serde::shape_malformed_double::ser_malformed_double_http_response(
35466         -
            self,
35467         -
        ) {
35468         -
            Ok(response) => response,
35469         -
            Err(e) => {
35470         -
                ::tracing::error!(error = %e, "failed to serialize response");
35471         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35472         -
            }
35473         -
        }
35474         -
    }
35475         -
}
35476         -
impl
35477         -
    ::aws_smithy_http_server::response::IntoResponse<
35478         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35479         -
    > for crate::error::MalformedDoubleError
35480         -
{
35481         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35482         -
        match crate::protocol_serde::shape_malformed_double::ser_malformed_double_http_error(&self)
35483         -
        {
35484         -
            Ok(mut response) => {
35485         -
                response.extensions_mut().insert(
35486         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
35487         -
                );
35488         -
                response
35489         -
            }
35490         -
            Err(e) => {
35491         -
                ::tracing::error!(error = %e, "failed to serialize response");
35492         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35493         -
            }
35494         -
        }
35495         -
    }
35496         -
}
35497         -
35498         -
const CONTENT_TYPE_MALFORMEDFLOAT: ::mime::Mime = ::mime::APPLICATION_JSON;
35499         -
::pin_project_lite::pin_project! {
35500         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35501         -
    /// [`MalformedFloatInput`](crate::input::MalformedFloatInput) using modelled bindings.
35502         -
    pub struct MalformedFloatInputFuture {
35503         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedFloatInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35504         -
    }
35505         -
}
35506         -
35507         -
impl std::future::Future for MalformedFloatInputFuture {
35508         -
    type Output = Result<
35509         -
        crate::input::MalformedFloatInput,
35510         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35511         -
    >;
35512         -
35513         -
    fn poll(
35514         -
        self: std::pin::Pin<&mut Self>,
35515         -
        cx: &mut std::task::Context<'_>,
35516         -
    ) -> std::task::Poll<Self::Output> {
35517         -
        let this = self.project();
35518         -
        this.inner.as_mut().poll(cx)
35519         -
    }
35520         -
}
35521         -
35522         -
impl<B>
35523         -
    ::aws_smithy_http_server::request::FromRequest<
35524         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35525         -
        B,
35526         -
    > for crate::input::MalformedFloatInput
35527         -
where
35528         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35529         -
    B: 'static,
35530         -
35531         -
    B::Data: Send,
35532         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35533         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35534         -
{
35535         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35536         -
    type Future = MalformedFloatInputFuture;
35537         -
35538         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35539         -
        let fut = async move {
35540         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35541         -
                request.headers(),
35542         -
                &CONTENT_TYPE_MALFORMEDFLOAT,
35543         -
            ) {
35544         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35545         -
            }
35546         -
            crate::protocol_serde::shape_malformed_float::de_malformed_float_http_request(request)
35547         -
                .await
35548         -
                .map_err(Into::into)
35549         -
        };
35550         -
        use ::futures_util::future::TryFutureExt;
35551         -
        let fut = fut.map_err(
35552         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35553         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35554         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35555         -
                    e,
35556         -
                )
35557         -
            },
35558         -
        );
35559         -
        MalformedFloatInputFuture {
35560         -
            inner: Box::pin(fut),
35561         -
        }
35562         -
    }
35563         -
}
35564         -
impl
35565         -
    ::aws_smithy_http_server::response::IntoResponse<
35566         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35567         -
    > for crate::output::MalformedFloatOutput
35568         -
{
35569         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35570         -
        match crate::protocol_serde::shape_malformed_float::ser_malformed_float_http_response(self)
35571         -
        {
35572         -
            Ok(response) => response,
35573         -
            Err(e) => {
35574         -
                ::tracing::error!(error = %e, "failed to serialize response");
35575         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35576         -
            }
35577         -
        }
35578         -
    }
35579         -
}
35580         -
impl
35581         -
    ::aws_smithy_http_server::response::IntoResponse<
35582         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35583         -
    > for crate::error::MalformedFloatError
35584         -
{
35585         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35586         -
        match crate::protocol_serde::shape_malformed_float::ser_malformed_float_http_error(&self) {
35587         -
            Ok(mut response) => {
35588         -
                response.extensions_mut().insert(
35589         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
35590         -
                );
35591         -
                response
35592         -
            }
35593         -
            Err(e) => {
35594         -
                ::tracing::error!(error = %e, "failed to serialize response");
35595         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35596         -
            }
35597         -
        }
35598         -
    }
35599         -
}
35600         -
35601         -
const CONTENT_TYPE_MALFORMEDLONG: ::mime::Mime = ::mime::APPLICATION_JSON;
35602         -
::pin_project_lite::pin_project! {
35603         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35604         -
    /// [`MalformedLongInput`](crate::input::MalformedLongInput) using modelled bindings.
35605         -
    pub struct MalformedLongInputFuture {
35606         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedLongInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35607         -
    }
35608         -
}
35609         -
35610         -
impl std::future::Future for MalformedLongInputFuture {
35611         -
    type Output = Result<
35612         -
        crate::input::MalformedLongInput,
35613         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35614         -
    >;
35615         -
35616         -
    fn poll(
35617         -
        self: std::pin::Pin<&mut Self>,
35618         -
        cx: &mut std::task::Context<'_>,
35619         -
    ) -> std::task::Poll<Self::Output> {
35620         -
        let this = self.project();
35621         -
        this.inner.as_mut().poll(cx)
35622         -
    }
35623         -
}
35624         -
35625         -
impl<B>
35626         -
    ::aws_smithy_http_server::request::FromRequest<
35627         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35628         -
        B,
35629         -
    > for crate::input::MalformedLongInput
35630         -
where
35631         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35632         -
    B: 'static,
35633         -
35634         -
    B::Data: Send,
35635         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35636         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35637         -
{
35638         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35639         -
    type Future = MalformedLongInputFuture;
35640         -
35641         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35642         -
        let fut = async move {
35643         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35644         -
                request.headers(),
35645         -
                &CONTENT_TYPE_MALFORMEDLONG,
35646         -
            ) {
35647         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35648         -
            }
35649         -
            crate::protocol_serde::shape_malformed_long::de_malformed_long_http_request(request)
35650         -
                .await
35651         -
                .map_err(Into::into)
35652         -
        };
35653         -
        use ::futures_util::future::TryFutureExt;
35654         -
        let fut = fut.map_err(
35655         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35656         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35657         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35658         -
                    e,
35659         -
                )
35660         -
            },
35661         -
        );
35662         -
        MalformedLongInputFuture {
35663         -
            inner: Box::pin(fut),
35664         -
        }
35665         -
    }
35666         -
}
35667         -
impl
35668         -
    ::aws_smithy_http_server::response::IntoResponse<
35669         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35670         -
    > for crate::output::MalformedLongOutput
35671         -
{
35672         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35673         -
        match crate::protocol_serde::shape_malformed_long::ser_malformed_long_http_response(self) {
35674         -
            Ok(response) => response,
35675         -
            Err(e) => {
35676         -
                ::tracing::error!(error = %e, "failed to serialize response");
35677         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35678         -
            }
35679         -
        }
35680         -
    }
35681         -
}
35682         -
impl
35683         -
    ::aws_smithy_http_server::response::IntoResponse<
35684         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35685         -
    > for crate::error::MalformedLongError
35686         -
{
35687         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35688         -
        match crate::protocol_serde::shape_malformed_long::ser_malformed_long_http_error(&self) {
35689         -
            Ok(mut response) => {
35690         -
                response.extensions_mut().insert(
35691         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
35692         -
                );
35693         -
                response
35694         -
            }
35695         -
            Err(e) => {
35696         -
                ::tracing::error!(error = %e, "failed to serialize response");
35697         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35698         -
            }
35699         -
        }
35700         -
    }
35701         -
}
35702         -
35703         -
const CONTENT_TYPE_MALFORMEDSHORT: ::mime::Mime = ::mime::APPLICATION_JSON;
35704         -
::pin_project_lite::pin_project! {
35705         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35706         -
    /// [`MalformedShortInput`](crate::input::MalformedShortInput) using modelled bindings.
35707         -
    pub struct MalformedShortInputFuture {
35708         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedShortInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35709         -
    }
35710         -
}
35711         -
35712         -
impl std::future::Future for MalformedShortInputFuture {
35713         -
    type Output = Result<
35714         -
        crate::input::MalformedShortInput,
35715         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35716         -
    >;
35717         -
35718         -
    fn poll(
35719         -
        self: std::pin::Pin<&mut Self>,
35720         -
        cx: &mut std::task::Context<'_>,
35721         -
    ) -> std::task::Poll<Self::Output> {
35722         -
        let this = self.project();
35723         -
        this.inner.as_mut().poll(cx)
35724         -
    }
35725         -
}
35726         -
35727         -
impl<B>
35728         -
    ::aws_smithy_http_server::request::FromRequest<
35729         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35730         -
        B,
35731         -
    > for crate::input::MalformedShortInput
35732         -
where
35733         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35734         -
    B: 'static,
35735         -
35736         -
    B::Data: Send,
35737         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35738         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35739         -
{
35740         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35741         -
    type Future = MalformedShortInputFuture;
35742         -
35743         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35744         -
        let fut = async move {
35745         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35746         -
                request.headers(),
35747         -
                &CONTENT_TYPE_MALFORMEDSHORT,
35748         -
            ) {
35749         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35750         -
            }
35751         -
            crate::protocol_serde::shape_malformed_short::de_malformed_short_http_request(request)
35752         -
                .await
35753         -
                .map_err(Into::into)
35754         -
        };
35755         -
        use ::futures_util::future::TryFutureExt;
35756         -
        let fut = fut.map_err(
35757         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35758         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35759         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35760         -
                    e,
35761         -
                )
35762         -
            },
35763         -
        );
35764         -
        MalformedShortInputFuture {
35765         -
            inner: Box::pin(fut),
35766         -
        }
35767         -
    }
35768         -
}
35769         -
impl
35770         -
    ::aws_smithy_http_server::response::IntoResponse<
35771         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35772         -
    > for crate::output::MalformedShortOutput
35773         -
{
35774         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35775         -
        match crate::protocol_serde::shape_malformed_short::ser_malformed_short_http_response(self)
35776         -
        {
35777         -
            Ok(response) => response,
35778         -
            Err(e) => {
35779         -
                ::tracing::error!(error = %e, "failed to serialize response");
35780         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35781         -
            }
35782         -
        }
35783         -
    }
35784         -
}
35785         -
impl
35786         -
    ::aws_smithy_http_server::response::IntoResponse<
35787         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35788         -
    > for crate::error::MalformedShortError
35789         -
{
35790         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35791         -
        match crate::protocol_serde::shape_malformed_short::ser_malformed_short_http_error(&self) {
35792         -
            Ok(mut response) => {
35793         -
                response.extensions_mut().insert(
35794         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
35795         -
                );
35796         -
                response
35797         -
            }
35798         -
            Err(e) => {
35799         -
                ::tracing::error!(error = %e, "failed to serialize response");
35800         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35801         -
            }
35802         -
        }
35803         -
    }
35804         -
}
35805         -
35806         -
const CONTENT_TYPE_MALFORMEDBYTE: ::mime::Mime = ::mime::APPLICATION_JSON;
35807         -
::pin_project_lite::pin_project! {
35808         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35809         -
    /// [`MalformedByteInput`](crate::input::MalformedByteInput) using modelled bindings.
35810         -
    pub struct MalformedByteInputFuture {
35811         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedByteInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35812         -
    }
35813         -
}
35814         -
35815         -
impl std::future::Future for MalformedByteInputFuture {
35816         -
    type Output = Result<
35817         -
        crate::input::MalformedByteInput,
35818         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35819         -
    >;
35820         -
35821         -
    fn poll(
35822         -
        self: std::pin::Pin<&mut Self>,
35823         -
        cx: &mut std::task::Context<'_>,
35824         -
    ) -> std::task::Poll<Self::Output> {
35825         -
        let this = self.project();
35826         -
        this.inner.as_mut().poll(cx)
35827         -
    }
35828         -
}
35829         -
35830         -
impl<B>
35831         -
    ::aws_smithy_http_server::request::FromRequest<
35832         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35833         -
        B,
35834         -
    > for crate::input::MalformedByteInput
35835         -
where
35836         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35837         -
    B: 'static,
35838         -
35839         -
    B::Data: Send,
35840         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35841         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35842         -
{
35843         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35844         -
    type Future = MalformedByteInputFuture;
35845         -
35846         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35847         -
        let fut = async move {
35848         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35849         -
                request.headers(),
35850         -
                &CONTENT_TYPE_MALFORMEDBYTE,
35851         -
            ) {
35852         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35853         -
            }
35854         -
            crate::protocol_serde::shape_malformed_byte::de_malformed_byte_http_request(request)
35855         -
                .await
35856         -
                .map_err(Into::into)
35857         -
        };
35858         -
        use ::futures_util::future::TryFutureExt;
35859         -
        let fut = fut.map_err(
35860         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35861         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35862         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35863         -
                    e,
35864         -
                )
35865         -
            },
35866         -
        );
35867         -
        MalformedByteInputFuture {
35868         -
            inner: Box::pin(fut),
35869         -
        }
35870         -
    }
35871         -
}
35872         -
impl
35873         -
    ::aws_smithy_http_server::response::IntoResponse<
35874         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35875         -
    > for crate::output::MalformedByteOutput
35876         -
{
35877         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35878         -
        match crate::protocol_serde::shape_malformed_byte::ser_malformed_byte_http_response(self) {
35879         -
            Ok(response) => response,
35880         -
            Err(e) => {
35881         -
                ::tracing::error!(error = %e, "failed to serialize response");
35882         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35883         -
            }
35884         -
        }
35885         -
    }
35886         -
}
35887         -
impl
35888         -
    ::aws_smithy_http_server::response::IntoResponse<
35889         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35890         -
    > for crate::error::MalformedByteError
35891         -
{
35892         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35893         -
        match crate::protocol_serde::shape_malformed_byte::ser_malformed_byte_http_error(&self) {
35894         -
            Ok(mut response) => {
35895         -
                response.extensions_mut().insert(
35896         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
35897         -
                );
35898         -
                response
35899         -
            }
35900         -
            Err(e) => {
35901         -
                ::tracing::error!(error = %e, "failed to serialize response");
35902         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35903         -
            }
35904         -
        }
35905         -
    }
35906         -
}
35907         -
35908         -
const CONTENT_TYPE_MALFORMEDBLOB: ::mime::Mime = ::mime::APPLICATION_JSON;
35909         -
::pin_project_lite::pin_project! {
35910         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35911         -
    /// [`MalformedBlobInput`](crate::input::MalformedBlobInput) using modelled bindings.
35912         -
    pub struct MalformedBlobInputFuture {
35913         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedBlobInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35914         -
    }
35915         -
}
35916         -
35917         -
impl std::future::Future for MalformedBlobInputFuture {
35918         -
    type Output = Result<
35919         -
        crate::input::MalformedBlobInput,
35920         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
35921         -
    >;
35922         -
35923         -
    fn poll(
35924         -
        self: std::pin::Pin<&mut Self>,
35925         -
        cx: &mut std::task::Context<'_>,
35926         -
    ) -> std::task::Poll<Self::Output> {
35927         -
        let this = self.project();
35928         -
        this.inner.as_mut().poll(cx)
35929         -
    }
35930         -
}
35931         -
35932         -
impl<B>
35933         -
    ::aws_smithy_http_server::request::FromRequest<
35934         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35935         -
        B,
35936         -
    > for crate::input::MalformedBlobInput
35937         -
where
35938         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
35939         -
    B: 'static,
35940         -
35941         -
    B::Data: Send,
35942         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
35943         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
35944         -
{
35945         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
35946         -
    type Future = MalformedBlobInputFuture;
35947         -
35948         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
35949         -
        let fut = async move {
35950         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
35951         -
                request.headers(),
35952         -
                &CONTENT_TYPE_MALFORMEDBLOB,
35953         -
            ) {
35954         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
35955         -
            }
35956         -
            crate::protocol_serde::shape_malformed_blob::de_malformed_blob_http_request(request)
35957         -
                .await
35958         -
                .map_err(Into::into)
35959         -
        };
35960         -
        use ::futures_util::future::TryFutureExt;
35961         -
        let fut = fut.map_err(
35962         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
35963         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
35964         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
35965         -
                    e,
35966         -
                )
35967         -
            },
35968         -
        );
35969         -
        MalformedBlobInputFuture {
35970         -
            inner: Box::pin(fut),
35971         -
        }
35972         -
    }
35973         -
}
35974         -
impl
35975         -
    ::aws_smithy_http_server::response::IntoResponse<
35976         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
35977         -
    > for crate::output::MalformedBlobOutput
35978         -
{
35979         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
35980         -
        match crate::protocol_serde::shape_malformed_blob::ser_malformed_blob_http_response(self) {
35981         -
            Ok(response) => response,
35982         -
            Err(e) => {
35983         -
                ::tracing::error!(error = %e, "failed to serialize response");
35984         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
35985         -
            }
35986         -
        }
35987         -
    }
35988         -
}
35989         -
35990         -
const CONTENT_TYPE_MALFORMEDMAP: ::mime::Mime = ::mime::APPLICATION_JSON;
35991         -
::pin_project_lite::pin_project! {
35992         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
35993         -
    /// [`MalformedMapInput`](crate::input::MalformedMapInput) using modelled bindings.
35994         -
    pub struct MalformedMapInputFuture {
35995         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedMapInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
35996         -
    }
35997         -
}
35998         -
35999         -
impl std::future::Future for MalformedMapInputFuture {
36000         -
    type Output = Result<
36001         -
        crate::input::MalformedMapInput,
36002         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36003         -
    >;
36004         -
36005         -
    fn poll(
36006         -
        self: std::pin::Pin<&mut Self>,
36007         -
        cx: &mut std::task::Context<'_>,
36008         -
    ) -> std::task::Poll<Self::Output> {
36009         -
        let this = self.project();
36010         -
        this.inner.as_mut().poll(cx)
36011         -
    }
36012         -
}
36013         -
36014         -
impl<B>
36015         -
    ::aws_smithy_http_server::request::FromRequest<
36016         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36017         -
        B,
36018         -
    > for crate::input::MalformedMapInput
36019         -
where
36020         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36021         -
    B: 'static,
36022         -
36023         -
    B::Data: Send,
36024         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36025         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36026         -
{
36027         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36028         -
    type Future = MalformedMapInputFuture;
36029         -
36030         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36031         -
        let fut = async move {
36032         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36033         -
                request.headers(),
36034         -
                &CONTENT_TYPE_MALFORMEDMAP,
36035         -
            ) {
36036         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36037         -
            }
36038         -
            crate::protocol_serde::shape_malformed_map::de_malformed_map_http_request(request)
36039         -
                .await
36040         -
                .map_err(Into::into)
36041         -
        };
36042         -
        use ::futures_util::future::TryFutureExt;
36043         -
        let fut = fut.map_err(
36044         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36045         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36046         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36047         -
                    e,
36048         -
                )
36049         -
            },
36050         -
        );
36051         -
        MalformedMapInputFuture {
36052         -
            inner: Box::pin(fut),
36053         -
        }
36054         -
    }
36055         -
}
36056         -
impl
36057         -
    ::aws_smithy_http_server::response::IntoResponse<
36058         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36059         -
    > for crate::output::MalformedMapOutput
36060         -
{
36061         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36062         -
        match crate::protocol_serde::shape_malformed_map::ser_malformed_map_http_response(self) {
36063         -
            Ok(response) => response,
36064         -
            Err(e) => {
36065         -
                ::tracing::error!(error = %e, "failed to serialize response");
36066         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36067         -
            }
36068         -
        }
36069         -
    }
36070         -
}
36071         -
36072         -
const CONTENT_TYPE_MALFORMEDLIST: ::mime::Mime = ::mime::APPLICATION_JSON;
36073         -
::pin_project_lite::pin_project! {
36074         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36075         -
    /// [`MalformedListInput`](crate::input::MalformedListInput) using modelled bindings.
36076         -
    pub struct MalformedListInputFuture {
36077         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedListInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36078         -
    }
36079         -
}
36080         -
36081         -
impl std::future::Future for MalformedListInputFuture {
36082         -
    type Output = Result<
36083         -
        crate::input::MalformedListInput,
36084         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36085         -
    >;
36086         -
36087         -
    fn poll(
36088         -
        self: std::pin::Pin<&mut Self>,
36089         -
        cx: &mut std::task::Context<'_>,
36090         -
    ) -> std::task::Poll<Self::Output> {
36091         -
        let this = self.project();
36092         -
        this.inner.as_mut().poll(cx)
36093         -
    }
36094         -
}
36095         -
36096         -
impl<B>
36097         -
    ::aws_smithy_http_server::request::FromRequest<
36098         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36099         -
        B,
36100         -
    > for crate::input::MalformedListInput
36101         -
where
36102         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36103         -
    B: 'static,
36104         -
36105         -
    B::Data: Send,
36106         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36107         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36108         -
{
36109         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36110         -
    type Future = MalformedListInputFuture;
36111         -
36112         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36113         -
        let fut = async move {
36114         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36115         -
                request.headers(),
36116         -
                &CONTENT_TYPE_MALFORMEDLIST,
36117         -
            ) {
36118         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36119         -
            }
36120         -
            crate::protocol_serde::shape_malformed_list::de_malformed_list_http_request(request)
36121         -
                .await
36122         -
                .map_err(Into::into)
36123         -
        };
36124         -
        use ::futures_util::future::TryFutureExt;
36125         -
        let fut = fut.map_err(
36126         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36127         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36128         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36129         -
                    e,
36130         -
                )
36131         -
            },
36132         -
        );
36133         -
        MalformedListInputFuture {
36134         -
            inner: Box::pin(fut),
36135         -
        }
36136         -
    }
36137         -
}
36138         -
impl
36139         -
    ::aws_smithy_http_server::response::IntoResponse<
36140         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36141         -
    > for crate::output::MalformedListOutput
36142         -
{
36143         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36144         -
        match crate::protocol_serde::shape_malformed_list::ser_malformed_list_http_response(self) {
36145         -
            Ok(response) => response,
36146         -
            Err(e) => {
36147         -
                ::tracing::error!(error = %e, "failed to serialize response");
36148         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36149         -
            }
36150         -
        }
36151         -
    }
36152         -
}
36153         -
36154         -
const CONTENT_TYPE_MALFORMEDBOOLEAN: ::mime::Mime = ::mime::APPLICATION_JSON;
36155         -
::pin_project_lite::pin_project! {
36156         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36157         -
    /// [`MalformedBooleanInput`](crate::input::MalformedBooleanInput) using modelled bindings.
36158         -
    pub struct MalformedBooleanInputFuture {
36159         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedBooleanInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36160         -
    }
36161         -
}
36162         -
36163         -
impl std::future::Future for MalformedBooleanInputFuture {
36164         -
    type Output = Result<
36165         -
        crate::input::MalformedBooleanInput,
36166         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36167         -
    >;
36168         -
36169         -
    fn poll(
36170         -
        self: std::pin::Pin<&mut Self>,
36171         -
        cx: &mut std::task::Context<'_>,
36172         -
    ) -> std::task::Poll<Self::Output> {
36173         -
        let this = self.project();
36174         -
        this.inner.as_mut().poll(cx)
36175         -
    }
36176         -
}
36177         -
36178         -
impl<B>
36179         -
    ::aws_smithy_http_server::request::FromRequest<
36180         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36181         -
        B,
36182         -
    > for crate::input::MalformedBooleanInput
36183         -
where
36184         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36185         -
    B: 'static,
36186         -
36187         -
    B::Data: Send,
36188         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36189         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36190         -
{
36191         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36192         -
    type Future = MalformedBooleanInputFuture;
36193         -
36194         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36195         -
        let fut = async move {
36196         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36197         -
                request.headers(),
36198         -
                &CONTENT_TYPE_MALFORMEDBOOLEAN,
36199         -
            ) {
36200         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36201         -
            }
36202         -
            crate::protocol_serde::shape_malformed_boolean::de_malformed_boolean_http_request(
36203         -
                request,
36204         -
            )
36205         -
            .await
36206         -
            .map_err(Into::into)
36207         -
        };
36208         -
        use ::futures_util::future::TryFutureExt;
36209         -
        let fut = fut.map_err(
36210         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36211         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36212         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36213         -
                    e,
36214         -
                )
36215         -
            },
36216         -
        );
36217         -
        MalformedBooleanInputFuture {
36218         -
            inner: Box::pin(fut),
36219         -
        }
36220         -
    }
36221         -
}
36222         -
impl
36223         -
    ::aws_smithy_http_server::response::IntoResponse<
36224         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36225         -
    > for crate::output::MalformedBooleanOutput
36226         -
{
36227         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36228         -
        match crate::protocol_serde::shape_malformed_boolean::ser_malformed_boolean_http_response(
36229         -
            self,
36230         -
        ) {
36231         -
            Ok(response) => response,
36232         -
            Err(e) => {
36233         -
                ::tracing::error!(error = %e, "failed to serialize response");
36234         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36235         -
            }
36236         -
        }
36237         -
    }
36238         -
}
36239         -
impl
36240         -
    ::aws_smithy_http_server::response::IntoResponse<
36241         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36242         -
    > for crate::error::MalformedBooleanError
36243         -
{
36244         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36245         -
        match crate::protocol_serde::shape_malformed_boolean::ser_malformed_boolean_http_error(
36246         -
            &self,
36247         -
        ) {
36248         -
            Ok(mut response) => {
36249         -
                response.extensions_mut().insert(
36250         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
36251         -
                );
36252         -
                response
36253         -
            }
36254         -
            Err(e) => {
36255         -
                ::tracing::error!(error = %e, "failed to serialize response");
36256         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36257         -
            }
36258         -
        }
36259         -
    }
36260         -
}
36261         -
36262         -
const CONTENT_TYPE_MALFORMEDUNION: ::mime::Mime = ::mime::APPLICATION_JSON;
36263         -
::pin_project_lite::pin_project! {
36264         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36265         -
    /// [`MalformedUnionInput`](crate::input::MalformedUnionInput) using modelled bindings.
36266         -
    pub struct MalformedUnionInputFuture {
36267         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedUnionInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36268         -
    }
36269         -
}
36270         -
36271         -
impl std::future::Future for MalformedUnionInputFuture {
36272         -
    type Output = Result<
36273         -
        crate::input::MalformedUnionInput,
36274         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36275         -
    >;
36276         -
36277         -
    fn poll(
36278         -
        self: std::pin::Pin<&mut Self>,
36279         -
        cx: &mut std::task::Context<'_>,
36280         -
    ) -> std::task::Poll<Self::Output> {
36281         -
        let this = self.project();
36282         -
        this.inner.as_mut().poll(cx)
36283         -
    }
36284         -
}
36285         -
36286         -
impl<B>
36287         -
    ::aws_smithy_http_server::request::FromRequest<
36288         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36289         -
        B,
36290         -
    > for crate::input::MalformedUnionInput
36291         -
where
36292         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36293         -
    B: 'static,
36294         -
36295         -
    B::Data: Send,
36296         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36297         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36298         -
{
36299         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36300         -
    type Future = MalformedUnionInputFuture;
36301         -
36302         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36303         -
        let fut = async move {
36304         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36305         -
                request.headers(),
36306         -
                &CONTENT_TYPE_MALFORMEDUNION,
36307         -
            ) {
36308         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36309         -
            }
36310         -
            crate::protocol_serde::shape_malformed_union::de_malformed_union_http_request(request)
36311         -
                .await
36312         -
                .map_err(Into::into)
36313         -
        };
36314         -
        use ::futures_util::future::TryFutureExt;
36315         -
        let fut = fut.map_err(
36316         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36317         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36318         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36319         -
                    e,
36320         -
                )
36321         -
            },
36322         -
        );
36323         -
        MalformedUnionInputFuture {
36324         -
            inner: Box::pin(fut),
36325         -
        }
36326         -
    }
36327         -
}
36328         -
impl
36329         -
    ::aws_smithy_http_server::response::IntoResponse<
36330         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36331         -
    > for crate::output::MalformedUnionOutput
36332         -
{
36333         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36334         -
        match crate::protocol_serde::shape_malformed_union::ser_malformed_union_http_response(self)
36335         -
        {
36336         -
            Ok(response) => response,
36337         -
            Err(e) => {
36338         -
                ::tracing::error!(error = %e, "failed to serialize response");
36339         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36340         -
            }
36341         -
        }
36342         -
    }
36343         -
}
36344         -
36345         -
const CONTENT_TYPE_MALFORMEDINTEGER: ::mime::Mime = ::mime::APPLICATION_JSON;
36346         -
::pin_project_lite::pin_project! {
36347         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36348         -
    /// [`MalformedIntegerInput`](crate::input::MalformedIntegerInput) using modelled bindings.
36349         -
    pub struct MalformedIntegerInputFuture {
36350         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedIntegerInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36351         -
    }
36352         -
}
36353         -
36354         -
impl std::future::Future for MalformedIntegerInputFuture {
36355         -
    type Output = Result<
36356         -
        crate::input::MalformedIntegerInput,
36357         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36358         -
    >;
36359         -
36360         -
    fn poll(
36361         -
        self: std::pin::Pin<&mut Self>,
36362         -
        cx: &mut std::task::Context<'_>,
36363         -
    ) -> std::task::Poll<Self::Output> {
36364         -
        let this = self.project();
36365         -
        this.inner.as_mut().poll(cx)
36366         -
    }
36367         -
}
36368         -
36369         -
impl<B>
36370         -
    ::aws_smithy_http_server::request::FromRequest<
36371         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36372         -
        B,
36373         -
    > for crate::input::MalformedIntegerInput
36374         -
where
36375         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36376         -
    B: 'static,
36377         -
36378         -
    B::Data: Send,
36379         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36380         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36381         -
{
36382         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36383         -
    type Future = MalformedIntegerInputFuture;
36384         -
36385         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36386         -
        let fut = async move {
36387         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36388         -
                request.headers(),
36389         -
                &CONTENT_TYPE_MALFORMEDINTEGER,
36390         -
            ) {
36391         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36392         -
            }
36393         -
            crate::protocol_serde::shape_malformed_integer::de_malformed_integer_http_request(
36394         -
                request,
36395         -
            )
36396         -
            .await
36397         -
            .map_err(Into::into)
36398         -
        };
36399         -
        use ::futures_util::future::TryFutureExt;
36400         -
        let fut = fut.map_err(
36401         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36402         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36403         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36404         -
                    e,
36405         -
                )
36406         -
            },
36407         -
        );
36408         -
        MalformedIntegerInputFuture {
36409         -
            inner: Box::pin(fut),
36410         -
        }
36411         -
    }
36412         -
}
36413         -
impl
36414         -
    ::aws_smithy_http_server::response::IntoResponse<
36415         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36416         -
    > for crate::output::MalformedIntegerOutput
36417         -
{
36418         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36419         -
        match crate::protocol_serde::shape_malformed_integer::ser_malformed_integer_http_response(
36420         -
            self,
36421         -
        ) {
36422         -
            Ok(response) => response,
36423         -
            Err(e) => {
36424         -
                ::tracing::error!(error = %e, "failed to serialize response");
36425         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36426         -
            }
36427         -
        }
36428         -
    }
36429         -
}
36430         -
impl
36431         -
    ::aws_smithy_http_server::response::IntoResponse<
36432         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36433         -
    > for crate::error::MalformedIntegerError
36434         -
{
36435         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36436         -
        match crate::protocol_serde::shape_malformed_integer::ser_malformed_integer_http_error(
36437         -
            &self,
36438         -
        ) {
36439         -
            Ok(mut response) => {
36440         -
                response.extensions_mut().insert(
36441         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
36442         -
                );
36443         -
                response
36444         -
            }
36445         -
            Err(e) => {
36446         -
                ::tracing::error!(error = %e, "failed to serialize response");
36447         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36448         -
            }
36449         -
        }
36450         -
    }
36451         -
}
36452         -
36453         -
const CONTENT_TYPE_MALFORMEDREQUESTBODY: ::mime::Mime = ::mime::APPLICATION_JSON;
36454         -
::pin_project_lite::pin_project! {
36455         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36456         -
    /// [`MalformedRequestBodyInput`](crate::input::MalformedRequestBodyInput) using modelled bindings.
36457         -
    pub struct MalformedRequestBodyInputFuture {
36458         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedRequestBodyInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36459         -
    }
36460         -
}
36461         -
36462         -
impl std::future::Future for MalformedRequestBodyInputFuture {
36463         -
    type Output = Result<
36464         -
        crate::input::MalformedRequestBodyInput,
36465         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36466         -
    >;
36467         -
36468         -
    fn poll(
36469         -
        self: std::pin::Pin<&mut Self>,
36470         -
        cx: &mut std::task::Context<'_>,
36471         -
    ) -> std::task::Poll<Self::Output> {
36472         -
        let this = self.project();
36473         -
        this.inner.as_mut().poll(cx)
36474         -
    }
36475         -
}
36476         -
36477         -
impl<B>
36478         -
    ::aws_smithy_http_server::request::FromRequest<
36479         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36480         -
        B,
36481         -
    > for crate::input::MalformedRequestBodyInput
36482         -
where
36483         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36484         -
    B: 'static,
36485         -
36486         -
    B::Data: Send,
36487         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36488         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36489         -
{
36490         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36491         -
    type Future = MalformedRequestBodyInputFuture;
36492         -
36493         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36494         -
        let fut = async move {
36495         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36496         -
                request.headers(),
36497         -
                &CONTENT_TYPE_MALFORMEDREQUESTBODY,
36498         -
            ) {
36499         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36500         -
            }
36501         -
            crate::protocol_serde::shape_malformed_request_body::de_malformed_request_body_http_request(request)
36502         -
                            .await
36503         -
                            .map_err(Into::into)
36504         -
        };
36505         -
        use ::futures_util::future::TryFutureExt;
36506         -
        let fut = fut.map_err(
36507         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36508         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36509         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36510         -
                    e,
36511         -
                )
36512         -
            },
36513         -
        );
36514         -
        MalformedRequestBodyInputFuture {
36515         -
            inner: Box::pin(fut),
36516         -
        }
36517         -
    }
36518         -
}
36519         -
impl
36520         -
    ::aws_smithy_http_server::response::IntoResponse<
36521         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36522         -
    > for crate::output::MalformedRequestBodyOutput
36523         -
{
36524         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36525         -
        match crate::protocol_serde::shape_malformed_request_body::ser_malformed_request_body_http_response(self) {
36526         -
                        Ok(response) => response,
36527         -
                        Err(e) => {
36528         -
                            ::tracing::error!(error = %e, "failed to serialize response");
36529         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36530         -
                        }
36531         -
                    }
36532         -
    }
36533         -
}
36534         -
36535         -
const CONTENT_TYPE_HTTPCHECKSUMREQUIRED: ::mime::Mime = ::mime::APPLICATION_JSON;
36536         -
::pin_project_lite::pin_project! {
36537         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36538         -
    /// [`HttpChecksumRequiredInput`](crate::input::HttpChecksumRequiredInput) using modelled bindings.
36539         -
    pub struct HttpChecksumRequiredInputFuture {
36540         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpChecksumRequiredInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36541         -
    }
36542         -
}
36543         -
36544         -
impl std::future::Future for HttpChecksumRequiredInputFuture {
36545         -
    type Output = Result<
36546         -
        crate::input::HttpChecksumRequiredInput,
36547         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36548         -
    >;
36549         -
36550         -
    fn poll(
36551         -
        self: std::pin::Pin<&mut Self>,
36552         -
        cx: &mut std::task::Context<'_>,
36553         -
    ) -> std::task::Poll<Self::Output> {
36554         -
        let this = self.project();
36555         -
        this.inner.as_mut().poll(cx)
36556         -
    }
36557         -
}
36558         -
36559         -
impl<B>
36560         -
    ::aws_smithy_http_server::request::FromRequest<
36561         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36562         -
        B,
36563         -
    > for crate::input::HttpChecksumRequiredInput
36564         -
where
36565         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36566         -
    B: 'static,
36567         -
36568         -
    B::Data: Send,
36569         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36570         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36571         -
{
36572         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36573         -
    type Future = HttpChecksumRequiredInputFuture;
36574         -
36575         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36576         -
        let fut = async move {
36577         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36578         -
                request.headers(),
36579         -
                &CONTENT_TYPE_HTTPCHECKSUMREQUIRED,
36580         -
            ) {
36581         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36582         -
            }
36583         -
            crate::protocol_serde::shape_http_checksum_required::de_http_checksum_required_http_request(request)
36584         -
                            .await
36585         -
                            .map_err(Into::into)
36586         -
        };
36587         -
        use ::futures_util::future::TryFutureExt;
36588         -
        let fut = fut.map_err(
36589         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36590         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36591         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36592         -
                    e,
36593         -
                )
36594         -
            },
36595         -
        );
36596         -
        HttpChecksumRequiredInputFuture {
36597         -
            inner: Box::pin(fut),
36598         -
        }
36599         -
    }
36600         -
}
36601         -
impl
36602         -
    ::aws_smithy_http_server::response::IntoResponse<
36603         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36604         -
    > for crate::output::HttpChecksumRequiredOutput
36605         -
{
36606         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36607         -
        match crate::protocol_serde::shape_http_checksum_required::ser_http_checksum_required_http_response(self) {
36608         -
                        Ok(response) => response,
36609         -
                        Err(e) => {
36610         -
                            ::tracing::error!(error = %e, "failed to serialize response");
36611         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36612         -
                        }
36613         -
                    }
36614         -
    }
36615         -
}
36616         -
36617         -
const CONTENT_TYPE_HOSTWITHPATHOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
36618         -
::pin_project_lite::pin_project! {
36619         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36620         -
    /// [`HostWithPathOperationInput`](crate::input::HostWithPathOperationInput) using modelled bindings.
36621         -
    pub struct HostWithPathOperationInputFuture {
36622         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HostWithPathOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36623         -
    }
36624         -
}
36625         -
36626         -
impl std::future::Future for HostWithPathOperationInputFuture {
36627         -
    type Output = Result<
36628         -
        crate::input::HostWithPathOperationInput,
36629         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36630         -
    >;
36631         -
36632         -
    fn poll(
36633         -
        self: std::pin::Pin<&mut Self>,
36634         -
        cx: &mut std::task::Context<'_>,
36635         -
    ) -> std::task::Poll<Self::Output> {
36636         -
        let this = self.project();
36637         -
        this.inner.as_mut().poll(cx)
36638         -
    }
36639         -
}
36640         -
36641         -
impl<B>
36642         -
    ::aws_smithy_http_server::request::FromRequest<
36643         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36644         -
        B,
36645         -
    > for crate::input::HostWithPathOperationInput
36646         -
where
36647         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36648         -
    B: 'static,
36649         -
36650         -
    B::Data: Send,
36651         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36652         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36653         -
{
36654         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36655         -
    type Future = HostWithPathOperationInputFuture;
36656         -
36657         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36658         -
        let fut = async move {
36659         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36660         -
                request.headers(),
36661         -
                &CONTENT_TYPE_HOSTWITHPATHOPERATION,
36662         -
            ) {
36663         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36664         -
            }
36665         -
            crate::protocol_serde::shape_host_with_path_operation::de_host_with_path_operation_http_request(request)
36666         -
                            .await
36667         -
                            .map_err(Into::into)
36668         -
        };
36669         -
        use ::futures_util::future::TryFutureExt;
36670         -
        let fut = fut.map_err(
36671         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36672         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36673         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36674         -
                    e,
36675         -
                )
36676         -
            },
36677         -
        );
36678         -
        HostWithPathOperationInputFuture {
36679         -
            inner: Box::pin(fut),
36680         -
        }
36681         -
    }
36682         -
}
36683         -
impl
36684         -
    ::aws_smithy_http_server::response::IntoResponse<
36685         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36686         -
    > for crate::output::HostWithPathOperationOutput
36687         -
{
36688         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36689         -
        match crate::protocol_serde::shape_host_with_path_operation::ser_host_with_path_operation_http_response(self) {
36690         -
                        Ok(response) => response,
36691         -
                        Err(e) => {
36692         -
                            ::tracing::error!(error = %e, "failed to serialize response");
36693         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36694         -
                        }
36695         -
                    }
36696         -
    }
36697         -
}
36698         -
36699         -
const CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
36700         -
::pin_project_lite::pin_project! {
36701         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36702         -
    /// [`EndpointWithHostLabelOperationInput`](crate::input::EndpointWithHostLabelOperationInput) using modelled bindings.
36703         -
    pub struct EndpointWithHostLabelOperationInputFuture {
36704         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointWithHostLabelOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36705         -
    }
36706         -
}
36707         -
36708         -
impl std::future::Future for EndpointWithHostLabelOperationInputFuture {
36709         -
    type Output = Result<
36710         -
        crate::input::EndpointWithHostLabelOperationInput,
36711         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36712         -
    >;
36713         -
36714         -
    fn poll(
36715         -
        self: std::pin::Pin<&mut Self>,
36716         -
        cx: &mut std::task::Context<'_>,
36717         -
    ) -> std::task::Poll<Self::Output> {
36718         -
        let this = self.project();
36719         -
        this.inner.as_mut().poll(cx)
36720         -
    }
36721         -
}
36722         -
36723         -
impl<B>
36724         -
    ::aws_smithy_http_server::request::FromRequest<
36725         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36726         -
        B,
36727         -
    > for crate::input::EndpointWithHostLabelOperationInput
36728         -
where
36729         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36730         -
    B: 'static,
36731         -
36732         -
    B::Data: Send,
36733         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36734         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36735         -
{
36736         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36737         -
    type Future = EndpointWithHostLabelOperationInputFuture;
36738         -
36739         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36740         -
        let fut = async move {
36741         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36742         -
                request.headers(),
36743         -
                &CONTENT_TYPE_ENDPOINTWITHHOSTLABELOPERATION,
36744         -
            ) {
36745         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36746         -
            }
36747         -
            crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation_http_request(request)
36748         -
                            .await
36749         -
                            .map_err(Into::into)
36750         -
        };
36751         -
        use ::futures_util::future::TryFutureExt;
36752         -
        let fut = fut.map_err(
36753         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36754         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36755         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36756         -
                    e,
36757         -
                )
36758         -
            },
36759         -
        );
36760         -
        EndpointWithHostLabelOperationInputFuture {
36761         -
            inner: Box::pin(fut),
36762         -
        }
36763         -
    }
36764         -
}
36765         -
impl
36766         -
    ::aws_smithy_http_server::response::IntoResponse<
36767         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36768         -
    > for crate::output::EndpointWithHostLabelOperationOutput
36769         -
{
36770         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36771         -
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_response(self) {
36772         -
                        Ok(response) => response,
36773         -
                        Err(e) => {
36774         -
                            ::tracing::error!(error = %e, "failed to serialize response");
36775         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36776         -
                        }
36777         -
                    }
36778         -
    }
36779         -
}
36780         -
impl
36781         -
    ::aws_smithy_http_server::response::IntoResponse<
36782         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36783         -
    > for crate::error::EndpointWithHostLabelOperationError
36784         -
{
36785         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36786         -
        match crate::protocol_serde::shape_endpoint_with_host_label_operation::ser_endpoint_with_host_label_operation_http_error(&self) {
36787         -
            Ok(mut response) => {
36788         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
36789         -
                response
36790         -
            },
36791         -
            Err(e) => {
36792         -
                ::tracing::error!(error = %e, "failed to serialize response");
36793         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36794         -
            }
36795         -
        }
36796         -
    }
36797         -
}
36798         -
36799         -
const CONTENT_TYPE_ENDPOINTOPERATION: ::mime::Mime = ::mime::APPLICATION_JSON;
36800         -
::pin_project_lite::pin_project! {
36801         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36802         -
    /// [`EndpointOperationInput`](crate::input::EndpointOperationInput) using modelled bindings.
36803         -
    pub struct EndpointOperationInputFuture {
36804         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EndpointOperationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36805         -
    }
36806         -
}
36807         -
36808         -
impl std::future::Future for EndpointOperationInputFuture {
36809         -
    type Output = Result<
36810         -
        crate::input::EndpointOperationInput,
36811         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36812         -
    >;
36813         -
36814         -
    fn poll(
36815         -
        self: std::pin::Pin<&mut Self>,
36816         -
        cx: &mut std::task::Context<'_>,
36817         -
    ) -> std::task::Poll<Self::Output> {
36818         -
        let this = self.project();
36819         -
        this.inner.as_mut().poll(cx)
36820         -
    }
36821         -
}
36822         -
36823         -
impl<B>
36824         -
    ::aws_smithy_http_server::request::FromRequest<
36825         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36826         -
        B,
36827         -
    > for crate::input::EndpointOperationInput
36828         -
where
36829         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36830         -
    B: 'static,
36831         -
36832         -
    B::Data: Send,
36833         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36834         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36835         -
{
36836         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36837         -
    type Future = EndpointOperationInputFuture;
36838         -
36839         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36840         -
        let fut = async move {
36841         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36842         -
                request.headers(),
36843         -
                &CONTENT_TYPE_ENDPOINTOPERATION,
36844         -
            ) {
36845         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36846         -
            }
36847         -
            crate::protocol_serde::shape_endpoint_operation::de_endpoint_operation_http_request(
36848         -
                request,
36849         -
            )
36850         -
            .await
36851         -
            .map_err(Into::into)
36852         -
        };
36853         -
        use ::futures_util::future::TryFutureExt;
36854         -
        let fut = fut.map_err(
36855         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36856         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36857         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36858         -
                    e,
36859         -
                )
36860         -
            },
36861         -
        );
36862         -
        EndpointOperationInputFuture {
36863         -
            inner: Box::pin(fut),
36864         -
        }
36865         -
    }
36866         -
}
36867         -
impl
36868         -
    ::aws_smithy_http_server::response::IntoResponse<
36869         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36870         -
    > for crate::output::EndpointOperationOutput
36871         -
{
36872         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36873         -
        match crate::protocol_serde::shape_endpoint_operation::ser_endpoint_operation_http_response(
36874         -
            self,
36875         -
        ) {
36876         -
            Ok(response) => response,
36877         -
            Err(e) => {
36878         -
                ::tracing::error!(error = %e, "failed to serialize response");
36879         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36880         -
            }
36881         -
        }
36882         -
    }
36883         -
}
36884         -
36885         -
const CONTENT_TYPE_POSTUNIONWITHJSONNAME: ::mime::Mime = ::mime::APPLICATION_JSON;
36886         -
::pin_project_lite::pin_project! {
36887         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36888         -
    /// [`PostUnionWithJsonNameInput`](crate::input::PostUnionWithJsonNameInput) using modelled bindings.
36889         -
    pub struct PostUnionWithJsonNameInputFuture {
36890         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PostUnionWithJsonNameInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36891         -
    }
36892         -
}
36893         -
36894         -
impl std::future::Future for PostUnionWithJsonNameInputFuture {
36895         -
    type Output = Result<
36896         -
        crate::input::PostUnionWithJsonNameInput,
36897         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36898         -
    >;
36899         -
36900         -
    fn poll(
36901         -
        self: std::pin::Pin<&mut Self>,
36902         -
        cx: &mut std::task::Context<'_>,
36903         -
    ) -> std::task::Poll<Self::Output> {
36904         -
        let this = self.project();
36905         -
        this.inner.as_mut().poll(cx)
36906         -
    }
36907         -
}
36908         -
36909         -
impl<B>
36910         -
    ::aws_smithy_http_server::request::FromRequest<
36911         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36912         -
        B,
36913         -
    > for crate::input::PostUnionWithJsonNameInput
36914         -
where
36915         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36916         -
    B: 'static,
36917         -
36918         -
    B::Data: Send,
36919         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
36920         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
36921         -
{
36922         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
36923         -
    type Future = PostUnionWithJsonNameInputFuture;
36924         -
36925         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
36926         -
        let fut = async move {
36927         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
36928         -
                request.headers(),
36929         -
                &CONTENT_TYPE_POSTUNIONWITHJSONNAME,
36930         -
            ) {
36931         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
36932         -
            }
36933         -
            crate::protocol_serde::shape_post_union_with_json_name::de_post_union_with_json_name_http_request(request)
36934         -
                            .await
36935         -
                            .map_err(Into::into)
36936         -
        };
36937         -
        use ::futures_util::future::TryFutureExt;
36938         -
        let fut = fut.map_err(
36939         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
36940         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
36941         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
36942         -
                    e,
36943         -
                )
36944         -
            },
36945         -
        );
36946         -
        PostUnionWithJsonNameInputFuture {
36947         -
            inner: Box::pin(fut),
36948         -
        }
36949         -
    }
36950         -
}
36951         -
impl
36952         -
    ::aws_smithy_http_server::response::IntoResponse<
36953         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36954         -
    > for crate::output::PostUnionWithJsonNameOutput
36955         -
{
36956         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
36957         -
        match crate::protocol_serde::shape_post_union_with_json_name::ser_post_union_with_json_name_http_response(self) {
36958         -
                        Ok(response) => response,
36959         -
                        Err(e) => {
36960         -
                            ::tracing::error!(error = %e, "failed to serialize response");
36961         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
36962         -
                        }
36963         -
                    }
36964         -
    }
36965         -
}
36966         -
36967         -
const CONTENT_TYPE_POSTPLAYERACTION: ::mime::Mime = ::mime::APPLICATION_JSON;
36968         -
::pin_project_lite::pin_project! {
36969         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
36970         -
    /// [`PostPlayerActionInput`](crate::input::PostPlayerActionInput) using modelled bindings.
36971         -
    pub struct PostPlayerActionInputFuture {
36972         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::PostPlayerActionInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
36973         -
    }
36974         -
}
36975         -
36976         -
impl std::future::Future for PostPlayerActionInputFuture {
36977         -
    type Output = Result<
36978         -
        crate::input::PostPlayerActionInput,
36979         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
36980         -
    >;
36981         -
36982         -
    fn poll(
36983         -
        self: std::pin::Pin<&mut Self>,
36984         -
        cx: &mut std::task::Context<'_>,
36985         -
    ) -> std::task::Poll<Self::Output> {
36986         -
        let this = self.project();
36987         -
        this.inner.as_mut().poll(cx)
36988         -
    }
36989         -
}
36990         -
36991         -
impl<B>
36992         -
    ::aws_smithy_http_server::request::FromRequest<
36993         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
36994         -
        B,
36995         -
    > for crate::input::PostPlayerActionInput
36996         -
where
36997         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
36998         -
    B: 'static,
36999         -
37000         -
    B::Data: Send,
37001         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37002         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37003         -
{
37004         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37005         -
    type Future = PostPlayerActionInputFuture;
37006         -
37007         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37008         -
        let fut = async move {
37009         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37010         -
                request.headers(),
37011         -
                &CONTENT_TYPE_POSTPLAYERACTION,
37012         -
            ) {
37013         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37014         -
            }
37015         -
            crate::protocol_serde::shape_post_player_action::de_post_player_action_http_request(
37016         -
                request,
37017         -
            )
37018         -
            .await
37019         -
            .map_err(Into::into)
37020         -
        };
37021         -
        use ::futures_util::future::TryFutureExt;
37022         -
        let fut = fut.map_err(
37023         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37024         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37025         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37026         -
                    e,
37027         -
                )
37028         -
            },
37029         -
        );
37030         -
        PostPlayerActionInputFuture {
37031         -
            inner: Box::pin(fut),
37032         -
        }
37033         -
    }
37034         -
}
37035         -
impl
37036         -
    ::aws_smithy_http_server::response::IntoResponse<
37037         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37038         -
    > for crate::output::PostPlayerActionOutput
37039         -
{
37040         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37041         -
        match crate::protocol_serde::shape_post_player_action::ser_post_player_action_http_response(
37042         -
            self,
37043         -
        ) {
37044         -
            Ok(response) => response,
37045         -
            Err(e) => {
37046         -
                ::tracing::error!(error = %e, "failed to serialize response");
37047         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37048         -
            }
37049         -
        }
37050         -
    }
37051         -
}
37052         -
37053         -
const CONTENT_TYPE_JSONUNIONS: ::mime::Mime = ::mime::APPLICATION_JSON;
37054         -
::pin_project_lite::pin_project! {
37055         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37056         -
    /// [`JsonUnionsInput`](crate::input::JsonUnionsInput) using modelled bindings.
37057         -
    pub struct JsonUnionsInputFuture {
37058         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonUnionsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37059         -
    }
37060         -
}
37061         -
37062         -
impl std::future::Future for JsonUnionsInputFuture {
37063         -
    type Output = Result<
37064         -
        crate::input::JsonUnionsInput,
37065         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37066         -
    >;
37067         -
37068         -
    fn poll(
37069         -
        self: std::pin::Pin<&mut Self>,
37070         -
        cx: &mut std::task::Context<'_>,
37071         -
    ) -> std::task::Poll<Self::Output> {
37072         -
        let this = self.project();
37073         -
        this.inner.as_mut().poll(cx)
37074         -
    }
37075         -
}
37076         -
37077         -
impl<B>
37078         -
    ::aws_smithy_http_server::request::FromRequest<
37079         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37080         -
        B,
37081         -
    > for crate::input::JsonUnionsInput
37082         -
where
37083         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37084         -
    B: 'static,
37085         -
37086         -
    B::Data: Send,
37087         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37088         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37089         -
{
37090         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37091         -
    type Future = JsonUnionsInputFuture;
37092         -
37093         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37094         -
        let fut = async move {
37095         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37096         -
                request.headers(),
37097         -
                &CONTENT_TYPE_JSONUNIONS,
37098         -
            ) {
37099         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37100         -
            }
37101         -
            crate::protocol_serde::shape_json_unions::de_json_unions_http_request(request)
37102         -
                .await
37103         -
                .map_err(Into::into)
37104         -
        };
37105         -
        use ::futures_util::future::TryFutureExt;
37106         -
        let fut = fut.map_err(
37107         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37108         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37109         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37110         -
                    e,
37111         -
                )
37112         -
            },
       36815  +
    /// Serializes query string parameters with all supported types
       36816  +
    /// Test ID: RestJsonAllQueryStringTypes
       36817  +
    #[::tokio::test]
       36818  +
    #[::tracing_test::traced_test]
       36819  +
    async fn rest_json_all_query_string_types_request() {
       36820  +
        #[allow(unused_mut)]
       36821  +
        let mut http_request = http::Request::builder()
       36822  +
            .uri("/AllQueryStringTypesInput")
       36823  +
            .method("GET")
       36824  +
            .body(::aws_smithy_http_server::body::Body::from(
       36825  +
                ::bytes::Bytes::from_static("".as_bytes()),
       36826  +
            ))
       36827  +
            .unwrap();
       36828  +
        *http_request.uri_mut() = "/AllQueryStringTypesInput?String=Hello%20there&StringList=a&StringList=b&StringList=c&StringSet=a&StringSet=b&StringSet=c&Byte=1&Short=2&Integer=3&IntegerList=1&IntegerList=2&IntegerList=3&IntegerSet=1&IntegerSet=2&IntegerSet=3&Long=4&Float=1.1&Double=1.1&DoubleList=1.1&DoubleList=2.1&DoubleList=3.1&Boolean=true&BooleanList=true&BooleanList=false&BooleanList=true&Timestamp=1970-01-01T00%3A00%3A01Z&TimestampList=1970-01-01T00%3A00%3A01Z&TimestampList=1970-01-01T00%3A00%3A02Z&TimestampList=1970-01-01T00%3A00%3A03Z&Enum=Foo&EnumList=Foo&EnumList=Baz&EnumList=Bar&IntegerEnum=1&IntegerEnumList=1&IntegerEnumList=2&IntegerEnumList=3".parse().unwrap();
       36829  +
        #[allow(unused_mut)]
       36830  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       36831  +
        let config = crate::service::RestJsonConfig::builder().build();
       36832  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       36833  +
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
       36834  +
                let sender = sender.clone();
       36835  +
                async move {
       36836  +
                    let result = {
       36837  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       36838  +
                        let expected = crate::input::AllQueryStringTypesInput {
       36839  +
                            query_string: ::std::option::Option::Some("Hello there".to_owned()),
       36840  +
                            query_string_list: ::std::option::Option::Some(vec![
       36841  +
                                "a".to_owned(),
       36842  +
                                "b".to_owned(),
       36843  +
                                "c".to_owned(),
       36844  +
                            ]),
       36845  +
                            query_string_set: ::std::option::Option::Some(
       36846  +
                                vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]
       36847  +
                                    .try_into()
       36848  +
                                    .expect("this is only used in tests"),
       36849  +
                            ),
       36850  +
                            query_byte: ::std::option::Option::Some(1),
       36851  +
                            query_short: ::std::option::Option::Some(2),
       36852  +
                            query_integer: ::std::option::Option::Some(3),
       36853  +
                            query_integer_list: ::std::option::Option::Some(vec![1, 2, 3]),
       36854  +
                            query_integer_set: ::std::option::Option::Some(
       36855  +
                                vec![1, 2, 3]
       36856  +
                                    .try_into()
       36857  +
                                    .expect("this is only used in tests"),
       36858  +
                            ),
       36859  +
                            query_long: ::std::option::Option::Some(4),
       36860  +
                            query_float: ::std::option::Option::Some(1.1_f32),
       36861  +
                            query_double: ::std::option::Option::Some(1.1_f64),
       36862  +
                            query_double_list: ::std::option::Option::Some(vec![
       36863  +
                                1.1_f64, 2.1_f64, 3.1_f64,
       36864  +
                            ]),
       36865  +
                            query_boolean: ::std::option::Option::Some(true),
       36866  +
                            query_boolean_list: ::std::option::Option::Some(vec![
       36867  +
                                true, false, true,
       36868  +
                            ]),
       36869  +
                            query_timestamp: ::std::option::Option::Some(
       36870  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(1, 0_f64),
       36871  +
                            ),
       36872  +
                            query_timestamp_list: ::std::option::Option::Some(vec![
       36873  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(1, 0_f64),
       36874  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(2, 0_f64),
       36875  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(3, 0_f64),
       36876  +
                            ]),
       36877  +
                            query_enum: ::std::option::Option::Some(
       36878  +
                                "Foo"
       36879  +
                                    .parse::<crate::model::FooEnum>()
       36880  +
                                    .expect("static value validated to member"),
       36881  +
                            ),
       36882  +
                            query_enum_list: ::std::option::Option::Some(vec![
       36883  +
                                "Foo"
       36884  +
                                    .parse::<crate::model::FooEnum>()
       36885  +
                                    .expect("static value validated to member"),
       36886  +
                                "Baz"
       36887  +
                                    .parse::<crate::model::FooEnum>()
       36888  +
                                    .expect("static value validated to member"),
       36889  +
                                "Bar"
       36890  +
                                    .parse::<crate::model::FooEnum>()
       36891  +
                                    .expect("static value validated to member"),
       36892  +
                            ]),
       36893  +
                            query_integer_enum: ::std::option::Option::Some(1),
       36894  +
                            query_integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
       36895  +
                            query_params_map_of_string_list: ::std::option::Option::Some({
       36896  +
                                let mut ret = ::std::collections::HashMap::new();
       36897  +
                                ret.insert("String".to_owned(), vec!["Hello there".to_owned()]);
       36898  +
                                ret.insert(
       36899  +
                                    "StringList".to_owned(),
       36900  +
                                    vec!["a".to_owned(), "b".to_owned(), "c".to_owned()],
37113  36901   
                                );
37114         -
        JsonUnionsInputFuture {
37115         -
            inner: Box::pin(fut),
37116         -
        }
37117         -
    }
37118         -
}
37119         -
impl
37120         -
    ::aws_smithy_http_server::response::IntoResponse<
37121         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37122         -
    > for crate::output::JsonUnionsOutput
37123         -
{
37124         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37125         -
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_response(self) {
37126         -
            Ok(response) => response,
37127         -
            Err(e) => {
37128         -
                ::tracing::error!(error = %e, "failed to serialize response");
37129         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37130         -
            }
37131         -
        }
37132         -
    }
37133         -
}
37134         -
impl
37135         -
    ::aws_smithy_http_server::response::IntoResponse<
37136         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37137         -
    > for crate::error::JsonUnionsError
37138         -
{
37139         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37140         -
        match crate::protocol_serde::shape_json_unions::ser_json_unions_http_error(&self) {
37141         -
            Ok(mut response) => {
37142         -
                response.extensions_mut().insert(
37143         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       36902  +
                                ret.insert(
       36903  +
                                    "StringSet".to_owned(),
       36904  +
                                    vec!["a".to_owned(), "b".to_owned(), "c".to_owned()],
37144  36905   
                                );
37145         -
                response
37146         -
            }
37147         -
            Err(e) => {
37148         -
                ::tracing::error!(error = %e, "failed to serialize response");
37149         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37150         -
            }
37151         -
        }
37152         -
    }
37153         -
}
37154         -
37155         -
const CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE: ::mime::Mime = ::mime::APPLICATION_JSON;
37156         -
::pin_project_lite::pin_project! {
37157         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37158         -
    /// [`DocumentTypeAsMapValueInput`](crate::input::DocumentTypeAsMapValueInput) using modelled bindings.
37159         -
    pub struct DocumentTypeAsMapValueInputFuture {
37160         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DocumentTypeAsMapValueInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37161         -
    }
37162         -
}
37163         -
37164         -
impl std::future::Future for DocumentTypeAsMapValueInputFuture {
37165         -
    type Output = Result<
37166         -
        crate::input::DocumentTypeAsMapValueInput,
37167         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37168         -
    >;
37169         -
37170         -
    fn poll(
37171         -
        self: std::pin::Pin<&mut Self>,
37172         -
        cx: &mut std::task::Context<'_>,
37173         -
    ) -> std::task::Poll<Self::Output> {
37174         -
        let this = self.project();
37175         -
        this.inner.as_mut().poll(cx)
37176         -
    }
37177         -
}
37178         -
37179         -
impl<B>
37180         -
    ::aws_smithy_http_server::request::FromRequest<
37181         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37182         -
        B,
37183         -
    > for crate::input::DocumentTypeAsMapValueInput
37184         -
where
37185         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37186         -
    B: 'static,
37187         -
37188         -
    B::Data: Send,
37189         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37190         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37191         -
{
37192         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37193         -
    type Future = DocumentTypeAsMapValueInputFuture;
37194         -
37195         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37196         -
        let fut = async move {
37197         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37198         -
                request.headers(),
37199         -
                &CONTENT_TYPE_DOCUMENTTYPEASMAPVALUE,
37200         -
            ) {
37201         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37202         -
            }
37203         -
            crate::protocol_serde::shape_document_type_as_map_value::de_document_type_as_map_value_http_request(request)
37204         -
                            .await
37205         -
                            .map_err(Into::into)
37206         -
        };
37207         -
        use ::futures_util::future::TryFutureExt;
37208         -
        let fut = fut.map_err(
37209         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37210         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37211         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37212         -
                    e,
37213         -
                )
37214         -
            },
       36906  +
                                ret.insert("Byte".to_owned(), vec!["1".to_owned()]);
       36907  +
                                ret.insert("Short".to_owned(), vec!["2".to_owned()]);
       36908  +
                                ret.insert("Integer".to_owned(), vec!["3".to_owned()]);
       36909  +
                                ret.insert(
       36910  +
                                    "IntegerList".to_owned(),
       36911  +
                                    vec!["1".to_owned(), "2".to_owned(), "3".to_owned()],
37215  36912   
                                );
37216         -
        DocumentTypeAsMapValueInputFuture {
37217         -
            inner: Box::pin(fut),
37218         -
        }
37219         -
    }
37220         -
}
37221         -
impl
37222         -
    ::aws_smithy_http_server::response::IntoResponse<
37223         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37224         -
    > for crate::output::DocumentTypeAsMapValueOutput
37225         -
{
37226         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37227         -
        match crate::protocol_serde::shape_document_type_as_map_value::ser_document_type_as_map_value_http_response(self) {
37228         -
                        Ok(response) => response,
37229         -
                        Err(e) => {
37230         -
                            ::tracing::error!(error = %e, "failed to serialize response");
37231         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37232         -
                        }
37233         -
                    }
37234         -
    }
37235         -
}
37236         -
37237         -
const CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD: ::mime::Mime = ::mime::APPLICATION_JSON;
37238         -
::pin_project_lite::pin_project! {
37239         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37240         -
    /// [`DocumentTypeAsPayloadInput`](crate::input::DocumentTypeAsPayloadInput) using modelled bindings.
37241         -
    pub struct DocumentTypeAsPayloadInputFuture {
37242         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DocumentTypeAsPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37243         -
    }
37244         -
}
37245         -
37246         -
impl std::future::Future for DocumentTypeAsPayloadInputFuture {
37247         -
    type Output = Result<
37248         -
        crate::input::DocumentTypeAsPayloadInput,
37249         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37250         -
    >;
37251         -
37252         -
    fn poll(
37253         -
        self: std::pin::Pin<&mut Self>,
37254         -
        cx: &mut std::task::Context<'_>,
37255         -
    ) -> std::task::Poll<Self::Output> {
37256         -
        let this = self.project();
37257         -
        this.inner.as_mut().poll(cx)
37258         -
    }
37259         -
}
37260         -
37261         -
impl<B>
37262         -
    ::aws_smithy_http_server::request::FromRequest<
37263         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37264         -
        B,
37265         -
    > for crate::input::DocumentTypeAsPayloadInput
37266         -
where
37267         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37268         -
    B: 'static,
37269         -
37270         -
    B::Data: Send,
37271         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37272         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37273         -
{
37274         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37275         -
    type Future = DocumentTypeAsPayloadInputFuture;
37276         -
37277         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37278         -
        let fut = async move {
37279         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37280         -
                request.headers(),
37281         -
                &CONTENT_TYPE_DOCUMENTTYPEASPAYLOAD,
37282         -
            ) {
37283         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37284         -
            }
37285         -
            crate::protocol_serde::shape_document_type_as_payload::de_document_type_as_payload_http_request(request)
37286         -
                            .await
37287         -
                            .map_err(Into::into)
37288         -
        };
37289         -
        use ::futures_util::future::TryFutureExt;
37290         -
        let fut = fut.map_err(
37291         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37292         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37293         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37294         -
                    e,
37295         -
                )
37296         -
            },
       36913  +
                                ret.insert(
       36914  +
                                    "IntegerSet".to_owned(),
       36915  +
                                    vec!["1".to_owned(), "2".to_owned(), "3".to_owned()],
37297  36916   
                                );
37298         -
        DocumentTypeAsPayloadInputFuture {
37299         -
            inner: Box::pin(fut),
37300         -
        }
37301         -
    }
37302         -
}
37303         -
impl
37304         -
    ::aws_smithy_http_server::response::IntoResponse<
37305         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37306         -
    > for crate::output::DocumentTypeAsPayloadOutput
37307         -
{
37308         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37309         -
        match crate::protocol_serde::shape_document_type_as_payload::ser_document_type_as_payload_http_response(self) {
37310         -
                        Ok(response) => response,
37311         -
                        Err(e) => {
37312         -
                            ::tracing::error!(error = %e, "failed to serialize response");
37313         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37314         -
                        }
37315         -
                    }
37316         -
    }
37317         -
}
37318         -
37319         -
const CONTENT_TYPE_DOCUMENTTYPE: ::mime::Mime = ::mime::APPLICATION_JSON;
37320         -
::pin_project_lite::pin_project! {
37321         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37322         -
    /// [`DocumentTypeInput`](crate::input::DocumentTypeInput) using modelled bindings.
37323         -
    pub struct DocumentTypeInputFuture {
37324         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::DocumentTypeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37325         -
    }
37326         -
}
37327         -
37328         -
impl std::future::Future for DocumentTypeInputFuture {
37329         -
    type Output = Result<
37330         -
        crate::input::DocumentTypeInput,
37331         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37332         -
    >;
37333         -
37334         -
    fn poll(
37335         -
        self: std::pin::Pin<&mut Self>,
37336         -
        cx: &mut std::task::Context<'_>,
37337         -
    ) -> std::task::Poll<Self::Output> {
37338         -
        let this = self.project();
37339         -
        this.inner.as_mut().poll(cx)
37340         -
    }
37341         -
}
37342         -
37343         -
impl<B>
37344         -
    ::aws_smithy_http_server::request::FromRequest<
37345         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37346         -
        B,
37347         -
    > for crate::input::DocumentTypeInput
37348         -
where
37349         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37350         -
    B: 'static,
37351         -
37352         -
    B::Data: Send,
37353         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37354         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37355         -
{
37356         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37357         -
    type Future = DocumentTypeInputFuture;
37358         -
37359         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37360         -
        let fut = async move {
37361         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37362         -
                request.headers(),
37363         -
                &CONTENT_TYPE_DOCUMENTTYPE,
37364         -
            ) {
37365         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37366         -
            }
37367         -
            crate::protocol_serde::shape_document_type::de_document_type_http_request(request)
37368         -
                .await
37369         -
                .map_err(Into::into)
37370         -
        };
37371         -
        use ::futures_util::future::TryFutureExt;
37372         -
        let fut = fut.map_err(
37373         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37374         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37375         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37376         -
                    e,
37377         -
                )
37378         -
            },
       36917  +
                                ret.insert("Long".to_owned(), vec!["4".to_owned()]);
       36918  +
                                ret.insert("Float".to_owned(), vec!["1.1".to_owned()]);
       36919  +
                                ret.insert("Double".to_owned(), vec!["1.1".to_owned()]);
       36920  +
                                ret.insert(
       36921  +
                                    "DoubleList".to_owned(),
       36922  +
                                    vec!["1.1".to_owned(), "2.1".to_owned(), "3.1".to_owned()],
37379  36923   
                                );
37380         -
        DocumentTypeInputFuture {
37381         -
            inner: Box::pin(fut),
37382         -
        }
37383         -
    }
37384         -
}
37385         -
impl
37386         -
    ::aws_smithy_http_server::response::IntoResponse<
37387         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37388         -
    > for crate::output::DocumentTypeOutput
37389         -
{
37390         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37391         -
        match crate::protocol_serde::shape_document_type::ser_document_type_http_response(self) {
37392         -
            Ok(response) => response,
37393         -
            Err(e) => {
37394         -
                ::tracing::error!(error = %e, "failed to serialize response");
37395         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37396         -
            }
37397         -
        }
37398         -
    }
37399         -
}
37400         -
37401         -
const CONTENT_TYPE_JSONBLOBS: ::mime::Mime = ::mime::APPLICATION_JSON;
37402         -
::pin_project_lite::pin_project! {
37403         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37404         -
    /// [`JsonBlobsInput`](crate::input::JsonBlobsInput) using modelled bindings.
37405         -
    pub struct JsonBlobsInputFuture {
37406         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonBlobsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37407         -
    }
37408         -
}
37409         -
37410         -
impl std::future::Future for JsonBlobsInputFuture {
37411         -
    type Output = Result<
37412         -
        crate::input::JsonBlobsInput,
37413         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37414         -
    >;
37415         -
37416         -
    fn poll(
37417         -
        self: std::pin::Pin<&mut Self>,
37418         -
        cx: &mut std::task::Context<'_>,
37419         -
    ) -> std::task::Poll<Self::Output> {
37420         -
        let this = self.project();
37421         -
        this.inner.as_mut().poll(cx)
37422         -
    }
37423         -
}
37424         -
37425         -
impl<B>
37426         -
    ::aws_smithy_http_server::request::FromRequest<
37427         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37428         -
        B,
37429         -
    > for crate::input::JsonBlobsInput
37430         -
where
37431         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37432         -
    B: 'static,
37433         -
37434         -
    B::Data: Send,
37435         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37436         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37437         -
{
37438         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37439         -
    type Future = JsonBlobsInputFuture;
37440         -
37441         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37442         -
        let fut = async move {
37443         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37444         -
                request.headers(),
37445         -
                &CONTENT_TYPE_JSONBLOBS,
37446         -
            ) {
37447         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37448         -
            }
37449         -
            crate::protocol_serde::shape_json_blobs::de_json_blobs_http_request(request)
37450         -
                .await
37451         -
                .map_err(Into::into)
37452         -
        };
37453         -
        use ::futures_util::future::TryFutureExt;
37454         -
        let fut = fut.map_err(
37455         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37456         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37457         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37458         -
                    e,
37459         -
                )
37460         -
            },
       36924  +
                                ret.insert("Boolean".to_owned(), vec!["true".to_owned()]);
       36925  +
                                ret.insert(
       36926  +
                                    "BooleanList".to_owned(),
       36927  +
                                    vec!["true".to_owned(), "false".to_owned(), "true".to_owned()],
37461  36928   
                                );
37462         -
        JsonBlobsInputFuture {
37463         -
            inner: Box::pin(fut),
37464         -
        }
37465         -
    }
37466         -
}
37467         -
impl
37468         -
    ::aws_smithy_http_server::response::IntoResponse<
37469         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37470         -
    > for crate::output::JsonBlobsOutput
37471         -
{
37472         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37473         -
        match crate::protocol_serde::shape_json_blobs::ser_json_blobs_http_response(self) {
37474         -
            Ok(response) => response,
37475         -
            Err(e) => {
37476         -
                ::tracing::error!(error = %e, "failed to serialize response");
37477         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37478         -
            }
37479         -
        }
37480         -
    }
37481         -
}
37482         -
37483         -
const CONTENT_TYPE_SPARSEJSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
37484         -
::pin_project_lite::pin_project! {
37485         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37486         -
    /// [`SparseJsonMapsInput`](crate::input::SparseJsonMapsInput) using modelled bindings.
37487         -
    pub struct SparseJsonMapsInputFuture {
37488         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SparseJsonMapsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37489         -
    }
37490         -
}
37491         -
37492         -
impl std::future::Future for SparseJsonMapsInputFuture {
37493         -
    type Output = Result<
37494         -
        crate::input::SparseJsonMapsInput,
37495         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37496         -
    >;
37497         -
37498         -
    fn poll(
37499         -
        self: std::pin::Pin<&mut Self>,
37500         -
        cx: &mut std::task::Context<'_>,
37501         -
    ) -> std::task::Poll<Self::Output> {
37502         -
        let this = self.project();
37503         -
        this.inner.as_mut().poll(cx)
37504         -
    }
37505         -
}
37506         -
37507         -
impl<B>
37508         -
    ::aws_smithy_http_server::request::FromRequest<
37509         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37510         -
        B,
37511         -
    > for crate::input::SparseJsonMapsInput
37512         -
where
37513         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37514         -
    B: 'static,
37515         -
37516         -
    B::Data: Send,
37517         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37518         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37519         -
{
37520         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37521         -
    type Future = SparseJsonMapsInputFuture;
37522         -
37523         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37524         -
        let fut = async move {
37525         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37526         -
                request.headers(),
37527         -
                &CONTENT_TYPE_SPARSEJSONMAPS,
37528         -
            ) {
37529         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37530         -
            }
37531         -
            crate::protocol_serde::shape_sparse_json_maps::de_sparse_json_maps_http_request(request)
37532         -
                .await
37533         -
                .map_err(Into::into)
37534         -
        };
37535         -
        use ::futures_util::future::TryFutureExt;
37536         -
        let fut = fut.map_err(
37537         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37538         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37539         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37540         -
                    e,
37541         -
                )
37542         -
            },
       36929  +
                                ret.insert(
       36930  +
                                    "Timestamp".to_owned(),
       36931  +
                                    vec!["1970-01-01T00:00:01Z".to_owned()],
37543  36932   
                                );
37544         -
        SparseJsonMapsInputFuture {
37545         -
            inner: Box::pin(fut),
37546         -
        }
37547         -
    }
37548         -
}
37549         -
impl
37550         -
    ::aws_smithy_http_server::response::IntoResponse<
37551         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37552         -
    > for crate::output::SparseJsonMapsOutput
37553         -
{
37554         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37555         -
        match crate::protocol_serde::shape_sparse_json_maps::ser_sparse_json_maps_http_response(
37556         -
            self,
37557         -
        ) {
37558         -
            Ok(response) => response,
37559         -
            Err(e) => {
37560         -
                ::tracing::error!(error = %e, "failed to serialize response");
37561         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37562         -
            }
37563         -
        }
37564         -
    }
37565         -
}
37566         -
impl
37567         -
    ::aws_smithy_http_server::response::IntoResponse<
37568         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37569         -
    > for crate::error::SparseJsonMapsError
37570         -
{
37571         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37572         -
        match crate::protocol_serde::shape_sparse_json_maps::ser_sparse_json_maps_http_error(&self)
37573         -
        {
37574         -
            Ok(mut response) => {
37575         -
                response.extensions_mut().insert(
37576         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       36933  +
                                ret.insert(
       36934  +
                                    "TimestampList".to_owned(),
       36935  +
                                    vec![
       36936  +
                                        "1970-01-01T00:00:01Z".to_owned(),
       36937  +
                                        "1970-01-01T00:00:02Z".to_owned(),
       36938  +
                                        "1970-01-01T00:00:03Z".to_owned(),
       36939  +
                                    ],
37577  36940   
                                );
37578         -
                response
37579         -
            }
37580         -
            Err(e) => {
37581         -
                ::tracing::error!(error = %e, "failed to serialize response");
37582         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37583         -
            }
37584         -
        }
37585         -
    }
37586         -
}
37587         -
37588         -
const CONTENT_TYPE_JSONMAPS: ::mime::Mime = ::mime::APPLICATION_JSON;
37589         -
::pin_project_lite::pin_project! {
37590         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37591         -
    /// [`JsonMapsInput`](crate::input::JsonMapsInput) using modelled bindings.
37592         -
    pub struct JsonMapsInputFuture {
37593         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonMapsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37594         -
    }
37595         -
}
37596         -
37597         -
impl std::future::Future for JsonMapsInputFuture {
37598         -
    type Output = Result<
37599         -
        crate::input::JsonMapsInput,
37600         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37601         -
    >;
37602         -
37603         -
    fn poll(
37604         -
        self: std::pin::Pin<&mut Self>,
37605         -
        cx: &mut std::task::Context<'_>,
37606         -
    ) -> std::task::Poll<Self::Output> {
37607         -
        let this = self.project();
37608         -
        this.inner.as_mut().poll(cx)
37609         -
    }
37610         -
}
37611         -
37612         -
impl<B>
37613         -
    ::aws_smithy_http_server::request::FromRequest<
37614         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37615         -
        B,
37616         -
    > for crate::input::JsonMapsInput
37617         -
where
37618         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37619         -
    B: 'static,
37620         -
37621         -
    B::Data: Send,
37622         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37623         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37624         -
{
37625         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37626         -
    type Future = JsonMapsInputFuture;
37627         -
37628         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37629         -
        let fut = async move {
37630         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37631         -
                request.headers(),
37632         -
                &CONTENT_TYPE_JSONMAPS,
37633         -
            ) {
37634         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37635         -
            }
37636         -
            crate::protocol_serde::shape_json_maps::de_json_maps_http_request(request)
37637         -
                .await
37638         -
                .map_err(Into::into)
       36941  +
                                ret.insert("Enum".to_owned(), vec!["Foo".to_owned()]);
       36942  +
                                ret.insert(
       36943  +
                                    "EnumList".to_owned(),
       36944  +
                                    vec!["Foo".to_owned(), "Baz".to_owned(), "Bar".to_owned()],
       36945  +
                                );
       36946  +
                                ret.insert("IntegerEnum".to_owned(), vec!["1".to_owned()]);
       36947  +
                                ret.insert(
       36948  +
                                    "IntegerEnumList".to_owned(),
       36949  +
                                    vec!["1".to_owned(), "2".to_owned(), "3".to_owned()],
       36950  +
                                );
       36951  +
                                ret
       36952  +
                            }),
37639  36953   
                        };
37640         -
        use ::futures_util::future::TryFutureExt;
37641         -
        let fut = fut.map_err(
37642         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37643         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37644         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37645         -
                    e,
37646         -
                )
37647         -
            },
       36954  +
                        ::pretty_assertions::assert_eq!(
       36955  +
                            input.query_string,
       36956  +
                            expected.query_string,
       36957  +
                            "Unexpected value for `query_string`"
       36958  +
                        );
       36959  +
                        ::pretty_assertions::assert_eq!(
       36960  +
                            input.query_string_list,
       36961  +
                            expected.query_string_list,
       36962  +
                            "Unexpected value for `query_string_list`"
       36963  +
                        );
       36964  +
                        ::pretty_assertions::assert_eq!(
       36965  +
                            input.query_string_set,
       36966  +
                            expected.query_string_set,
       36967  +
                            "Unexpected value for `query_string_set`"
       36968  +
                        );
       36969  +
                        ::pretty_assertions::assert_eq!(
       36970  +
                            input.query_byte,
       36971  +
                            expected.query_byte,
       36972  +
                            "Unexpected value for `query_byte`"
       36973  +
                        );
       36974  +
                        ::pretty_assertions::assert_eq!(
       36975  +
                            input.query_short,
       36976  +
                            expected.query_short,
       36977  +
                            "Unexpected value for `query_short`"
       36978  +
                        );
       36979  +
                        ::pretty_assertions::assert_eq!(
       36980  +
                            input.query_integer,
       36981  +
                            expected.query_integer,
       36982  +
                            "Unexpected value for `query_integer`"
       36983  +
                        );
       36984  +
                        ::pretty_assertions::assert_eq!(
       36985  +
                            input.query_integer_list,
       36986  +
                            expected.query_integer_list,
       36987  +
                            "Unexpected value for `query_integer_list`"
       36988  +
                        );
       36989  +
                        ::pretty_assertions::assert_eq!(
       36990  +
                            input.query_integer_set,
       36991  +
                            expected.query_integer_set,
       36992  +
                            "Unexpected value for `query_integer_set`"
       36993  +
                        );
       36994  +
                        ::pretty_assertions::assert_eq!(
       36995  +
                            input.query_long,
       36996  +
                            expected.query_long,
       36997  +
                            "Unexpected value for `query_long`"
       36998  +
                        );
       36999  +
                        assert!(
       37000  +
                            input.query_float.float_equals(&expected.query_float),
       37001  +
                            "Unexpected value for `query_float` {:?} vs. {:?}",
       37002  +
                            expected.query_float,
       37003  +
                            input.query_float
37648  37004   
                        );
37649         -
        JsonMapsInputFuture {
37650         -
            inner: Box::pin(fut),
37651         -
        }
37652         -
    }
37653         -
}
37654         -
impl
37655         -
    ::aws_smithy_http_server::response::IntoResponse<
37656         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37657         -
    > for crate::output::JsonMapsOutput
37658         -
{
37659         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37660         -
        match crate::protocol_serde::shape_json_maps::ser_json_maps_http_response(self) {
37661         -
            Ok(response) => response,
37662         -
            Err(e) => {
37663         -
                ::tracing::error!(error = %e, "failed to serialize response");
37664         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37665         -
            }
37666         -
        }
37667         -
    }
37668         -
}
37669         -
impl
37670         -
    ::aws_smithy_http_server::response::IntoResponse<
37671         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37672         -
    > for crate::error::JsonMapsError
37673         -
{
37674         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37675         -
        match crate::protocol_serde::shape_json_maps::ser_json_maps_http_error(&self) {
37676         -
            Ok(mut response) => {
37677         -
                response.extensions_mut().insert(
37678         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       37005  +
                        assert!(
       37006  +
                            input.query_double.float_equals(&expected.query_double),
       37007  +
                            "Unexpected value for `query_double` {:?} vs. {:?}",
       37008  +
                            expected.query_double,
       37009  +
                            input.query_double
37679  37010   
                        );
37680         -
                response
37681         -
            }
37682         -
            Err(e) => {
37683         -
                ::tracing::error!(error = %e, "failed to serialize response");
37684         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37685         -
            }
37686         -
        }
37687         -
    }
37688         -
}
37689         -
37690         -
const CONTENT_TYPE_SPARSEJSONLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
37691         -
::pin_project_lite::pin_project! {
37692         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37693         -
    /// [`SparseJsonListsInput`](crate::input::SparseJsonListsInput) using modelled bindings.
37694         -
    pub struct SparseJsonListsInputFuture {
37695         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SparseJsonListsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37696         -
    }
37697         -
}
37698         -
37699         -
impl std::future::Future for SparseJsonListsInputFuture {
37700         -
    type Output = Result<
37701         -
        crate::input::SparseJsonListsInput,
37702         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37703         -
    >;
37704         -
37705         -
    fn poll(
37706         -
        self: std::pin::Pin<&mut Self>,
37707         -
        cx: &mut std::task::Context<'_>,
37708         -
    ) -> std::task::Poll<Self::Output> {
37709         -
        let this = self.project();
37710         -
        this.inner.as_mut().poll(cx)
37711         -
    }
37712         -
}
37713         -
37714         -
impl<B>
37715         -
    ::aws_smithy_http_server::request::FromRequest<
37716         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37717         -
        B,
37718         -
    > for crate::input::SparseJsonListsInput
37719         -
where
37720         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37721         -
    B: 'static,
37722         -
37723         -
    B::Data: Send,
37724         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37725         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37726         -
{
37727         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37728         -
    type Future = SparseJsonListsInputFuture;
37729         -
37730         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37731         -
        let fut = async move {
37732         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37733         -
                request.headers(),
37734         -
                &CONTENT_TYPE_SPARSEJSONLISTS,
37735         -
            ) {
37736         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37737         -
            }
37738         -
            crate::protocol_serde::shape_sparse_json_lists::de_sparse_json_lists_http_request(
37739         -
                request,
37740         -
            )
37741         -
            .await
37742         -
            .map_err(Into::into)
37743         -
        };
37744         -
        use ::futures_util::future::TryFutureExt;
37745         -
        let fut = fut.map_err(
37746         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37747         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37748         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37749         -
                    e,
37750         -
                )
37751         -
            },
       37011  +
                        ::pretty_assertions::assert_eq!(
       37012  +
                            input.query_double_list,
       37013  +
                            expected.query_double_list,
       37014  +
                            "Unexpected value for `query_double_list`"
37752  37015   
                        );
37753         -
        SparseJsonListsInputFuture {
37754         -
            inner: Box::pin(fut),
37755         -
        }
37756         -
    }
37757         -
}
37758         -
impl
37759         -
    ::aws_smithy_http_server::response::IntoResponse<
37760         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37761         -
    > for crate::output::SparseJsonListsOutput
37762         -
{
37763         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37764         -
        match crate::protocol_serde::shape_sparse_json_lists::ser_sparse_json_lists_http_response(
37765         -
            self,
37766         -
        ) {
37767         -
            Ok(response) => response,
37768         -
            Err(e) => {
37769         -
                ::tracing::error!(error = %e, "failed to serialize response");
37770         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37771         -
            }
37772         -
        }
37773         -
    }
37774         -
}
37775         -
37776         -
const CONTENT_TYPE_JSONLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
37777         -
::pin_project_lite::pin_project! {
37778         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37779         -
    /// [`JsonListsInput`](crate::input::JsonListsInput) using modelled bindings.
37780         -
    pub struct JsonListsInputFuture {
37781         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonListsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37782         -
    }
37783         -
}
37784         -
37785         -
impl std::future::Future for JsonListsInputFuture {
37786         -
    type Output = Result<
37787         -
        crate::input::JsonListsInput,
37788         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37789         -
    >;
37790         -
37791         -
    fn poll(
37792         -
        self: std::pin::Pin<&mut Self>,
37793         -
        cx: &mut std::task::Context<'_>,
37794         -
    ) -> std::task::Poll<Self::Output> {
37795         -
        let this = self.project();
37796         -
        this.inner.as_mut().poll(cx)
37797         -
    }
37798         -
}
37799         -
37800         -
impl<B>
37801         -
    ::aws_smithy_http_server::request::FromRequest<
37802         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37803         -
        B,
37804         -
    > for crate::input::JsonListsInput
37805         -
where
37806         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37807         -
    B: 'static,
37808         -
37809         -
    B::Data: Send,
37810         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37811         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37812         -
{
37813         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37814         -
    type Future = JsonListsInputFuture;
37815         -
37816         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37817         -
        let fut = async move {
37818         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37819         -
                request.headers(),
37820         -
                &CONTENT_TYPE_JSONLISTS,
37821         -
            ) {
37822         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
37823         -
            }
37824         -
            crate::protocol_serde::shape_json_lists::de_json_lists_http_request(request)
37825         -
                .await
37826         -
                .map_err(Into::into)
37827         -
        };
37828         -
        use ::futures_util::future::TryFutureExt;
37829         -
        let fut = fut.map_err(
37830         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37831         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37832         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37833         -
                    e,
37834         -
                )
37835         -
            },
       37016  +
                        ::pretty_assertions::assert_eq!(
       37017  +
                            input.query_boolean,
       37018  +
                            expected.query_boolean,
       37019  +
                            "Unexpected value for `query_boolean`"
37836  37020   
                        );
37837         -
        JsonListsInputFuture {
37838         -
            inner: Box::pin(fut),
37839         -
        }
37840         -
    }
37841         -
}
37842         -
impl
37843         -
    ::aws_smithy_http_server::response::IntoResponse<
37844         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37845         -
    > for crate::output::JsonListsOutput
37846         -
{
37847         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37848         -
        match crate::protocol_serde::shape_json_lists::ser_json_lists_http_response(self) {
37849         -
            Ok(response) => response,
37850         -
            Err(e) => {
37851         -
                ::tracing::error!(error = %e, "failed to serialize response");
37852         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37853         -
            }
37854         -
        }
37855         -
    }
37856         -
}
37857         -
impl
37858         -
    ::aws_smithy_http_server::response::IntoResponse<
37859         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37860         -
    > for crate::error::JsonListsError
37861         -
{
37862         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37863         -
        match crate::protocol_serde::shape_json_lists::ser_json_lists_http_error(&self) {
37864         -
            Ok(mut response) => {
37865         -
                response.extensions_mut().insert(
37866         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       37021  +
                        ::pretty_assertions::assert_eq!(
       37022  +
                            input.query_boolean_list,
       37023  +
                            expected.query_boolean_list,
       37024  +
                            "Unexpected value for `query_boolean_list`"
37867  37025   
                        );
37868         -
                response
37869         -
            }
37870         -
            Err(e) => {
37871         -
                ::tracing::error!(error = %e, "failed to serialize response");
37872         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37873         -
            }
37874         -
        }
37875         -
    }
37876         -
}
37877         -
37878         -
const CONTENT_TYPE_RECURSIVESHAPES: ::mime::Mime = ::mime::APPLICATION_JSON;
37879         -
::pin_project_lite::pin_project! {
37880         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37881         -
    /// [`RecursiveShapesInput`](crate::input::RecursiveShapesInput) using modelled bindings.
37882         -
    pub struct RecursiveShapesInputFuture {
37883         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RecursiveShapesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37884         -
    }
37885         -
}
37886         -
37887         -
impl std::future::Future for RecursiveShapesInputFuture {
37888         -
    type Output = Result<
37889         -
        crate::input::RecursiveShapesInput,
37890         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37891         -
    >;
37892         -
37893         -
    fn poll(
37894         -
        self: std::pin::Pin<&mut Self>,
37895         -
        cx: &mut std::task::Context<'_>,
37896         -
    ) -> std::task::Poll<Self::Output> {
37897         -
        let this = self.project();
37898         -
        this.inner.as_mut().poll(cx)
37899         -
    }
37900         -
}
37901         -
37902         -
impl<B>
37903         -
    ::aws_smithy_http_server::request::FromRequest<
37904         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37905         -
        B,
37906         -
    > for crate::input::RecursiveShapesInput
37907         -
where
37908         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37909         -
    B: 'static,
37910         -
37911         -
    B::Data: Send,
37912         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37913         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37914         -
{
37915         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
37916         -
    type Future = RecursiveShapesInputFuture;
37917         -
37918         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
37919         -
        let fut = async move {
37920         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
37921         -
                request.headers(),
37922         -
                &CONTENT_TYPE_RECURSIVESHAPES,
37923         -
            ) {
37924         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       37026  +
                        ::pretty_assertions::assert_eq!(
       37027  +
                            input.query_timestamp,
       37028  +
                            expected.query_timestamp,
       37029  +
                            "Unexpected value for `query_timestamp`"
       37030  +
                        );
       37031  +
                        ::pretty_assertions::assert_eq!(
       37032  +
                            input.query_timestamp_list,
       37033  +
                            expected.query_timestamp_list,
       37034  +
                            "Unexpected value for `query_timestamp_list`"
       37035  +
                        );
       37036  +
                        ::pretty_assertions::assert_eq!(
       37037  +
                            input.query_enum,
       37038  +
                            expected.query_enum,
       37039  +
                            "Unexpected value for `query_enum`"
       37040  +
                        );
       37041  +
                        ::pretty_assertions::assert_eq!(
       37042  +
                            input.query_enum_list,
       37043  +
                            expected.query_enum_list,
       37044  +
                            "Unexpected value for `query_enum_list`"
       37045  +
                        );
       37046  +
                        ::pretty_assertions::assert_eq!(
       37047  +
                            input.query_integer_enum,
       37048  +
                            expected.query_integer_enum,
       37049  +
                            "Unexpected value for `query_integer_enum`"
       37050  +
                        );
       37051  +
                        ::pretty_assertions::assert_eq!(
       37052  +
                            input.query_integer_enum_list,
       37053  +
                            expected.query_integer_enum_list,
       37054  +
                            "Unexpected value for `query_integer_enum_list`"
       37055  +
                        );
       37056  +
                        ::pretty_assertions::assert_eq!(
       37057  +
                            input.query_params_map_of_string_list,
       37058  +
                            expected.query_params_map_of_string_list,
       37059  +
                            "Unexpected value for `query_params_map_of_string_list`"
       37060  +
                        );
       37061  +
                        let response = crate::output::AllQueryStringTypesOutput {};
       37062  +
                        Ok(response)
       37063  +
                    };
       37064  +
                    sender.send(()).await.expect("receiver dropped early");
       37065  +
                    result
37925  37066   
                }
37926         -
            crate::protocol_serde::shape_recursive_shapes::de_recursive_shapes_http_request(request)
       37067  +
            })
       37068  +
            .build_unchecked();
       37069  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
37927  37070   
            .await
37928         -
                .map_err(Into::into)
37929         -
        };
37930         -
        use ::futures_util::future::TryFutureExt;
37931         -
        let fut = fut.map_err(
37932         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
37933         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
37934         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
37935         -
                    e,
37936         -
                )
37937         -
            },
       37071  +
            .expect("unable to make an HTTP request");
       37072  +
        assert!(
       37073  +
            receiver.recv().await.is_some(),
       37074  +
            "we expected operation handler to be invoked but it was not entered"
37938  37075   
        );
37939         -
        RecursiveShapesInputFuture {
37940         -
            inner: Box::pin(fut),
37941         -
        }
37942         -
    }
37943         -
}
37944         -
impl
37945         -
    ::aws_smithy_http_server::response::IntoResponse<
37946         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37947         -
    > for crate::output::RecursiveShapesOutput
37948         -
{
37949         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
37950         -
        match crate::protocol_serde::shape_recursive_shapes::ser_recursive_shapes_http_response(
37951         -
            self,
37952         -
        ) {
37953         -
            Ok(response) => response,
37954         -
            Err(e) => {
37955         -
                ::tracing::error!(error = %e, "failed to serialize response");
37956         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
37957         -
            }
37958         -
        }
37959         -
    }
37960         -
}
37961         -
37962         -
const CONTENT_TYPE_JSONINTENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
37963         -
::pin_project_lite::pin_project! {
37964         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
37965         -
    /// [`JsonIntEnumsInput`](crate::input::JsonIntEnumsInput) using modelled bindings.
37966         -
    pub struct JsonIntEnumsInputFuture {
37967         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonIntEnumsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
37968         -
    }
37969         -
}
37970         -
37971         -
impl std::future::Future for JsonIntEnumsInputFuture {
37972         -
    type Output = Result<
37973         -
        crate::input::JsonIntEnumsInput,
37974         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
37975         -
    >;
37976         -
37977         -
    fn poll(
37978         -
        self: std::pin::Pin<&mut Self>,
37979         -
        cx: &mut std::task::Context<'_>,
37980         -
    ) -> std::task::Poll<Self::Output> {
37981         -
        let this = self.project();
37982         -
        this.inner.as_mut().poll(cx)
37983         -
    }
37984         -
}
37985         -
37986         -
impl<B>
37987         -
    ::aws_smithy_http_server::request::FromRequest<
37988         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
37989         -
        B,
37990         -
    > for crate::input::JsonIntEnumsInput
37991         -
where
37992         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
37993         -
    B: 'static,
37994         -
37995         -
    B::Data: Send,
37996         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
37997         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
37998         -
{
37999         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38000         -
    type Future = JsonIntEnumsInputFuture;
38001         -
38002         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38003         -
        let fut = async move {
38004         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38005         -
                request.headers(),
38006         -
                &CONTENT_TYPE_JSONINTENUMS,
38007         -
            ) {
38008         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38009  37076   
    }
38010         -
            crate::protocol_serde::shape_json_int_enums::de_json_int_enums_http_request(request)
38011         -
                .await
38012         -
                .map_err(Into::into)
       37077  +
    /// Handles query string maps
       37078  +
    /// Test ID: RestJsonQueryStringMap
       37079  +
    #[::tokio::test]
       37080  +
    #[::tracing_test::traced_test]
       37081  +
    async fn rest_json_query_string_map_request() {
       37082  +
        #[allow(unused_mut)]
       37083  +
        let mut http_request = http::Request::builder()
       37084  +
            .uri("/AllQueryStringTypesInput")
       37085  +
            .method("GET")
       37086  +
            .body(::aws_smithy_http_server::body::Body::from(
       37087  +
                ::bytes::Bytes::from_static("".as_bytes()),
       37088  +
            ))
       37089  +
            .unwrap();
       37090  +
        *http_request.uri_mut() =
       37091  +
            "/AllQueryStringTypesInput?QueryParamsStringKeyA=Foo&QueryParamsStringKeyB=Bar"
       37092  +
                .parse()
       37093  +
                .unwrap();
       37094  +
        #[allow(unused_mut)]
       37095  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       37096  +
        let config = crate::service::RestJsonConfig::builder().build();
       37097  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       37098  +
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
       37099  +
                let sender = sender.clone();
       37100  +
                async move {
       37101  +
                    let result = {
       37102  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       37103  +
                        let expected = crate::input::AllQueryStringTypesInput {
       37104  +
                            query_params_map_of_string_list: ::std::option::Option::Some({
       37105  +
                                let mut ret = ::std::collections::HashMap::new();
       37106  +
                                ret.insert(
       37107  +
                                    "QueryParamsStringKeyA".to_owned(),
       37108  +
                                    vec!["Foo".to_owned()],
       37109  +
                                );
       37110  +
                                ret.insert(
       37111  +
                                    "QueryParamsStringKeyB".to_owned(),
       37112  +
                                    vec!["Bar".to_owned()],
       37113  +
                                );
       37114  +
                                ret
       37115  +
                            }),
       37116  +
                            query_string: ::std::option::Option::None,
       37117  +
                            query_string_list: ::std::option::Option::None,
       37118  +
                            query_string_set: ::std::option::Option::None,
       37119  +
                            query_byte: ::std::option::Option::None,
       37120  +
                            query_short: ::std::option::Option::None,
       37121  +
                            query_integer: ::std::option::Option::None,
       37122  +
                            query_integer_list: ::std::option::Option::None,
       37123  +
                            query_integer_set: ::std::option::Option::None,
       37124  +
                            query_long: ::std::option::Option::None,
       37125  +
                            query_float: ::std::option::Option::None,
       37126  +
                            query_double: ::std::option::Option::None,
       37127  +
                            query_double_list: ::std::option::Option::None,
       37128  +
                            query_boolean: ::std::option::Option::None,
       37129  +
                            query_boolean_list: ::std::option::Option::None,
       37130  +
                            query_timestamp: ::std::option::Option::None,
       37131  +
                            query_timestamp_list: ::std::option::Option::None,
       37132  +
                            query_enum: ::std::option::Option::None,
       37133  +
                            query_enum_list: ::std::option::Option::None,
       37134  +
                            query_integer_enum: ::std::option::Option::None,
       37135  +
                            query_integer_enum_list: ::std::option::Option::None,
38013  37136   
                        };
38014         -
        use ::futures_util::future::TryFutureExt;
38015         -
        let fut = fut.map_err(
38016         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38017         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38018         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38019         -
                    e,
38020         -
                )
38021         -
            },
       37137  +
                        ::pretty_assertions::assert_eq!(
       37138  +
                            input.query_string,
       37139  +
                            expected.query_string,
       37140  +
                            "Unexpected value for `query_string`"
       37141  +
                        );
       37142  +
                        ::pretty_assertions::assert_eq!(
       37143  +
                            input.query_string_list,
       37144  +
                            expected.query_string_list,
       37145  +
                            "Unexpected value for `query_string_list`"
       37146  +
                        );
       37147  +
                        ::pretty_assertions::assert_eq!(
       37148  +
                            input.query_string_set,
       37149  +
                            expected.query_string_set,
       37150  +
                            "Unexpected value for `query_string_set`"
       37151  +
                        );
       37152  +
                        ::pretty_assertions::assert_eq!(
       37153  +
                            input.query_byte,
       37154  +
                            expected.query_byte,
       37155  +
                            "Unexpected value for `query_byte`"
       37156  +
                        );
       37157  +
                        ::pretty_assertions::assert_eq!(
       37158  +
                            input.query_short,
       37159  +
                            expected.query_short,
       37160  +
                            "Unexpected value for `query_short`"
       37161  +
                        );
       37162  +
                        ::pretty_assertions::assert_eq!(
       37163  +
                            input.query_integer,
       37164  +
                            expected.query_integer,
       37165  +
                            "Unexpected value for `query_integer`"
38022  37166   
                        );
38023         -
        JsonIntEnumsInputFuture {
38024         -
            inner: Box::pin(fut),
38025         -
        }
38026         -
    }
38027         -
}
38028         -
impl
38029         -
    ::aws_smithy_http_server::response::IntoResponse<
38030         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38031         -
    > for crate::output::JsonIntEnumsOutput
38032         -
{
38033         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38034         -
        match crate::protocol_serde::shape_json_int_enums::ser_json_int_enums_http_response(self) {
38035         -
            Ok(response) => response,
38036         -
            Err(e) => {
38037         -
                ::tracing::error!(error = %e, "failed to serialize response");
38038         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38039         -
            }
38040         -
        }
38041         -
    }
38042         -
}
38043         -
impl
38044         -
    ::aws_smithy_http_server::response::IntoResponse<
38045         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38046         -
    > for crate::error::JsonIntEnumsError
38047         -
{
38048         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38049         -
        match crate::protocol_serde::shape_json_int_enums::ser_json_int_enums_http_error(&self) {
38050         -
            Ok(mut response) => {
38051         -
                response.extensions_mut().insert(
38052         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       37167  +
                        ::pretty_assertions::assert_eq!(
       37168  +
                            input.query_integer_list,
       37169  +
                            expected.query_integer_list,
       37170  +
                            "Unexpected value for `query_integer_list`"
38053  37171   
                        );
38054         -
                response
38055         -
            }
38056         -
            Err(e) => {
38057         -
                ::tracing::error!(error = %e, "failed to serialize response");
38058         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38059         -
            }
38060         -
        }
38061         -
    }
38062         -
}
38063         -
38064         -
const CONTENT_TYPE_JSONENUMS: ::mime::Mime = ::mime::APPLICATION_JSON;
38065         -
::pin_project_lite::pin_project! {
38066         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38067         -
    /// [`JsonEnumsInput`](crate::input::JsonEnumsInput) using modelled bindings.
38068         -
    pub struct JsonEnumsInputFuture {
38069         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonEnumsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38070         -
    }
38071         -
}
38072         -
38073         -
impl std::future::Future for JsonEnumsInputFuture {
38074         -
    type Output = Result<
38075         -
        crate::input::JsonEnumsInput,
38076         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38077         -
    >;
38078         -
38079         -
    fn poll(
38080         -
        self: std::pin::Pin<&mut Self>,
38081         -
        cx: &mut std::task::Context<'_>,
38082         -
    ) -> std::task::Poll<Self::Output> {
38083         -
        let this = self.project();
38084         -
        this.inner.as_mut().poll(cx)
38085         -
    }
38086         -
}
38087         -
38088         -
impl<B>
38089         -
    ::aws_smithy_http_server::request::FromRequest<
38090         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38091         -
        B,
38092         -
    > for crate::input::JsonEnumsInput
38093         -
where
38094         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38095         -
    B: 'static,
38096         -
38097         -
    B::Data: Send,
38098         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38099         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38100         -
{
38101         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38102         -
    type Future = JsonEnumsInputFuture;
38103         -
38104         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38105         -
        let fut = async move {
38106         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38107         -
                request.headers(),
38108         -
                &CONTENT_TYPE_JSONENUMS,
38109         -
            ) {
38110         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       37172  +
                        ::pretty_assertions::assert_eq!(
       37173  +
                            input.query_integer_set,
       37174  +
                            expected.query_integer_set,
       37175  +
                            "Unexpected value for `query_integer_set`"
       37176  +
                        );
       37177  +
                        ::pretty_assertions::assert_eq!(
       37178  +
                            input.query_long,
       37179  +
                            expected.query_long,
       37180  +
                            "Unexpected value for `query_long`"
       37181  +
                        );
       37182  +
                        assert!(
       37183  +
                            input.query_float.float_equals(&expected.query_float),
       37184  +
                            "Unexpected value for `query_float` {:?} vs. {:?}",
       37185  +
                            expected.query_float,
       37186  +
                            input.query_float
       37187  +
                        );
       37188  +
                        assert!(
       37189  +
                            input.query_double.float_equals(&expected.query_double),
       37190  +
                            "Unexpected value for `query_double` {:?} vs. {:?}",
       37191  +
                            expected.query_double,
       37192  +
                            input.query_double
       37193  +
                        );
       37194  +
                        ::pretty_assertions::assert_eq!(
       37195  +
                            input.query_double_list,
       37196  +
                            expected.query_double_list,
       37197  +
                            "Unexpected value for `query_double_list`"
       37198  +
                        );
       37199  +
                        ::pretty_assertions::assert_eq!(
       37200  +
                            input.query_boolean,
       37201  +
                            expected.query_boolean,
       37202  +
                            "Unexpected value for `query_boolean`"
       37203  +
                        );
       37204  +
                        ::pretty_assertions::assert_eq!(
       37205  +
                            input.query_boolean_list,
       37206  +
                            expected.query_boolean_list,
       37207  +
                            "Unexpected value for `query_boolean_list`"
       37208  +
                        );
       37209  +
                        ::pretty_assertions::assert_eq!(
       37210  +
                            input.query_timestamp,
       37211  +
                            expected.query_timestamp,
       37212  +
                            "Unexpected value for `query_timestamp`"
       37213  +
                        );
       37214  +
                        ::pretty_assertions::assert_eq!(
       37215  +
                            input.query_timestamp_list,
       37216  +
                            expected.query_timestamp_list,
       37217  +
                            "Unexpected value for `query_timestamp_list`"
       37218  +
                        );
       37219  +
                        ::pretty_assertions::assert_eq!(
       37220  +
                            input.query_enum,
       37221  +
                            expected.query_enum,
       37222  +
                            "Unexpected value for `query_enum`"
       37223  +
                        );
       37224  +
                        ::pretty_assertions::assert_eq!(
       37225  +
                            input.query_enum_list,
       37226  +
                            expected.query_enum_list,
       37227  +
                            "Unexpected value for `query_enum_list`"
       37228  +
                        );
       37229  +
                        ::pretty_assertions::assert_eq!(
       37230  +
                            input.query_integer_enum,
       37231  +
                            expected.query_integer_enum,
       37232  +
                            "Unexpected value for `query_integer_enum`"
       37233  +
                        );
       37234  +
                        ::pretty_assertions::assert_eq!(
       37235  +
                            input.query_integer_enum_list,
       37236  +
                            expected.query_integer_enum_list,
       37237  +
                            "Unexpected value for `query_integer_enum_list`"
       37238  +
                        );
       37239  +
                        ::pretty_assertions::assert_eq!(
       37240  +
                            input.query_params_map_of_string_list,
       37241  +
                            expected.query_params_map_of_string_list,
       37242  +
                            "Unexpected value for `query_params_map_of_string_list`"
       37243  +
                        );
       37244  +
                        let response = crate::output::AllQueryStringTypesOutput {};
       37245  +
                        Ok(response)
       37246  +
                    };
       37247  +
                    sender.send(()).await.expect("receiver dropped early");
       37248  +
                    result
38111  37249   
                }
38112         -
            crate::protocol_serde::shape_json_enums::de_json_enums_http_request(request)
       37250  +
            })
       37251  +
            .build_unchecked();
       37252  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
38113  37253   
            .await
38114         -
                .map_err(Into::into)
38115         -
        };
38116         -
        use ::futures_util::future::TryFutureExt;
38117         -
        let fut = fut.map_err(
38118         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38119         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38120         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38121         -
                    e,
38122         -
                )
38123         -
            },
       37254  +
            .expect("unable to make an HTTP request");
       37255  +
        assert!(
       37256  +
            receiver.recv().await.is_some(),
       37257  +
            "we expected operation handler to be invoked but it was not entered"
38124  37258   
        );
38125         -
        JsonEnumsInputFuture {
38126         -
            inner: Box::pin(fut),
38127         -
        }
38128         -
    }
38129         -
}
38130         -
impl
38131         -
    ::aws_smithy_http_server::response::IntoResponse<
38132         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38133         -
    > for crate::output::JsonEnumsOutput
38134         -
{
38135         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38136         -
        match crate::protocol_serde::shape_json_enums::ser_json_enums_http_response(self) {
38137         -
            Ok(response) => response,
38138         -
            Err(e) => {
38139         -
                ::tracing::error!(error = %e, "failed to serialize response");
38140         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38141         -
            }
38142  37259   
    }
38143         -
    }
38144         -
}
38145         -
impl
38146         -
    ::aws_smithy_http_server::response::IntoResponse<
38147         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38148         -
    > for crate::error::JsonEnumsError
38149         -
{
38150         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38151         -
        match crate::protocol_serde::shape_json_enums::ser_json_enums_http_error(&self) {
38152         -
            Ok(mut response) => {
38153         -
                response.extensions_mut().insert(
38154         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       37260  +
    /// Handles escaping all required characters in the query string.
       37261  +
    /// Test ID: RestJsonQueryStringEscaping
       37262  +
    #[::tokio::test]
       37263  +
    #[::tracing_test::traced_test]
       37264  +
    async fn rest_json_query_string_escaping_request() {
       37265  +
        #[allow(unused_mut)]
       37266  +
        let mut http_request = http::Request::builder()
       37267  +
            .uri("/AllQueryStringTypesInput")
       37268  +
            .method("GET")
       37269  +
            .body(::aws_smithy_http_server::body::Body::from(
       37270  +
                ::bytes::Bytes::from_static("".as_bytes()),
       37271  +
            ))
       37272  +
            .unwrap();
       37273  +
        *http_request.uri_mut() = "/AllQueryStringTypesInput?String=%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9".parse().unwrap();
       37274  +
        #[allow(unused_mut)]
       37275  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       37276  +
        let config = crate::service::RestJsonConfig::builder().build();
       37277  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       37278  +
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
       37279  +
                let sender = sender.clone();
       37280  +
                async move {
       37281  +
                    let result = {
       37282  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       37283  +
                        let expected = crate::input::AllQueryStringTypesInput {
       37284  +
                            query_string: ::std::option::Option::Some(
       37285  +
                                " %:/?#[]@!$&'()*+,;=😹".to_owned(),
       37286  +
                            ),
       37287  +
                            query_params_map_of_string_list: ::std::option::Option::Some({
       37288  +
                                let mut ret = ::std::collections::HashMap::new();
       37289  +
                                ret.insert(
       37290  +
                                    "String".to_owned(),
       37291  +
                                    vec![" %:/?#[]@!$&'()*+,;=😹".to_owned()],
38155  37292   
                                );
38156         -
                response
38157         -
            }
38158         -
            Err(e) => {
38159         -
                ::tracing::error!(error = %e, "failed to serialize response");
38160         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38161         -
            }
38162         -
        }
38163         -
    }
38164         -
}
38165         -
38166         -
const CONTENT_TYPE_JSONTIMESTAMPS: ::mime::Mime = ::mime::APPLICATION_JSON;
38167         -
::pin_project_lite::pin_project! {
38168         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38169         -
    /// [`JsonTimestampsInput`](crate::input::JsonTimestampsInput) using modelled bindings.
38170         -
    pub struct JsonTimestampsInputFuture {
38171         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::JsonTimestampsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38172         -
    }
38173         -
}
38174         -
38175         -
impl std::future::Future for JsonTimestampsInputFuture {
38176         -
    type Output = Result<
38177         -
        crate::input::JsonTimestampsInput,
38178         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38179         -
    >;
38180         -
38181         -
    fn poll(
38182         -
        self: std::pin::Pin<&mut Self>,
38183         -
        cx: &mut std::task::Context<'_>,
38184         -
    ) -> std::task::Poll<Self::Output> {
38185         -
        let this = self.project();
38186         -
        this.inner.as_mut().poll(cx)
38187         -
    }
38188         -
}
38189         -
38190         -
impl<B>
38191         -
    ::aws_smithy_http_server::request::FromRequest<
38192         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38193         -
        B,
38194         -
    > for crate::input::JsonTimestampsInput
38195         -
where
38196         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38197         -
    B: 'static,
38198         -
38199         -
    B::Data: Send,
38200         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38201         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38202         -
{
38203         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38204         -
    type Future = JsonTimestampsInputFuture;
38205         -
38206         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38207         -
        let fut = async move {
38208         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38209         -
                request.headers(),
38210         -
                &CONTENT_TYPE_JSONTIMESTAMPS,
38211         -
            ) {
38212         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38213         -
            }
38214         -
            crate::protocol_serde::shape_json_timestamps::de_json_timestamps_http_request(request)
38215         -
                .await
38216         -
                .map_err(Into::into)
       37293  +
                                ret
       37294  +
                            }),
       37295  +
                            query_string_list: ::std::option::Option::None,
       37296  +
                            query_string_set: ::std::option::Option::None,
       37297  +
                            query_byte: ::std::option::Option::None,
       37298  +
                            query_short: ::std::option::Option::None,
       37299  +
                            query_integer: ::std::option::Option::None,
       37300  +
                            query_integer_list: ::std::option::Option::None,
       37301  +
                            query_integer_set: ::std::option::Option::None,
       37302  +
                            query_long: ::std::option::Option::None,
       37303  +
                            query_float: ::std::option::Option::None,
       37304  +
                            query_double: ::std::option::Option::None,
       37305  +
                            query_double_list: ::std::option::Option::None,
       37306  +
                            query_boolean: ::std::option::Option::None,
       37307  +
                            query_boolean_list: ::std::option::Option::None,
       37308  +
                            query_timestamp: ::std::option::Option::None,
       37309  +
                            query_timestamp_list: ::std::option::Option::None,
       37310  +
                            query_enum: ::std::option::Option::None,
       37311  +
                            query_enum_list: ::std::option::Option::None,
       37312  +
                            query_integer_enum: ::std::option::Option::None,
       37313  +
                            query_integer_enum_list: ::std::option::Option::None,
38217  37314   
                        };
38218         -
        use ::futures_util::future::TryFutureExt;
38219         -
        let fut = fut.map_err(
38220         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38221         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38222         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38223         -
                    e,
38224         -
                )
38225         -
            },
       37315  +
                        ::pretty_assertions::assert_eq!(
       37316  +
                            input.query_string,
       37317  +
                            expected.query_string,
       37318  +
                            "Unexpected value for `query_string`"
38226  37319   
                        );
38227         -
        JsonTimestampsInputFuture {
38228         -
            inner: Box::pin(fut),
38229         -
        }
38230         -
    }
38231         -
}
38232         -
impl
38233         -
    ::aws_smithy_http_server::response::IntoResponse<
38234         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38235         -
    > for crate::output::JsonTimestampsOutput
38236         -
{
38237         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38238         -
        match crate::protocol_serde::shape_json_timestamps::ser_json_timestamps_http_response(self)
38239         -
        {
38240         -
            Ok(response) => response,
38241         -
            Err(e) => {
38242         -
                ::tracing::error!(error = %e, "failed to serialize response");
38243         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38244         -
            }
38245         -
        }
38246         -
    }
38247         -
}
38248         -
38249         -
const CONTENT_TYPE_SIMPLESCALARPROPERTIES: ::mime::Mime = ::mime::APPLICATION_JSON;
38250         -
::pin_project_lite::pin_project! {
38251         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38252         -
    /// [`SimpleScalarPropertiesInput`](crate::input::SimpleScalarPropertiesInput) using modelled bindings.
38253         -
    pub struct SimpleScalarPropertiesInputFuture {
38254         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SimpleScalarPropertiesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38255         -
    }
38256         -
}
38257         -
38258         -
impl std::future::Future for SimpleScalarPropertiesInputFuture {
38259         -
    type Output = Result<
38260         -
        crate::input::SimpleScalarPropertiesInput,
38261         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38262         -
    >;
38263         -
38264         -
    fn poll(
38265         -
        self: std::pin::Pin<&mut Self>,
38266         -
        cx: &mut std::task::Context<'_>,
38267         -
    ) -> std::task::Poll<Self::Output> {
38268         -
        let this = self.project();
38269         -
        this.inner.as_mut().poll(cx)
38270         -
    }
38271         -
}
38272         -
38273         -
impl<B>
38274         -
    ::aws_smithy_http_server::request::FromRequest<
38275         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38276         -
        B,
38277         -
    > for crate::input::SimpleScalarPropertiesInput
38278         -
where
38279         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38280         -
    B: 'static,
38281         -
38282         -
    B::Data: Send,
38283         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38284         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38285         -
{
38286         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38287         -
    type Future = SimpleScalarPropertiesInputFuture;
38288         -
38289         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38290         -
        let fut = async move {
38291         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38292         -
                request.headers(),
38293         -
                &CONTENT_TYPE_SIMPLESCALARPROPERTIES,
38294         -
            ) {
38295         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       37320  +
                        ::pretty_assertions::assert_eq!(
       37321  +
                            input.query_string_list,
       37322  +
                            expected.query_string_list,
       37323  +
                            "Unexpected value for `query_string_list`"
       37324  +
                        );
       37325  +
                        ::pretty_assertions::assert_eq!(
       37326  +
                            input.query_string_set,
       37327  +
                            expected.query_string_set,
       37328  +
                            "Unexpected value for `query_string_set`"
       37329  +
                        );
       37330  +
                        ::pretty_assertions::assert_eq!(
       37331  +
                            input.query_byte,
       37332  +
                            expected.query_byte,
       37333  +
                            "Unexpected value for `query_byte`"
       37334  +
                        );
       37335  +
                        ::pretty_assertions::assert_eq!(
       37336  +
                            input.query_short,
       37337  +
                            expected.query_short,
       37338  +
                            "Unexpected value for `query_short`"
       37339  +
                        );
       37340  +
                        ::pretty_assertions::assert_eq!(
       37341  +
                            input.query_integer,
       37342  +
                            expected.query_integer,
       37343  +
                            "Unexpected value for `query_integer`"
       37344  +
                        );
       37345  +
                        ::pretty_assertions::assert_eq!(
       37346  +
                            input.query_integer_list,
       37347  +
                            expected.query_integer_list,
       37348  +
                            "Unexpected value for `query_integer_list`"
       37349  +
                        );
       37350  +
                        ::pretty_assertions::assert_eq!(
       37351  +
                            input.query_integer_set,
       37352  +
                            expected.query_integer_set,
       37353  +
                            "Unexpected value for `query_integer_set`"
       37354  +
                        );
       37355  +
                        ::pretty_assertions::assert_eq!(
       37356  +
                            input.query_long,
       37357  +
                            expected.query_long,
       37358  +
                            "Unexpected value for `query_long`"
       37359  +
                        );
       37360  +
                        assert!(
       37361  +
                            input.query_float.float_equals(&expected.query_float),
       37362  +
                            "Unexpected value for `query_float` {:?} vs. {:?}",
       37363  +
                            expected.query_float,
       37364  +
                            input.query_float
       37365  +
                        );
       37366  +
                        assert!(
       37367  +
                            input.query_double.float_equals(&expected.query_double),
       37368  +
                            "Unexpected value for `query_double` {:?} vs. {:?}",
       37369  +
                            expected.query_double,
       37370  +
                            input.query_double
       37371  +
                        );
       37372  +
                        ::pretty_assertions::assert_eq!(
       37373  +
                            input.query_double_list,
       37374  +
                            expected.query_double_list,
       37375  +
                            "Unexpected value for `query_double_list`"
       37376  +
                        );
       37377  +
                        ::pretty_assertions::assert_eq!(
       37378  +
                            input.query_boolean,
       37379  +
                            expected.query_boolean,
       37380  +
                            "Unexpected value for `query_boolean`"
       37381  +
                        );
       37382  +
                        ::pretty_assertions::assert_eq!(
       37383  +
                            input.query_boolean_list,
       37384  +
                            expected.query_boolean_list,
       37385  +
                            "Unexpected value for `query_boolean_list`"
       37386  +
                        );
       37387  +
                        ::pretty_assertions::assert_eq!(
       37388  +
                            input.query_timestamp,
       37389  +
                            expected.query_timestamp,
       37390  +
                            "Unexpected value for `query_timestamp`"
       37391  +
                        );
       37392  +
                        ::pretty_assertions::assert_eq!(
       37393  +
                            input.query_timestamp_list,
       37394  +
                            expected.query_timestamp_list,
       37395  +
                            "Unexpected value for `query_timestamp_list`"
       37396  +
                        );
       37397  +
                        ::pretty_assertions::assert_eq!(
       37398  +
                            input.query_enum,
       37399  +
                            expected.query_enum,
       37400  +
                            "Unexpected value for `query_enum`"
       37401  +
                        );
       37402  +
                        ::pretty_assertions::assert_eq!(
       37403  +
                            input.query_enum_list,
       37404  +
                            expected.query_enum_list,
       37405  +
                            "Unexpected value for `query_enum_list`"
       37406  +
                        );
       37407  +
                        ::pretty_assertions::assert_eq!(
       37408  +
                            input.query_integer_enum,
       37409  +
                            expected.query_integer_enum,
       37410  +
                            "Unexpected value for `query_integer_enum`"
       37411  +
                        );
       37412  +
                        ::pretty_assertions::assert_eq!(
       37413  +
                            input.query_integer_enum_list,
       37414  +
                            expected.query_integer_enum_list,
       37415  +
                            "Unexpected value for `query_integer_enum_list`"
       37416  +
                        );
       37417  +
                        ::pretty_assertions::assert_eq!(
       37418  +
                            input.query_params_map_of_string_list,
       37419  +
                            expected.query_params_map_of_string_list,
       37420  +
                            "Unexpected value for `query_params_map_of_string_list`"
       37421  +
                        );
       37422  +
                        let response = crate::output::AllQueryStringTypesOutput {};
       37423  +
                        Ok(response)
       37424  +
                    };
       37425  +
                    sender.send(()).await.expect("receiver dropped early");
       37426  +
                    result
38296  37427   
                }
38297         -
            crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties_http_request(request)
       37428  +
            })
       37429  +
            .build_unchecked();
       37430  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
38298  37431   
            .await
38299         -
                            .map_err(Into::into)
38300         -
        };
38301         -
        use ::futures_util::future::TryFutureExt;
38302         -
        let fut = fut.map_err(
38303         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38304         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38305         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38306         -
                    e,
38307         -
                )
38308         -
            },
       37432  +
            .expect("unable to make an HTTP request");
       37433  +
        assert!(
       37434  +
            receiver.recv().await.is_some(),
       37435  +
            "we expected operation handler to be invoked but it was not entered"
38309  37436   
        );
38310         -
        SimpleScalarPropertiesInputFuture {
38311         -
            inner: Box::pin(fut),
38312         -
        }
38313         -
    }
38314         -
}
38315         -
impl
38316         -
    ::aws_smithy_http_server::response::IntoResponse<
38317         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38318         -
    > for crate::output::SimpleScalarPropertiesOutput
38319         -
{
38320         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38321         -
        match crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_http_response(self) {
38322         -
                        Ok(response) => response,
38323         -
                        Err(e) => {
38324         -
                            ::tracing::error!(error = %e, "failed to serialize response");
38325         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38326         -
                        }
38327         -
                    }
38328         -
    }
38329         -
}
38330         -
38331         -
const CONTENT_TYPE_GREETINGWITHERRORS: ::mime::Mime = ::mime::APPLICATION_JSON;
38332         -
::pin_project_lite::pin_project! {
38333         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38334         -
    /// [`GreetingWithErrorsInput`](crate::input::GreetingWithErrorsInput) using modelled bindings.
38335         -
    pub struct GreetingWithErrorsInputFuture {
38336         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::GreetingWithErrorsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38337         -
    }
38338         -
}
38339         -
38340         -
impl std::future::Future for GreetingWithErrorsInputFuture {
38341         -
    type Output = Result<
38342         -
        crate::input::GreetingWithErrorsInput,
38343         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38344         -
    >;
38345         -
38346         -
    fn poll(
38347         -
        self: std::pin::Pin<&mut Self>,
38348         -
        cx: &mut std::task::Context<'_>,
38349         -
    ) -> std::task::Poll<Self::Output> {
38350         -
        let this = self.project();
38351         -
        this.inner.as_mut().poll(cx)
38352         -
    }
38353         -
}
38354         -
38355         -
impl<B>
38356         -
    ::aws_smithy_http_server::request::FromRequest<
38357         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38358         -
        B,
38359         -
    > for crate::input::GreetingWithErrorsInput
38360         -
where
38361         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38362         -
    B: 'static,
38363         -
38364         -
    B::Data: Send,
38365         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38366         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38367         -
{
38368         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38369         -
    type Future = GreetingWithErrorsInputFuture;
38370         -
38371         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38372         -
        let fut = async move {
38373         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38374         -
                request.headers(),
38375         -
                &CONTENT_TYPE_GREETINGWITHERRORS,
38376         -
            ) {
38377         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38378  37437   
    }
38379         -
            crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors_http_request(
38380         -
                request,
       37438  +
    /// Supports handling NaN float query values.
       37439  +
    /// Test ID: RestJsonSupportsNaNFloatQueryValues
       37440  +
    #[::tokio::test]
       37441  +
    #[::tracing_test::traced_test]
       37442  +
    async fn rest_json_supports_na_n_float_query_values_request() {
       37443  +
        #[allow(unused_mut)]
       37444  +
        let mut http_request = http::Request::builder()
       37445  +
            .uri("/AllQueryStringTypesInput")
       37446  +
            .method("GET")
       37447  +
            .body(::aws_smithy_http_server::body::Body::from(
       37448  +
                ::bytes::Bytes::from_static("".as_bytes()),
       37449  +
            ))
       37450  +
            .unwrap();
       37451  +
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=NaN&Double=NaN"
       37452  +
            .parse()
       37453  +
            .unwrap();
       37454  +
        #[allow(unused_mut)]
       37455  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       37456  +
        let config = crate::service::RestJsonConfig::builder().build();
       37457  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       37458  +
                        .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
       37459  +
                            let sender = sender.clone();
       37460  +
                            async move {
       37461  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       37462  +
        let expected =
       37463  +
            crate::input::AllQueryStringTypesInput {
       37464  +
                query_float:
       37465  +
                    ::std::option::Option::Some(
       37466  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
38381  37467   
                    )
38382         -
            .await
38383         -
            .map_err(Into::into)
38384         -
        };
38385         -
        use ::futures_util::future::TryFutureExt;
38386         -
        let fut = fut.map_err(
38387         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38388         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38389         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38390         -
                    e,
       37468  +
                ,
       37469  +
                query_double:
       37470  +
                    ::std::option::Option::Some(
       37471  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
38391  37472   
                    )
38392         -
            },
       37473  +
                ,
       37474  +
                query_params_map_of_string_list:
       37475  +
                    ::std::option::Option::Some(
       37476  +
                         {
       37477  +
                            let mut ret = ::std::collections::HashMap::new();
       37478  +
                            ret.insert(
       37479  +
                                "Float".to_owned()
       37480  +
                                ,
       37481  +
                                vec![
       37482  +
                                    "NaN".to_owned()
       37483  +
                                    ,
       37484  +
                                ]
38393  37485   
                            );
38394         -
        GreetingWithErrorsInputFuture {
38395         -
            inner: Box::pin(fut),
38396         -
        }
38397         -
    }
38398         -
}
38399         -
impl
38400         -
    ::aws_smithy_http_server::response::IntoResponse<
38401         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38402         -
    > for crate::output::GreetingWithErrorsOutput
38403         -
{
38404         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38405         -
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_response(self) {
38406         -
                        Ok(response) => response,
38407         -
                        Err(e) => {
38408         -
                            ::tracing::error!(error = %e, "failed to serialize response");
38409         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38410         -
                        }
38411         -
                    }
38412         -
    }
38413         -
}
38414         -
impl
38415         -
    ::aws_smithy_http_server::response::IntoResponse<
38416         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38417         -
    > for crate::error::GreetingWithErrorsError
38418         -
{
38419         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38420         -
        match crate::protocol_serde::shape_greeting_with_errors::ser_greeting_with_errors_http_error(
38421         -
            &self,
38422         -
        ) {
38423         -
            Ok(mut response) => {
38424         -
                response.extensions_mut().insert(
38425         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
       37486  +
                            ret.insert(
       37487  +
                                "Double".to_owned()
       37488  +
                                ,
       37489  +
                                vec![
       37490  +
                                    "NaN".to_owned()
       37491  +
                                    ,
       37492  +
                                ]
38426  37493   
                            );
38427         -
                response
38428         -
            }
38429         -
            Err(e) => {
38430         -
                ::tracing::error!(error = %e, "failed to serialize response");
38431         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38432         -
            }
38433         -
        }
       37494  +
                            ret
38434  37495   
                        }
38435         -
}
38436         -
38437         -
static CONTENT_TYPE_STREAMINGTRAITSWITHMEDIATYPE: ::once_cell::sync::Lazy<::mime::Mime> =
38438         -
    ::once_cell::sync::Lazy::new(|| {
38439         -
        "text/plain"
38440         -
            .parse::<::mime::Mime>()
38441         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
38442         -
    });
38443         -
::pin_project_lite::pin_project! {
38444         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38445         -
    /// [`StreamingTraitsWithMediaTypeInput`](crate::input::StreamingTraitsWithMediaTypeInput) using modelled bindings.
38446         -
    pub struct StreamingTraitsWithMediaTypeInputFuture {
38447         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamingTraitsWithMediaTypeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       37496  +
                    )
       37497  +
                ,
       37498  +
                query_string:
       37499  +
                    ::std::option::Option::None
       37500  +
                ,
       37501  +
                query_string_list:
       37502  +
                    ::std::option::Option::None
       37503  +
                ,
       37504  +
                query_string_set:
       37505  +
                    ::std::option::Option::None
       37506  +
                ,
       37507  +
                query_byte:
       37508  +
                    ::std::option::Option::None
       37509  +
                ,
       37510  +
                query_short:
       37511  +
                    ::std::option::Option::None
       37512  +
                ,
       37513  +
                query_integer:
       37514  +
                    ::std::option::Option::None
       37515  +
                ,
       37516  +
                query_integer_list:
       37517  +
                    ::std::option::Option::None
       37518  +
                ,
       37519  +
                query_integer_set:
       37520  +
                    ::std::option::Option::None
       37521  +
                ,
       37522  +
                query_long:
       37523  +
                    ::std::option::Option::None
       37524  +
                ,
       37525  +
                query_double_list:
       37526  +
                    ::std::option::Option::None
       37527  +
                ,
       37528  +
                query_boolean:
       37529  +
                    ::std::option::Option::None
       37530  +
                ,
       37531  +
                query_boolean_list:
       37532  +
                    ::std::option::Option::None
       37533  +
                ,
       37534  +
                query_timestamp:
       37535  +
                    ::std::option::Option::None
       37536  +
                ,
       37537  +
                query_timestamp_list:
       37538  +
                    ::std::option::Option::None
       37539  +
                ,
       37540  +
                query_enum:
       37541  +
                    ::std::option::Option::None
       37542  +
                ,
       37543  +
                query_enum_list:
       37544  +
                    ::std::option::Option::None
       37545  +
                ,
       37546  +
                query_integer_enum:
       37547  +
                    ::std::option::Option::None
       37548  +
                ,
       37549  +
                query_integer_enum_list:
       37550  +
                    ::std::option::Option::None
       37551  +
                ,
38448  37552   
            }
38449         -
}
38450         -
38451         -
impl std::future::Future for StreamingTraitsWithMediaTypeInputFuture {
38452         -
    type Output = Result<
38453         -
        crate::input::StreamingTraitsWithMediaTypeInput,
38454         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38455         -
    >;
38456         -
38457         -
    fn poll(
38458         -
        self: std::pin::Pin<&mut Self>,
38459         -
        cx: &mut std::task::Context<'_>,
38460         -
    ) -> std::task::Poll<Self::Output> {
38461         -
        let this = self.project();
38462         -
        this.inner.as_mut().poll(cx)
       37553  +
        ;
       37554  +
        ::pretty_assertions::assert_eq!(input.query_string, expected.query_string, "Unexpected value for `query_string`");
       37555  +
        ::pretty_assertions::assert_eq!(input.query_string_list, expected.query_string_list, "Unexpected value for `query_string_list`");
       37556  +
        ::pretty_assertions::assert_eq!(input.query_string_set, expected.query_string_set, "Unexpected value for `query_string_set`");
       37557  +
        ::pretty_assertions::assert_eq!(input.query_byte, expected.query_byte, "Unexpected value for `query_byte`");
       37558  +
        ::pretty_assertions::assert_eq!(input.query_short, expected.query_short, "Unexpected value for `query_short`");
       37559  +
        ::pretty_assertions::assert_eq!(input.query_integer, expected.query_integer, "Unexpected value for `query_integer`");
       37560  +
        ::pretty_assertions::assert_eq!(input.query_integer_list, expected.query_integer_list, "Unexpected value for `query_integer_list`");
       37561  +
        ::pretty_assertions::assert_eq!(input.query_integer_set, expected.query_integer_set, "Unexpected value for `query_integer_set`");
       37562  +
        ::pretty_assertions::assert_eq!(input.query_long, expected.query_long, "Unexpected value for `query_long`");
       37563  +
        assert!(input.query_float.float_equals(&expected.query_float),
       37564  +
                                            "Unexpected value for `query_float` {:?} vs. {:?}", expected.query_float, input.query_float);
       37565  +
        assert!(input.query_double.float_equals(&expected.query_double),
       37566  +
                                            "Unexpected value for `query_double` {:?} vs. {:?}", expected.query_double, input.query_double);
       37567  +
        ::pretty_assertions::assert_eq!(input.query_double_list, expected.query_double_list, "Unexpected value for `query_double_list`");
       37568  +
        ::pretty_assertions::assert_eq!(input.query_boolean, expected.query_boolean, "Unexpected value for `query_boolean`");
       37569  +
        ::pretty_assertions::assert_eq!(input.query_boolean_list, expected.query_boolean_list, "Unexpected value for `query_boolean_list`");
       37570  +
        ::pretty_assertions::assert_eq!(input.query_timestamp, expected.query_timestamp, "Unexpected value for `query_timestamp`");
       37571  +
        ::pretty_assertions::assert_eq!(input.query_timestamp_list, expected.query_timestamp_list, "Unexpected value for `query_timestamp_list`");
       37572  +
        ::pretty_assertions::assert_eq!(input.query_enum, expected.query_enum, "Unexpected value for `query_enum`");
       37573  +
        ::pretty_assertions::assert_eq!(input.query_enum_list, expected.query_enum_list, "Unexpected value for `query_enum_list`");
       37574  +
        ::pretty_assertions::assert_eq!(input.query_integer_enum, expected.query_integer_enum, "Unexpected value for `query_integer_enum`");
       37575  +
        ::pretty_assertions::assert_eq!(input.query_integer_enum_list, expected.query_integer_enum_list, "Unexpected value for `query_integer_enum_list`");
       37576  +
        ::pretty_assertions::assert_eq!(input.query_params_map_of_string_list, expected.query_params_map_of_string_list, "Unexpected value for `query_params_map_of_string_list`");
       37577  +
        let response =
       37578  +
            crate::output::AllQueryStringTypesOutput {
38463  37579   
            }
38464         -
}
38465         -
38466         -
impl<B>
38467         -
    ::aws_smithy_http_server::request::FromRequest<
38468         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38469         -
        B,
38470         -
    > for crate::input::StreamingTraitsWithMediaTypeInput
38471         -
where
38472         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38473         -
    B: 'static,
38474         -
38475         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
38476         -
    B::Data: Send,
38477         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38478         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38479         -
{
38480         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38481         -
    type Future = StreamingTraitsWithMediaTypeInputFuture;
38482         -
38483         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38484         -
        let fut = async move {
38485         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38486         -
                request.headers(),
38487         -
                &CONTENT_TYPE_STREAMINGTRAITSWITHMEDIATYPE,
38488         -
            ) {
38489         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       37580  +
        ;
       37581  +
        Ok(response) };
       37582  +
                                sender.send(()).await.expect("receiver dropped early");
       37583  +
                                result
38490  37584   
                            }
38491         -
            crate::protocol_serde::shape_streaming_traits_with_media_type::de_streaming_traits_with_media_type_http_request(request)
       37585  +
                        })
       37586  +
                        .build_unchecked();
       37587  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
38492  37588   
            .await
38493         -
                            .map_err(Into::into)
38494         -
        };
38495         -
        use ::futures_util::future::TryFutureExt;
38496         -
        let fut = fut.map_err(
38497         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38498         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38499         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38500         -
                    e,
38501         -
                )
38502         -
            },
       37589  +
            .expect("unable to make an HTTP request");
       37590  +
        assert!(
       37591  +
            receiver.recv().await.is_some(),
       37592  +
            "we expected operation handler to be invoked but it was not entered"
38503  37593   
        );
38504         -
        StreamingTraitsWithMediaTypeInputFuture {
38505         -
            inner: Box::pin(fut),
38506         -
        }
38507         -
    }
38508         -
}
38509         -
impl
38510         -
    ::aws_smithy_http_server::response::IntoResponse<
38511         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38512         -
    > for crate::output::StreamingTraitsWithMediaTypeOutput
38513         -
{
38514         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38515         -
        match crate::protocol_serde::shape_streaming_traits_with_media_type::ser_streaming_traits_with_media_type_http_response(self) {
38516         -
                        Ok(response) => response,
38517         -
                        Err(e) => {
38518         -
                            ::tracing::error!(error = %e, "failed to serialize response");
38519         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38520         -
                        }
38521  37594   
    }
       37595  +
    /// Supports handling Infinity float query values.
       37596  +
    /// Test ID: RestJsonSupportsInfinityFloatQueryValues
       37597  +
    #[::tokio::test]
       37598  +
    #[::tracing_test::traced_test]
       37599  +
    async fn rest_json_supports_infinity_float_query_values_request() {
       37600  +
        #[allow(unused_mut)]
       37601  +
        let mut http_request = http::Request::builder()
       37602  +
            .uri("/AllQueryStringTypesInput")
       37603  +
            .method("GET")
       37604  +
            .body(::aws_smithy_http_server::body::Body::from(
       37605  +
                ::bytes::Bytes::from_static("".as_bytes()),
       37606  +
            ))
       37607  +
            .unwrap();
       37608  +
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=Infinity&Double=Infinity"
       37609  +
            .parse()
       37610  +
            .unwrap();
       37611  +
        #[allow(unused_mut)]
       37612  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       37613  +
        let config = crate::service::RestJsonConfig::builder().build();
       37614  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       37615  +
                        .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
       37616  +
                            let sender = sender.clone();
       37617  +
                            async move {
       37618  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       37619  +
        let expected =
       37620  +
            crate::input::AllQueryStringTypesInput {
       37621  +
                query_float:
       37622  +
                    ::std::option::Option::Some(
       37623  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       37624  +
                    )
       37625  +
                ,
       37626  +
                query_double:
       37627  +
                    ::std::option::Option::Some(
       37628  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       37629  +
                    )
       37630  +
                ,
       37631  +
                query_params_map_of_string_list:
       37632  +
                    ::std::option::Option::Some(
       37633  +
                         {
       37634  +
                            let mut ret = ::std::collections::HashMap::new();
       37635  +
                            ret.insert(
       37636  +
                                "Float".to_owned()
       37637  +
                                ,
       37638  +
                                vec![
       37639  +
                                    "Infinity".to_owned()
       37640  +
                                    ,
       37641  +
                                ]
       37642  +
                            );
       37643  +
                            ret.insert(
       37644  +
                                "Double".to_owned()
       37645  +
                                ,
       37646  +
                                vec![
       37647  +
                                    "Infinity".to_owned()
       37648  +
                                    ,
       37649  +
                                ]
       37650  +
                            );
       37651  +
                            ret
38522  37652   
                        }
38523         -
}
38524         -
38525         -
const CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH: ::mime::Mime = ::mime::APPLICATION_JSON;
38526         -
::pin_project_lite::pin_project! {
38527         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38528         -
    /// [`StreamingTraitsRequireLengthInput`](crate::input::StreamingTraitsRequireLengthInput) using modelled bindings.
38529         -
    pub struct StreamingTraitsRequireLengthInputFuture {
38530         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamingTraitsRequireLengthInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       37653  +
                    )
       37654  +
                ,
       37655  +
                query_string:
       37656  +
                    ::std::option::Option::None
       37657  +
                ,
       37658  +
                query_string_list:
       37659  +
                    ::std::option::Option::None
       37660  +
                ,
       37661  +
                query_string_set:
       37662  +
                    ::std::option::Option::None
       37663  +
                ,
       37664  +
                query_byte:
       37665  +
                    ::std::option::Option::None
       37666  +
                ,
       37667  +
                query_short:
       37668  +
                    ::std::option::Option::None
       37669  +
                ,
       37670  +
                query_integer:
       37671  +
                    ::std::option::Option::None
       37672  +
                ,
       37673  +
                query_integer_list:
       37674  +
                    ::std::option::Option::None
       37675  +
                ,
       37676  +
                query_integer_set:
       37677  +
                    ::std::option::Option::None
       37678  +
                ,
       37679  +
                query_long:
       37680  +
                    ::std::option::Option::None
       37681  +
                ,
       37682  +
                query_double_list:
       37683  +
                    ::std::option::Option::None
       37684  +
                ,
       37685  +
                query_boolean:
       37686  +
                    ::std::option::Option::None
       37687  +
                ,
       37688  +
                query_boolean_list:
       37689  +
                    ::std::option::Option::None
       37690  +
                ,
       37691  +
                query_timestamp:
       37692  +
                    ::std::option::Option::None
       37693  +
                ,
       37694  +
                query_timestamp_list:
       37695  +
                    ::std::option::Option::None
       37696  +
                ,
       37697  +
                query_enum:
       37698  +
                    ::std::option::Option::None
       37699  +
                ,
       37700  +
                query_enum_list:
       37701  +
                    ::std::option::Option::None
       37702  +
                ,
       37703  +
                query_integer_enum:
       37704  +
                    ::std::option::Option::None
       37705  +
                ,
       37706  +
                query_integer_enum_list:
       37707  +
                    ::std::option::Option::None
       37708  +
                ,
38531  37709   
            }
38532         -
}
38533         -
38534         -
impl std::future::Future for StreamingTraitsRequireLengthInputFuture {
38535         -
    type Output = Result<
38536         -
        crate::input::StreamingTraitsRequireLengthInput,
38537         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38538         -
    >;
38539         -
38540         -
    fn poll(
38541         -
        self: std::pin::Pin<&mut Self>,
38542         -
        cx: &mut std::task::Context<'_>,
38543         -
    ) -> std::task::Poll<Self::Output> {
38544         -
        let this = self.project();
38545         -
        this.inner.as_mut().poll(cx)
       37710  +
        ;
       37711  +
        ::pretty_assertions::assert_eq!(input.query_string, expected.query_string, "Unexpected value for `query_string`");
       37712  +
        ::pretty_assertions::assert_eq!(input.query_string_list, expected.query_string_list, "Unexpected value for `query_string_list`");
       37713  +
        ::pretty_assertions::assert_eq!(input.query_string_set, expected.query_string_set, "Unexpected value for `query_string_set`");
       37714  +
        ::pretty_assertions::assert_eq!(input.query_byte, expected.query_byte, "Unexpected value for `query_byte`");
       37715  +
        ::pretty_assertions::assert_eq!(input.query_short, expected.query_short, "Unexpected value for `query_short`");
       37716  +
        ::pretty_assertions::assert_eq!(input.query_integer, expected.query_integer, "Unexpected value for `query_integer`");
       37717  +
        ::pretty_assertions::assert_eq!(input.query_integer_list, expected.query_integer_list, "Unexpected value for `query_integer_list`");
       37718  +
        ::pretty_assertions::assert_eq!(input.query_integer_set, expected.query_integer_set, "Unexpected value for `query_integer_set`");
       37719  +
        ::pretty_assertions::assert_eq!(input.query_long, expected.query_long, "Unexpected value for `query_long`");
       37720  +
        assert!(input.query_float.float_equals(&expected.query_float),
       37721  +
                                            "Unexpected value for `query_float` {:?} vs. {:?}", expected.query_float, input.query_float);
       37722  +
        assert!(input.query_double.float_equals(&expected.query_double),
       37723  +
                                            "Unexpected value for `query_double` {:?} vs. {:?}", expected.query_double, input.query_double);
       37724  +
        ::pretty_assertions::assert_eq!(input.query_double_list, expected.query_double_list, "Unexpected value for `query_double_list`");
       37725  +
        ::pretty_assertions::assert_eq!(input.query_boolean, expected.query_boolean, "Unexpected value for `query_boolean`");
       37726  +
        ::pretty_assertions::assert_eq!(input.query_boolean_list, expected.query_boolean_list, "Unexpected value for `query_boolean_list`");
       37727  +
        ::pretty_assertions::assert_eq!(input.query_timestamp, expected.query_timestamp, "Unexpected value for `query_timestamp`");
       37728  +
        ::pretty_assertions::assert_eq!(input.query_timestamp_list, expected.query_timestamp_list, "Unexpected value for `query_timestamp_list`");
       37729  +
        ::pretty_assertions::assert_eq!(input.query_enum, expected.query_enum, "Unexpected value for `query_enum`");
       37730  +
        ::pretty_assertions::assert_eq!(input.query_enum_list, expected.query_enum_list, "Unexpected value for `query_enum_list`");
       37731  +
        ::pretty_assertions::assert_eq!(input.query_integer_enum, expected.query_integer_enum, "Unexpected value for `query_integer_enum`");
       37732  +
        ::pretty_assertions::assert_eq!(input.query_integer_enum_list, expected.query_integer_enum_list, "Unexpected value for `query_integer_enum_list`");
       37733  +
        ::pretty_assertions::assert_eq!(input.query_params_map_of_string_list, expected.query_params_map_of_string_list, "Unexpected value for `query_params_map_of_string_list`");
       37734  +
        let response =
       37735  +
            crate::output::AllQueryStringTypesOutput {
38546  37736   
            }
38547         -
}
38548         -
38549         -
impl<B>
38550         -
    ::aws_smithy_http_server::request::FromRequest<
38551         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38552         -
        B,
38553         -
    > for crate::input::StreamingTraitsRequireLengthInput
38554         -
where
38555         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38556         -
    B: 'static,
38557         -
38558         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
38559         -
    B::Data: Send,
38560         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38561         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38562         -
{
38563         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38564         -
    type Future = StreamingTraitsRequireLengthInputFuture;
38565         -
38566         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38567         -
        let fut = async move {
38568         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38569         -
                request.headers(),
38570         -
                &CONTENT_TYPE_STREAMINGTRAITSREQUIRELENGTH,
38571         -
            ) {
38572         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       37737  +
        ;
       37738  +
        Ok(response) };
       37739  +
                                sender.send(()).await.expect("receiver dropped early");
       37740  +
                                result
38573  37741   
                            }
38574         -
            crate::protocol_serde::shape_streaming_traits_require_length::de_streaming_traits_require_length_http_request(request)
       37742  +
                        })
       37743  +
                        .build_unchecked();
       37744  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
38575  37745   
            .await
38576         -
                            .map_err(Into::into)
38577         -
        };
38578         -
        use ::futures_util::future::TryFutureExt;
38579         -
        let fut = fut.map_err(
38580         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38581         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38582         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38583         -
                    e,
38584         -
                )
38585         -
            },
       37746  +
            .expect("unable to make an HTTP request");
       37747  +
        assert!(
       37748  +
            receiver.recv().await.is_some(),
       37749  +
            "we expected operation handler to be invoked but it was not entered"
38586  37750   
        );
38587         -
        StreamingTraitsRequireLengthInputFuture {
38588         -
            inner: Box::pin(fut),
38589         -
        }
38590         -
    }
38591         -
}
38592         -
impl
38593         -
    ::aws_smithy_http_server::response::IntoResponse<
38594         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38595         -
    > for crate::output::StreamingTraitsRequireLengthOutput
38596         -
{
38597         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38598         -
        match crate::protocol_serde::shape_streaming_traits_require_length::ser_streaming_traits_require_length_http_response(self) {
38599         -
                        Ok(response) => response,
38600         -
                        Err(e) => {
38601         -
                            ::tracing::error!(error = %e, "failed to serialize response");
38602         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38603         -
                        }
38604         -
                    }
38605         -
    }
38606         -
}
38607         -
38608         -
const CONTENT_TYPE_STREAMINGTRAITS: ::mime::Mime = ::mime::APPLICATION_OCTET_STREAM;
38609         -
::pin_project_lite::pin_project! {
38610         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38611         -
    /// [`StreamingTraitsInput`](crate::input::StreamingTraitsInput) using modelled bindings.
38612         -
    pub struct StreamingTraitsInputFuture {
38613         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::StreamingTraitsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38614         -
    }
38615         -
}
38616         -
38617         -
impl std::future::Future for StreamingTraitsInputFuture {
38618         -
    type Output = Result<
38619         -
        crate::input::StreamingTraitsInput,
38620         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38621         -
    >;
38622         -
38623         -
    fn poll(
38624         -
        self: std::pin::Pin<&mut Self>,
38625         -
        cx: &mut std::task::Context<'_>,
38626         -
    ) -> std::task::Poll<Self::Output> {
38627         -
        let this = self.project();
38628         -
        this.inner.as_mut().poll(cx)
38629         -
    }
38630         -
}
38631         -
38632         -
impl<B>
38633         -
    ::aws_smithy_http_server::request::FromRequest<
38634         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38635         -
        B,
38636         -
    > for crate::input::StreamingTraitsInput
38637         -
where
38638         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38639         -
    B: 'static,
38640         -
38641         -
    B: Into<::aws_smithy_types::byte_stream::ByteStream>,
38642         -
    B::Data: Send,
38643         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38644         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38645         -
{
38646         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38647         -
    type Future = StreamingTraitsInputFuture;
38648         -
38649         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38650         -
        let fut = async move {
38651         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38652         -
                request.headers(),
38653         -
                &CONTENT_TYPE_STREAMINGTRAITS,
38654         -
            ) {
38655         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38656  37751   
    }
38657         -
            crate::protocol_serde::shape_streaming_traits::de_streaming_traits_http_request(request)
38658         -
                .await
38659         -
                .map_err(Into::into)
38660         -
        };
38661         -
        use ::futures_util::future::TryFutureExt;
38662         -
        let fut = fut.map_err(
38663         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38664         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38665         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38666         -
                    e,
       37752  +
    /// Supports handling -Infinity float query values.
       37753  +
    /// Test ID: RestJsonSupportsNegativeInfinityFloatQueryValues
       37754  +
    #[::tokio::test]
       37755  +
    #[::tracing_test::traced_test]
       37756  +
    async fn rest_json_supports_negative_infinity_float_query_values_request() {
       37757  +
        #[allow(unused_mut)]
       37758  +
        let mut http_request = http::Request::builder()
       37759  +
            .uri("/AllQueryStringTypesInput")
       37760  +
            .method("GET")
       37761  +
            .body(::aws_smithy_http_server::body::Body::from(
       37762  +
                ::bytes::Bytes::from_static("".as_bytes()),
       37763  +
            ))
       37764  +
            .unwrap();
       37765  +
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Float=-Infinity&Double=-Infinity"
       37766  +
            .parse()
       37767  +
            .unwrap();
       37768  +
        #[allow(unused_mut)]
       37769  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       37770  +
        let config = crate::service::RestJsonConfig::builder().build();
       37771  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       37772  +
                        .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
       37773  +
                            let sender = sender.clone();
       37774  +
                            async move {
       37775  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       37776  +
        let expected =
       37777  +
            crate::input::AllQueryStringTypesInput {
       37778  +
                query_float:
       37779  +
                    ::std::option::Option::Some(
       37780  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
38667  37781   
                    )
38668         -
            },
       37782  +
                ,
       37783  +
                query_double:
       37784  +
                    ::std::option::Option::Some(
       37785  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
       37786  +
                    )
       37787  +
                ,
       37788  +
                query_params_map_of_string_list:
       37789  +
                    ::std::option::Option::Some(
       37790  +
                         {
       37791  +
                            let mut ret = ::std::collections::HashMap::new();
       37792  +
                            ret.insert(
       37793  +
                                "Float".to_owned()
       37794  +
                                ,
       37795  +
                                vec![
       37796  +
                                    "-Infinity".to_owned()
       37797  +
                                    ,
       37798  +
                                ]
38669  37799   
                            );
38670         -
        StreamingTraitsInputFuture {
38671         -
            inner: Box::pin(fut),
38672         -
        }
38673         -
    }
38674         -
}
38675         -
impl
38676         -
    ::aws_smithy_http_server::response::IntoResponse<
38677         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38678         -
    > for crate::output::StreamingTraitsOutput
38679         -
{
38680         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38681         -
        match crate::protocol_serde::shape_streaming_traits::ser_streaming_traits_http_response(
38682         -
            self,
38683         -
        ) {
38684         -
            Ok(response) => response,
38685         -
            Err(e) => {
38686         -
                ::tracing::error!(error = %e, "failed to serialize response");
38687         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       37800  +
                            ret.insert(
       37801  +
                                "Double".to_owned()
       37802  +
                                ,
       37803  +
                                vec![
       37804  +
                                    "-Infinity".to_owned()
       37805  +
                                    ,
       37806  +
                                ]
       37807  +
                            );
       37808  +
                            ret
38688  37809   
                        }
       37810  +
                    )
       37811  +
                ,
       37812  +
                query_string:
       37813  +
                    ::std::option::Option::None
       37814  +
                ,
       37815  +
                query_string_list:
       37816  +
                    ::std::option::Option::None
       37817  +
                ,
       37818  +
                query_string_set:
       37819  +
                    ::std::option::Option::None
       37820  +
                ,
       37821  +
                query_byte:
       37822  +
                    ::std::option::Option::None
       37823  +
                ,
       37824  +
                query_short:
       37825  +
                    ::std::option::Option::None
       37826  +
                ,
       37827  +
                query_integer:
       37828  +
                    ::std::option::Option::None
       37829  +
                ,
       37830  +
                query_integer_list:
       37831  +
                    ::std::option::Option::None
       37832  +
                ,
       37833  +
                query_integer_set:
       37834  +
                    ::std::option::Option::None
       37835  +
                ,
       37836  +
                query_long:
       37837  +
                    ::std::option::Option::None
       37838  +
                ,
       37839  +
                query_double_list:
       37840  +
                    ::std::option::Option::None
       37841  +
                ,
       37842  +
                query_boolean:
       37843  +
                    ::std::option::Option::None
       37844  +
                ,
       37845  +
                query_boolean_list:
       37846  +
                    ::std::option::Option::None
       37847  +
                ,
       37848  +
                query_timestamp:
       37849  +
                    ::std::option::Option::None
       37850  +
                ,
       37851  +
                query_timestamp_list:
       37852  +
                    ::std::option::Option::None
       37853  +
                ,
       37854  +
                query_enum:
       37855  +
                    ::std::option::Option::None
       37856  +
                ,
       37857  +
                query_enum_list:
       37858  +
                    ::std::option::Option::None
       37859  +
                ,
       37860  +
                query_integer_enum:
       37861  +
                    ::std::option::Option::None
       37862  +
                ,
       37863  +
                query_integer_enum_list:
       37864  +
                    ::std::option::Option::None
       37865  +
                ,
38689  37866   
            }
       37867  +
        ;
       37868  +
        ::pretty_assertions::assert_eq!(input.query_string, expected.query_string, "Unexpected value for `query_string`");
       37869  +
        ::pretty_assertions::assert_eq!(input.query_string_list, expected.query_string_list, "Unexpected value for `query_string_list`");
       37870  +
        ::pretty_assertions::assert_eq!(input.query_string_set, expected.query_string_set, "Unexpected value for `query_string_set`");
       37871  +
        ::pretty_assertions::assert_eq!(input.query_byte, expected.query_byte, "Unexpected value for `query_byte`");
       37872  +
        ::pretty_assertions::assert_eq!(input.query_short, expected.query_short, "Unexpected value for `query_short`");
       37873  +
        ::pretty_assertions::assert_eq!(input.query_integer, expected.query_integer, "Unexpected value for `query_integer`");
       37874  +
        ::pretty_assertions::assert_eq!(input.query_integer_list, expected.query_integer_list, "Unexpected value for `query_integer_list`");
       37875  +
        ::pretty_assertions::assert_eq!(input.query_integer_set, expected.query_integer_set, "Unexpected value for `query_integer_set`");
       37876  +
        ::pretty_assertions::assert_eq!(input.query_long, expected.query_long, "Unexpected value for `query_long`");
       37877  +
        assert!(input.query_float.float_equals(&expected.query_float),
       37878  +
                                            "Unexpected value for `query_float` {:?} vs. {:?}", expected.query_float, input.query_float);
       37879  +
        assert!(input.query_double.float_equals(&expected.query_double),
       37880  +
                                            "Unexpected value for `query_double` {:?} vs. {:?}", expected.query_double, input.query_double);
       37881  +
        ::pretty_assertions::assert_eq!(input.query_double_list, expected.query_double_list, "Unexpected value for `query_double_list`");
       37882  +
        ::pretty_assertions::assert_eq!(input.query_boolean, expected.query_boolean, "Unexpected value for `query_boolean`");
       37883  +
        ::pretty_assertions::assert_eq!(input.query_boolean_list, expected.query_boolean_list, "Unexpected value for `query_boolean_list`");
       37884  +
        ::pretty_assertions::assert_eq!(input.query_timestamp, expected.query_timestamp, "Unexpected value for `query_timestamp`");
       37885  +
        ::pretty_assertions::assert_eq!(input.query_timestamp_list, expected.query_timestamp_list, "Unexpected value for `query_timestamp_list`");
       37886  +
        ::pretty_assertions::assert_eq!(input.query_enum, expected.query_enum, "Unexpected value for `query_enum`");
       37887  +
        ::pretty_assertions::assert_eq!(input.query_enum_list, expected.query_enum_list, "Unexpected value for `query_enum_list`");
       37888  +
        ::pretty_assertions::assert_eq!(input.query_integer_enum, expected.query_integer_enum, "Unexpected value for `query_integer_enum`");
       37889  +
        ::pretty_assertions::assert_eq!(input.query_integer_enum_list, expected.query_integer_enum_list, "Unexpected value for `query_integer_enum_list`");
       37890  +
        ::pretty_assertions::assert_eq!(input.query_params_map_of_string_list, expected.query_params_map_of_string_list, "Unexpected value for `query_params_map_of_string_list`");
       37891  +
        let response =
       37892  +
            crate::output::AllQueryStringTypesOutput {
38690  37893   
            }
38691         -
}
38692         -
38693         -
const CONTENT_TYPE_HTTPRESPONSECODE: ::mime::Mime = ::mime::APPLICATION_JSON;
38694         -
::pin_project_lite::pin_project! {
38695         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38696         -
    /// [`HttpResponseCodeInput`](crate::input::HttpResponseCodeInput) using modelled bindings.
38697         -
    pub struct HttpResponseCodeInputFuture {
38698         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpResponseCodeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       37894  +
        ;
       37895  +
        Ok(response) };
       37896  +
                                sender.send(()).await.expect("receiver dropped early");
       37897  +
                                result
38699  37898   
                            }
38700         -
}
38701         -
38702         -
impl std::future::Future for HttpResponseCodeInputFuture {
38703         -
    type Output = Result<
38704         -
        crate::input::HttpResponseCodeInput,
38705         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38706         -
    >;
38707         -
38708         -
    fn poll(
38709         -
        self: std::pin::Pin<&mut Self>,
38710         -
        cx: &mut std::task::Context<'_>,
38711         -
    ) -> std::task::Poll<Self::Output> {
38712         -
        let this = self.project();
38713         -
        this.inner.as_mut().poll(cx)
       37899  +
                        })
       37900  +
                        .build_unchecked();
       37901  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       37902  +
            .await
       37903  +
            .expect("unable to make an HTTP request");
       37904  +
        assert!(
       37905  +
            receiver.recv().await.is_some(),
       37906  +
            "we expected operation handler to be invoked but it was not entered"
       37907  +
        );
38714  37908   
    }
38715         -
}
38716         -
38717         -
impl<B>
38718         -
    ::aws_smithy_http_server::request::FromRequest<
38719         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38720         -
        B,
38721         -
    > for crate::input::HttpResponseCodeInput
38722         -
where
38723         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38724         -
    B: 'static,
38725         -
38726         -
    B::Data: Send,
38727         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38728         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38729         -
{
38730         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38731         -
    type Future = HttpResponseCodeInputFuture;
38732         -
38733         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38734         -
        let fut = async move {
38735         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38736         -
                request.headers(),
38737         -
                &CONTENT_TYPE_HTTPRESPONSECODE,
38738         -
            ) {
38739         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       37909  +
    /// Query values of 0 and false are serialized
       37910  +
    /// Test ID: RestJsonZeroAndFalseQueryValues
       37911  +
    #[::tokio::test]
       37912  +
    #[::tracing_test::traced_test]
       37913  +
    async fn rest_json_zero_and_false_query_values_request() {
       37914  +
        #[allow(unused_mut)]
       37915  +
        let mut http_request = http::Request::builder()
       37916  +
            .uri("/AllQueryStringTypesInput")
       37917  +
            .method("GET")
       37918  +
            .body(::aws_smithy_http_server::body::Body::from(
       37919  +
                ::bytes::Bytes::from_static("".as_bytes()),
       37920  +
            ))
       37921  +
            .unwrap();
       37922  +
        *http_request.uri_mut() = "/AllQueryStringTypesInput?Integer=0&Boolean=false"
       37923  +
            .parse()
       37924  +
            .unwrap();
       37925  +
        #[allow(unused_mut)]
       37926  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       37927  +
        let config = crate::service::RestJsonConfig::builder().build();
       37928  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       37929  +
            .all_query_string_types(move |input: crate::input::AllQueryStringTypesInput| {
       37930  +
                let sender = sender.clone();
       37931  +
                async move {
       37932  +
                    let result = {
       37933  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       37934  +
                        let expected = crate::input::AllQueryStringTypesInput {
       37935  +
                            query_integer: ::std::option::Option::Some(0),
       37936  +
                            query_boolean: ::std::option::Option::Some(false),
       37937  +
                            query_params_map_of_string_list: ::std::option::Option::Some({
       37938  +
                                let mut ret = ::std::collections::HashMap::new();
       37939  +
                                ret.insert("Integer".to_owned(), vec!["0".to_owned()]);
       37940  +
                                ret.insert("Boolean".to_owned(), vec!["false".to_owned()]);
       37941  +
                                ret
       37942  +
                            }),
       37943  +
                            query_string: ::std::option::Option::None,
       37944  +
                            query_string_list: ::std::option::Option::None,
       37945  +
                            query_string_set: ::std::option::Option::None,
       37946  +
                            query_byte: ::std::option::Option::None,
       37947  +
                            query_short: ::std::option::Option::None,
       37948  +
                            query_integer_list: ::std::option::Option::None,
       37949  +
                            query_integer_set: ::std::option::Option::None,
       37950  +
                            query_long: ::std::option::Option::None,
       37951  +
                            query_float: ::std::option::Option::None,
       37952  +
                            query_double: ::std::option::Option::None,
       37953  +
                            query_double_list: ::std::option::Option::None,
       37954  +
                            query_boolean_list: ::std::option::Option::None,
       37955  +
                            query_timestamp: ::std::option::Option::None,
       37956  +
                            query_timestamp_list: ::std::option::Option::None,
       37957  +
                            query_enum: ::std::option::Option::None,
       37958  +
                            query_enum_list: ::std::option::Option::None,
       37959  +
                            query_integer_enum: ::std::option::Option::None,
       37960  +
                            query_integer_enum_list: ::std::option::Option::None,
       37961  +
                        };
       37962  +
                        ::pretty_assertions::assert_eq!(
       37963  +
                            input.query_string,
       37964  +
                            expected.query_string,
       37965  +
                            "Unexpected value for `query_string`"
       37966  +
                        );
       37967  +
                        ::pretty_assertions::assert_eq!(
       37968  +
                            input.query_string_list,
       37969  +
                            expected.query_string_list,
       37970  +
                            "Unexpected value for `query_string_list`"
       37971  +
                        );
       37972  +
                        ::pretty_assertions::assert_eq!(
       37973  +
                            input.query_string_set,
       37974  +
                            expected.query_string_set,
       37975  +
                            "Unexpected value for `query_string_set`"
       37976  +
                        );
       37977  +
                        ::pretty_assertions::assert_eq!(
       37978  +
                            input.query_byte,
       37979  +
                            expected.query_byte,
       37980  +
                            "Unexpected value for `query_byte`"
       37981  +
                        );
       37982  +
                        ::pretty_assertions::assert_eq!(
       37983  +
                            input.query_short,
       37984  +
                            expected.query_short,
       37985  +
                            "Unexpected value for `query_short`"
       37986  +
                        );
       37987  +
                        ::pretty_assertions::assert_eq!(
       37988  +
                            input.query_integer,
       37989  +
                            expected.query_integer,
       37990  +
                            "Unexpected value for `query_integer`"
       37991  +
                        );
       37992  +
                        ::pretty_assertions::assert_eq!(
       37993  +
                            input.query_integer_list,
       37994  +
                            expected.query_integer_list,
       37995  +
                            "Unexpected value for `query_integer_list`"
       37996  +
                        );
       37997  +
                        ::pretty_assertions::assert_eq!(
       37998  +
                            input.query_integer_set,
       37999  +
                            expected.query_integer_set,
       38000  +
                            "Unexpected value for `query_integer_set`"
       38001  +
                        );
       38002  +
                        ::pretty_assertions::assert_eq!(
       38003  +
                            input.query_long,
       38004  +
                            expected.query_long,
       38005  +
                            "Unexpected value for `query_long`"
       38006  +
                        );
       38007  +
                        assert!(
       38008  +
                            input.query_float.float_equals(&expected.query_float),
       38009  +
                            "Unexpected value for `query_float` {:?} vs. {:?}",
       38010  +
                            expected.query_float,
       38011  +
                            input.query_float
       38012  +
                        );
       38013  +
                        assert!(
       38014  +
                            input.query_double.float_equals(&expected.query_double),
       38015  +
                            "Unexpected value for `query_double` {:?} vs. {:?}",
       38016  +
                            expected.query_double,
       38017  +
                            input.query_double
       38018  +
                        );
       38019  +
                        ::pretty_assertions::assert_eq!(
       38020  +
                            input.query_double_list,
       38021  +
                            expected.query_double_list,
       38022  +
                            "Unexpected value for `query_double_list`"
       38023  +
                        );
       38024  +
                        ::pretty_assertions::assert_eq!(
       38025  +
                            input.query_boolean,
       38026  +
                            expected.query_boolean,
       38027  +
                            "Unexpected value for `query_boolean`"
       38028  +
                        );
       38029  +
                        ::pretty_assertions::assert_eq!(
       38030  +
                            input.query_boolean_list,
       38031  +
                            expected.query_boolean_list,
       38032  +
                            "Unexpected value for `query_boolean_list`"
       38033  +
                        );
       38034  +
                        ::pretty_assertions::assert_eq!(
       38035  +
                            input.query_timestamp,
       38036  +
                            expected.query_timestamp,
       38037  +
                            "Unexpected value for `query_timestamp`"
       38038  +
                        );
       38039  +
                        ::pretty_assertions::assert_eq!(
       38040  +
                            input.query_timestamp_list,
       38041  +
                            expected.query_timestamp_list,
       38042  +
                            "Unexpected value for `query_timestamp_list`"
       38043  +
                        );
       38044  +
                        ::pretty_assertions::assert_eq!(
       38045  +
                            input.query_enum,
       38046  +
                            expected.query_enum,
       38047  +
                            "Unexpected value for `query_enum`"
       38048  +
                        );
       38049  +
                        ::pretty_assertions::assert_eq!(
       38050  +
                            input.query_enum_list,
       38051  +
                            expected.query_enum_list,
       38052  +
                            "Unexpected value for `query_enum_list`"
       38053  +
                        );
       38054  +
                        ::pretty_assertions::assert_eq!(
       38055  +
                            input.query_integer_enum,
       38056  +
                            expected.query_integer_enum,
       38057  +
                            "Unexpected value for `query_integer_enum`"
       38058  +
                        );
       38059  +
                        ::pretty_assertions::assert_eq!(
       38060  +
                            input.query_integer_enum_list,
       38061  +
                            expected.query_integer_enum_list,
       38062  +
                            "Unexpected value for `query_integer_enum_list`"
       38063  +
                        );
       38064  +
                        ::pretty_assertions::assert_eq!(
       38065  +
                            input.query_params_map_of_string_list,
       38066  +
                            expected.query_params_map_of_string_list,
       38067  +
                            "Unexpected value for `query_params_map_of_string_list`"
       38068  +
                        );
       38069  +
                        let response = crate::output::AllQueryStringTypesOutput {};
       38070  +
                        Ok(response)
       38071  +
                    };
       38072  +
                    sender.send(()).await.expect("receiver dropped early");
       38073  +
                    result
38740  38074   
                }
38741         -
            crate::protocol_serde::shape_http_response_code::de_http_response_code_http_request(
38742         -
                request,
38743         -
            )
       38075  +
            })
       38076  +
            .build_unchecked();
       38077  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
38744  38078   
            .await
38745         -
            .map_err(Into::into)
38746         -
        };
38747         -
        use ::futures_util::future::TryFutureExt;
38748         -
        let fut = fut.map_err(
38749         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38750         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38751         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38752         -
                    e,
38753         -
                )
38754         -
            },
       38079  +
            .expect("unable to make an HTTP request");
       38080  +
        assert!(
       38081  +
            receiver.recv().await.is_some(),
       38082  +
            "we expected operation handler to be invoked but it was not entered"
38755  38083   
        );
38756         -
        HttpResponseCodeInputFuture {
38757         -
            inner: Box::pin(fut),
38758         -
        }
38759         -
    }
38760         -
}
38761         -
impl
38762         -
    ::aws_smithy_http_server::response::IntoResponse<
38763         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38764         -
    > for crate::output::HttpResponseCodeOutput
38765         -
{
38766         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38767         -
        match crate::protocol_serde::shape_http_response_code::ser_http_response_code_http_response(
38768         -
            self,
38769         -
        ) {
38770         -
            Ok(response) => response,
38771         -
            Err(e) => {
38772         -
                ::tracing::error!(error = %e, "failed to serialize response");
38773         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38774         -
            }
38775         -
        }
38776  38084   
    }
38777  38085   
}
38778  38086   
38779         -
const CONTENT_TYPE_HTTPPAYLOADWITHUNION: ::mime::Mime = ::mime::APPLICATION_JSON;
       38087  +
const CONTENT_TYPE_HTTPREQUESTWITHREGEXLITERAL: ::mime::Mime = ::mime::APPLICATION_JSON;
38780  38088   
::pin_project_lite::pin_project! {
38781  38089   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38782         -
    /// [`HttpPayloadWithUnionInput`](crate::input::HttpPayloadWithUnionInput) using modelled bindings.
38783         -
    pub struct HttpPayloadWithUnionInputFuture {
38784         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadWithUnionInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       38090  +
    /// [`HttpRequestWithRegexLiteralInput`](crate::input::HttpRequestWithRegexLiteralInput) using modelled bindings.
       38091  +
    pub struct HttpRequestWithRegexLiteralInputFuture {
       38092  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithRegexLiteralInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38785  38093   
    }
38786  38094   
}
38787  38095   
38788         -
impl std::future::Future for HttpPayloadWithUnionInputFuture {
       38096  +
impl std::future::Future for HttpRequestWithRegexLiteralInputFuture {
38789  38097   
    type Output = Result<
38790         -
        crate::input::HttpPayloadWithUnionInput,
       38098  +
        crate::input::HttpRequestWithRegexLiteralInput,
38791  38099   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38792  38100   
    >;
38793  38101   
38794  38102   
    fn poll(
38795  38103   
        self: std::pin::Pin<&mut Self>,
38796  38104   
        cx: &mut std::task::Context<'_>,
38797  38105   
    ) -> std::task::Poll<Self::Output> {
38798  38106   
        let this = self.project();
38799  38107   
        this.inner.as_mut().poll(cx)
38800  38108   
    }
38801  38109   
}
38802  38110   
38803  38111   
impl<B>
38804  38112   
    ::aws_smithy_http_server::request::FromRequest<
38805  38113   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38806  38114   
        B,
38807         -
    > for crate::input::HttpPayloadWithUnionInput
       38115  +
    > for crate::input::HttpRequestWithRegexLiteralInput
38808  38116   
where
38809  38117   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38810  38118   
    B: 'static,
38811  38119   
38812  38120   
    B::Data: Send,
38813  38121   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38814  38122   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38815  38123   
{
38816  38124   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38817         -
    type Future = HttpPayloadWithUnionInputFuture;
       38125  +
    type Future = HttpRequestWithRegexLiteralInputFuture;
38818  38126   
38819  38127   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38820  38128   
        let fut = async move {
38821  38129   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38822  38130   
                request.headers(),
38823         -
                &CONTENT_TYPE_HTTPPAYLOADWITHUNION,
       38131  +
                &CONTENT_TYPE_HTTPREQUESTWITHREGEXLITERAL,
38824  38132   
            ) {
38825  38133   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38826  38134   
            }
38827         -
            crate::protocol_serde::shape_http_payload_with_union::de_http_payload_with_union_http_request(request)
       38135  +
            crate::protocol_serde::shape_http_request_with_regex_literal::de_http_request_with_regex_literal_http_request(request)
38828  38136   
                            .await
38829  38137   
                            .map_err(Into::into)
38830  38138   
        };
38831  38139   
        use ::futures_util::future::TryFutureExt;
38832  38140   
        let fut = fut.map_err(
38833  38141   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38834  38142   
                ::tracing::debug!(error = %e, "failed to deserialize request");
38835  38143   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38836  38144   
                    e,
38837  38145   
                )
38838  38146   
            },
38839  38147   
        );
38840         -
        HttpPayloadWithUnionInputFuture {
       38148  +
        HttpRequestWithRegexLiteralInputFuture {
38841  38149   
            inner: Box::pin(fut),
38842  38150   
        }
38843  38151   
    }
38844  38152   
}
38845  38153   
impl
38846  38154   
    ::aws_smithy_http_server::response::IntoResponse<
38847  38155   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38848         -
    > for crate::output::HttpPayloadWithUnionOutput
       38156  +
    > for crate::output::HttpRequestWithRegexLiteralOutput
38849  38157   
{
38850  38158   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38851         -
        match crate::protocol_serde::shape_http_payload_with_union::ser_http_payload_with_union_http_response(self) {
       38159  +
        match crate::protocol_serde::shape_http_request_with_regex_literal::ser_http_request_with_regex_literal_http_response(self) {
38852  38160   
                        Ok(response) => response,
38853  38161   
                        Err(e) => {
38854  38162   
                            ::tracing::error!(error = %e, "failed to serialize response");
38855  38163   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38856  38164   
                        }
38857  38165   
                    }
38858  38166   
    }
38859  38167   
}
38860         -
38861         -
static CONTENT_TYPE_HTTPSTRINGPAYLOAD: ::once_cell::sync::Lazy<::mime::Mime> =
38862         -
    ::once_cell::sync::Lazy::new(|| {
38863         -
        "text/plain"
38864         -
            .parse::<::mime::Mime>()
38865         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
38866         -
    });
38867         -
::pin_project_lite::pin_project! {
38868         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38869         -
    /// [`HttpStringPayloadInput`](crate::input::HttpStringPayloadInput) using modelled bindings.
38870         -
    pub struct HttpStringPayloadInputFuture {
38871         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpStringPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38872         -
    }
38873         -
}
38874         -
38875         -
impl std::future::Future for HttpStringPayloadInputFuture {
38876         -
    type Output = Result<
38877         -
        crate::input::HttpStringPayloadInput,
38878         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38879         -
    >;
38880         -
38881         -
    fn poll(
38882         -
        self: std::pin::Pin<&mut Self>,
38883         -
        cx: &mut std::task::Context<'_>,
38884         -
    ) -> std::task::Poll<Self::Output> {
38885         -
        let this = self.project();
38886         -
        this.inner.as_mut().poll(cx)
38887         -
    }
38888         -
}
38889         -
38890         -
impl<B>
38891         -
    ::aws_smithy_http_server::request::FromRequest<
38892         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38893         -
        B,
38894         -
    > for crate::input::HttpStringPayloadInput
38895         -
where
38896         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38897         -
    B: 'static,
38898         -
38899         -
    B::Data: Send,
38900         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38901         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38902         -
{
38903         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38904         -
    type Future = HttpStringPayloadInputFuture;
38905         -
38906         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38907         -
        let fut = async move {
38908         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38909         -
                request.headers(),
38910         -
                &CONTENT_TYPE_HTTPSTRINGPAYLOAD,
38911         -
            ) {
38912         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
38913         -
            }
38914         -
            crate::protocol_serde::shape_http_string_payload::de_http_string_payload_http_request(
38915         -
                request,
38916         -
            )
38917         -
            .await
38918         -
            .map_err(Into::into)
38919         -
        };
38920         -
        use ::futures_util::future::TryFutureExt;
38921         -
        let fut = fut.map_err(
38922         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
38923         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
38924         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
38925         -
                    e,
38926         -
                )
38927         -
            },
38928         -
        );
38929         -
        HttpStringPayloadInputFuture {
38930         -
            inner: Box::pin(fut),
38931         -
        }
38932         -
    }
38933         -
}
38934  38168   
impl
38935  38169   
    ::aws_smithy_http_server::response::IntoResponse<
38936  38170   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38937         -
    > for crate::output::HttpStringPayloadOutput
       38171  +
    > for crate::error::HttpRequestWithRegexLiteralError
38938  38172   
{
38939  38173   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
38940         -
        match crate::protocol_serde::shape_http_string_payload::ser_http_string_payload_http_response(self) {
38941         -
                        Ok(response) => response,
       38174  +
        match crate::protocol_serde::shape_http_request_with_regex_literal::ser_http_request_with_regex_literal_http_error(&self) {
       38175  +
            Ok(mut response) => {
       38176  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       38177  +
                response
       38178  +
            },
38942  38179   
            Err(e) => {
38943  38180   
                ::tracing::error!(error = %e, "failed to serialize response");
38944  38181   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
38945  38182   
            }
38946  38183   
        }
38947  38184   
    }
38948  38185   
}
38949  38186   
38950         -
static CONTENT_TYPE_HTTPENUMPAYLOAD: ::once_cell::sync::Lazy<::mime::Mime> =
38951         -
    ::once_cell::sync::Lazy::new(|| {
38952         -
        "text/plain"
38953         -
            .parse::<::mime::Mime>()
38954         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
38955         -
    });
       38187  +
#[allow(unreachable_code, unused_variables)]
       38188  +
#[cfg(test)]
       38189  +
mod http_request_with_regex_literal_test {
       38190  +
       38191  +
    /// Path matching is not broken by regex expressions in literal segments
       38192  +
    /// Test ID: RestJsonToleratesRegexCharsInSegments
       38193  +
    #[::tokio::test]
       38194  +
    #[::tracing_test::traced_test]
       38195  +
    async fn rest_json_tolerates_regex_chars_in_segments_request() {
       38196  +
        #[allow(unused_mut)]
       38197  +
        let mut http_request = http::Request::builder()
       38198  +
            .uri("/ReDosLiteral/abc/(a+)+")
       38199  +
            .method("GET")
       38200  +
            .body(::aws_smithy_http_server::body::Body::from(
       38201  +
                ::bytes::Bytes::from_static("".as_bytes()),
       38202  +
            ))
       38203  +
            .unwrap();
       38204  +
        #[allow(unused_mut)]
       38205  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       38206  +
        let config = crate::service::RestJsonConfig::builder().build();
       38207  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       38208  +
            .http_request_with_regex_literal(
       38209  +
                move |input: crate::input::HttpRequestWithRegexLiteralInput| {
       38210  +
                    let sender = sender.clone();
       38211  +
                    async move {
       38212  +
                        let result = {
       38213  +
                            let expected = crate::input::HttpRequestWithRegexLiteralInput {
       38214  +
                                str: "abc".to_owned(),
       38215  +
                            };
       38216  +
                            ::pretty_assertions::assert_eq!(input, expected);
       38217  +
                            let response = crate::output::HttpRequestWithRegexLiteralOutput {};
       38218  +
                            Ok(response)
       38219  +
                        };
       38220  +
                        sender.send(()).await.expect("receiver dropped early");
       38221  +
                        result
       38222  +
                    }
       38223  +
                },
       38224  +
            )
       38225  +
            .build_unchecked();
       38226  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       38227  +
            .await
       38228  +
            .expect("unable to make an HTTP request");
       38229  +
        assert!(
       38230  +
            receiver.recv().await.is_some(),
       38231  +
            "we expected operation handler to be invoked but it was not entered"
       38232  +
        );
       38233  +
    }
       38234  +
}
       38235  +
       38236  +
const CONTENT_TYPE_HTTPREQUESTWITHFLOATLABELS: ::mime::Mime = ::mime::APPLICATION_JSON;
38956  38237   
::pin_project_lite::pin_project! {
38957  38238   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
38958         -
    /// [`HttpEnumPayloadInput`](crate::input::HttpEnumPayloadInput) using modelled bindings.
38959         -
    pub struct HttpEnumPayloadInputFuture {
38960         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpEnumPayloadInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       38239  +
    /// [`HttpRequestWithFloatLabelsInput`](crate::input::HttpRequestWithFloatLabelsInput) using modelled bindings.
       38240  +
    pub struct HttpRequestWithFloatLabelsInputFuture {
       38241  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithFloatLabelsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
38961  38242   
    }
38962  38243   
}
38963  38244   
38964         -
impl std::future::Future for HttpEnumPayloadInputFuture {
       38245  +
impl std::future::Future for HttpRequestWithFloatLabelsInputFuture {
38965  38246   
    type Output = Result<
38966         -
        crate::input::HttpEnumPayloadInput,
       38247  +
        crate::input::HttpRequestWithFloatLabelsInput,
38967  38248   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
38968  38249   
    >;
38969  38250   
38970  38251   
    fn poll(
38971  38252   
        self: std::pin::Pin<&mut Self>,
38972  38253   
        cx: &mut std::task::Context<'_>,
38973  38254   
    ) -> std::task::Poll<Self::Output> {
38974  38255   
        let this = self.project();
38975  38256   
        this.inner.as_mut().poll(cx)
38976  38257   
    }
38977  38258   
}
38978  38259   
38979  38260   
impl<B>
38980  38261   
    ::aws_smithy_http_server::request::FromRequest<
38981  38262   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
38982  38263   
        B,
38983         -
    > for crate::input::HttpEnumPayloadInput
       38264  +
    > for crate::input::HttpRequestWithFloatLabelsInput
38984  38265   
where
38985  38266   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
38986  38267   
    B: 'static,
38987  38268   
38988  38269   
    B::Data: Send,
38989  38270   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
38990  38271   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
38991  38272   
{
38992  38273   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
38993         -
    type Future = HttpEnumPayloadInputFuture;
       38274  +
    type Future = HttpRequestWithFloatLabelsInputFuture;
38994  38275   
38995  38276   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
38996  38277   
        let fut = async move {
38997  38278   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
38998  38279   
                request.headers(),
38999         -
                &CONTENT_TYPE_HTTPENUMPAYLOAD,
       38280  +
                &CONTENT_TYPE_HTTPREQUESTWITHFLOATLABELS,
39000  38281   
            ) {
39001  38282   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39002  38283   
            }
39003         -
            crate::protocol_serde::shape_http_enum_payload::de_http_enum_payload_http_request(
39004         -
                request,
39005         -
            )
       38284  +
            crate::protocol_serde::shape_http_request_with_float_labels::de_http_request_with_float_labels_http_request(request)
39006  38285   
                            .await
39007  38286   
                            .map_err(Into::into)
39008  38287   
        };
39009  38288   
        use ::futures_util::future::TryFutureExt;
39010  38289   
        let fut = fut.map_err(
39011  38290   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39012  38291   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39013  38292   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39014  38293   
                    e,
39015  38294   
                )
39016  38295   
            },
39017  38296   
        );
39018         -
        HttpEnumPayloadInputFuture {
       38297  +
        HttpRequestWithFloatLabelsInputFuture {
39019  38298   
            inner: Box::pin(fut),
39020  38299   
        }
39021  38300   
    }
39022  38301   
}
39023  38302   
impl
39024  38303   
    ::aws_smithy_http_server::response::IntoResponse<
39025  38304   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39026         -
    > for crate::output::HttpEnumPayloadOutput
       38305  +
    > for crate::output::HttpRequestWithFloatLabelsOutput
39027  38306   
{
39028  38307   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39029         -
        match crate::protocol_serde::shape_http_enum_payload::ser_http_enum_payload_http_response(
39030         -
            self,
39031         -
        ) {
       38308  +
        match crate::protocol_serde::shape_http_request_with_float_labels::ser_http_request_with_float_labels_http_response(self) {
39032  38309   
                        Ok(response) => response,
39033  38310   
                        Err(e) => {
39034  38311   
                            ::tracing::error!(error = %e, "failed to serialize response");
39035  38312   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39036  38313   
                        }
39037  38314   
                    }
39038  38315   
    }
39039  38316   
}
39040  38317   
impl
39041  38318   
    ::aws_smithy_http_server::response::IntoResponse<
39042  38319   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39043         -
    > for crate::error::HttpEnumPayloadError
       38320  +
    > for crate::error::HttpRequestWithFloatLabelsError
39044  38321   
{
39045  38322   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39046         -
        match crate::protocol_serde::shape_http_enum_payload::ser_http_enum_payload_http_error(
39047         -
            &self,
39048         -
        ) {
       38323  +
        match crate::protocol_serde::shape_http_request_with_float_labels::ser_http_request_with_float_labels_http_error(&self) {
39049  38324   
            Ok(mut response) => {
39050         -
                response.extensions_mut().insert(
39051         -
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
39052         -
                );
       38325  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
39053  38326   
                response
39054         -
            }
       38327  +
            },
39055  38328   
            Err(e) => {
39056  38329   
                ::tracing::error!(error = %e, "failed to serialize response");
39057  38330   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39058  38331   
            }
39059  38332   
        }
39060  38333   
    }
39061  38334   
}
39062  38335   
39063         -
const CONTENT_TYPE_HTTPPAYLOADWITHSTRUCTURE: ::mime::Mime = ::mime::APPLICATION_JSON;
39064         -
::pin_project_lite::pin_project! {
39065         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39066         -
    /// [`HttpPayloadWithStructureInput`](crate::input::HttpPayloadWithStructureInput) using modelled bindings.
39067         -
    pub struct HttpPayloadWithStructureInputFuture {
39068         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadWithStructureInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39069         -
    }
39070         -
}
39071         -
39072         -
impl std::future::Future for HttpPayloadWithStructureInputFuture {
39073         -
    type Output = Result<
39074         -
        crate::input::HttpPayloadWithStructureInput,
39075         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39076         -
    >;
       38336  +
#[allow(unreachable_code, unused_variables)]
       38337  +
#[cfg(test)]
       38338  +
mod http_request_with_float_labels_test {
39077  38339   
39078         -
    fn poll(
39079         -
        self: std::pin::Pin<&mut Self>,
39080         -
        cx: &mut std::task::Context<'_>,
39081         -
    ) -> std::task::Poll<Self::Output> {
39082         -
        let this = self.project();
39083         -
        this.inner.as_mut().poll(cx)
       38340  +
    /// Supports handling NaN float label values.
       38341  +
    /// Test ID: RestJsonSupportsNaNFloatLabels
       38342  +
    #[::tokio::test]
       38343  +
    #[::tracing_test::traced_test]
       38344  +
    async fn rest_json_supports_na_n_float_labels_request() {
       38345  +
        #[allow(unused_mut)]
       38346  +
        let mut http_request = http::Request::builder()
       38347  +
            .uri("/FloatHttpLabels/NaN/NaN")
       38348  +
            .method("GET")
       38349  +
            .body(::aws_smithy_http_server::body::Body::from(
       38350  +
                ::bytes::Bytes::from_static("".as_bytes()),
       38351  +
            ))
       38352  +
            .unwrap();
       38353  +
        #[allow(unused_mut)]
       38354  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       38355  +
        let config = crate::service::RestJsonConfig::builder().build();
       38356  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       38357  +
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
       38358  +
                            let sender = sender.clone();
       38359  +
                            async move {
       38360  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       38361  +
        let expected =
       38362  +
            crate::input::HttpRequestWithFloatLabelsInput {
       38363  +
                float:
       38364  +
                    <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
       38365  +
                ,
       38366  +
                double:
       38367  +
                    <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
       38368  +
                ,
39084  38369   
            }
39085         -
}
39086         -
39087         -
impl<B>
39088         -
    ::aws_smithy_http_server::request::FromRequest<
39089         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39090         -
        B,
39091         -
    > for crate::input::HttpPayloadWithStructureInput
39092         -
where
39093         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39094         -
    B: 'static,
39095         -
39096         -
    B::Data: Send,
39097         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39098         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39099         -
{
39100         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39101         -
    type Future = HttpPayloadWithStructureInputFuture;
39102         -
39103         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39104         -
        let fut = async move {
39105         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39106         -
                request.headers(),
39107         -
                &CONTENT_TYPE_HTTPPAYLOADWITHSTRUCTURE,
39108         -
            ) {
39109         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       38370  +
        ;
       38371  +
        assert!(input.float.float_equals(&expected.float),
       38372  +
                                            "Unexpected value for `float` {:?} vs. {:?}", expected.float, input.float);
       38373  +
        assert!(input.double.float_equals(&expected.double),
       38374  +
                                            "Unexpected value for `double` {:?} vs. {:?}", expected.double, input.double);
       38375  +
        let response =
       38376  +
            crate::output::HttpRequestWithFloatLabelsOutput {
39110  38377   
            }
39111         -
            crate::protocol_serde::shape_http_payload_with_structure::de_http_payload_with_structure_http_request(request)
       38378  +
        ;
       38379  +
        Ok(response) };
       38380  +
                                sender.send(()).await.expect("receiver dropped early");
       38381  +
                                result
       38382  +
                            }
       38383  +
                        })
       38384  +
                        .build_unchecked();
       38385  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
39112  38386   
            .await
39113         -
                            .map_err(Into::into)
39114         -
        };
39115         -
        use ::futures_util::future::TryFutureExt;
39116         -
        let fut = fut.map_err(
39117         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39118         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
39119         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39120         -
                    e,
39121         -
                )
39122         -
            },
       38387  +
            .expect("unable to make an HTTP request");
       38388  +
        assert!(
       38389  +
            receiver.recv().await.is_some(),
       38390  +
            "we expected operation handler to be invoked but it was not entered"
39123  38391   
        );
39124         -
        HttpPayloadWithStructureInputFuture {
39125         -
            inner: Box::pin(fut),
39126         -
        }
39127         -
    }
39128         -
}
39129         -
impl
39130         -
    ::aws_smithy_http_server::response::IntoResponse<
39131         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39132         -
    > for crate::output::HttpPayloadWithStructureOutput
39133         -
{
39134         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39135         -
        match crate::protocol_serde::shape_http_payload_with_structure::ser_http_payload_with_structure_http_response(self) {
39136         -
                        Ok(response) => response,
39137         -
                        Err(e) => {
39138         -
                            ::tracing::error!(error = %e, "failed to serialize response");
39139         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39140  38392   
    }
       38393  +
    /// Supports handling Infinity float label values.
       38394  +
    /// Test ID: RestJsonSupportsInfinityFloatLabels
       38395  +
    #[::tokio::test]
       38396  +
    #[::tracing_test::traced_test]
       38397  +
    async fn rest_json_supports_infinity_float_labels_request() {
       38398  +
        #[allow(unused_mut)]
       38399  +
        let mut http_request = http::Request::builder()
       38400  +
            .uri("/FloatHttpLabels/Infinity/Infinity")
       38401  +
            .method("GET")
       38402  +
            .body(::aws_smithy_http_server::body::Body::from(
       38403  +
                ::bytes::Bytes::from_static("".as_bytes()),
       38404  +
            ))
       38405  +
            .unwrap();
       38406  +
        #[allow(unused_mut)]
       38407  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       38408  +
        let config = crate::service::RestJsonConfig::builder().build();
       38409  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       38410  +
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
       38411  +
                            let sender = sender.clone();
       38412  +
                            async move {
       38413  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       38414  +
        let expected =
       38415  +
            crate::input::HttpRequestWithFloatLabelsInput {
       38416  +
                float:
       38417  +
                    <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       38418  +
                ,
       38419  +
                double:
       38420  +
                    <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       38421  +
                ,
39141  38422   
            }
       38423  +
        ;
       38424  +
        assert!(input.float.float_equals(&expected.float),
       38425  +
                                            "Unexpected value for `float` {:?} vs. {:?}", expected.float, input.float);
       38426  +
        assert!(input.double.float_equals(&expected.double),
       38427  +
                                            "Unexpected value for `double` {:?} vs. {:?}", expected.double, input.double);
       38428  +
        let response =
       38429  +
            crate::output::HttpRequestWithFloatLabelsOutput {
39142  38430   
            }
39143         -
}
39144         -
39145         -
static CONTENT_TYPE_HTTPPAYLOADTRAITSWITHMEDIATYPE: ::once_cell::sync::Lazy<::mime::Mime> =
39146         -
    ::once_cell::sync::Lazy::new(|| {
39147         -
        "text/plain"
39148         -
            .parse::<::mime::Mime>()
39149         -
            .expect("BUG: MIME parsing failed, content_type is not valid")
39150         -
    });
39151         -
::pin_project_lite::pin_project! {
39152         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39153         -
    /// [`HttpPayloadTraitsWithMediaTypeInput`](crate::input::HttpPayloadTraitsWithMediaTypeInput) using modelled bindings.
39154         -
    pub struct HttpPayloadTraitsWithMediaTypeInputFuture {
39155         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadTraitsWithMediaTypeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39156         -
    }
39157         -
}
39158         -
39159         -
impl std::future::Future for HttpPayloadTraitsWithMediaTypeInputFuture {
39160         -
    type Output = Result<
39161         -
        crate::input::HttpPayloadTraitsWithMediaTypeInput,
39162         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39163         -
    >;
39164         -
39165         -
    fn poll(
39166         -
        self: std::pin::Pin<&mut Self>,
39167         -
        cx: &mut std::task::Context<'_>,
39168         -
    ) -> std::task::Poll<Self::Output> {
39169         -
        let this = self.project();
39170         -
        this.inner.as_mut().poll(cx)
39171         -
    }
39172         -
}
39173         -
39174         -
impl<B>
39175         -
    ::aws_smithy_http_server::request::FromRequest<
39176         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39177         -
        B,
39178         -
    > for crate::input::HttpPayloadTraitsWithMediaTypeInput
39179         -
where
39180         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39181         -
    B: 'static,
39182         -
39183         -
    B::Data: Send,
39184         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39185         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39186         -
{
39187         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39188         -
    type Future = HttpPayloadTraitsWithMediaTypeInputFuture;
39189         -
39190         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39191         -
        let fut = async move {
39192         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39193         -
                request.headers(),
39194         -
                &CONTENT_TYPE_HTTPPAYLOADTRAITSWITHMEDIATYPE,
39195         -
            ) {
39196         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       38431  +
        ;
       38432  +
        Ok(response) };
       38433  +
                                sender.send(()).await.expect("receiver dropped early");
       38434  +
                                result
39197  38435   
                            }
39198         -
            crate::protocol_serde::shape_http_payload_traits_with_media_type::de_http_payload_traits_with_media_type_http_request(request)
       38436  +
                        })
       38437  +
                        .build_unchecked();
       38438  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
39199  38439   
            .await
39200         -
                            .map_err(Into::into)
39201         -
        };
39202         -
        use ::futures_util::future::TryFutureExt;
39203         -
        let fut = fut.map_err(
39204         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39205         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
39206         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39207         -
                    e,
39208         -
                )
39209         -
            },
       38440  +
            .expect("unable to make an HTTP request");
       38441  +
        assert!(
       38442  +
            receiver.recv().await.is_some(),
       38443  +
            "we expected operation handler to be invoked but it was not entered"
39210  38444   
        );
39211         -
        HttpPayloadTraitsWithMediaTypeInputFuture {
39212         -
            inner: Box::pin(fut),
39213         -
        }
39214  38445   
    }
39215         -
}
39216         -
impl
39217         -
    ::aws_smithy_http_server::response::IntoResponse<
39218         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39219         -
    > for crate::output::HttpPayloadTraitsWithMediaTypeOutput
39220         -
{
39221         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39222         -
        match crate::protocol_serde::shape_http_payload_traits_with_media_type::ser_http_payload_traits_with_media_type_http_response(self) {
39223         -
                        Ok(response) => response,
39224         -
                        Err(e) => {
39225         -
                            ::tracing::error!(error = %e, "failed to serialize response");
39226         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       38446  +
    /// Supports handling -Infinity float label values.
       38447  +
    /// Test ID: RestJsonSupportsNegativeInfinityFloatLabels
       38448  +
    #[::tokio::test]
       38449  +
    #[::tracing_test::traced_test]
       38450  +
    async fn rest_json_supports_negative_infinity_float_labels_request() {
       38451  +
        #[allow(unused_mut)]
       38452  +
        let mut http_request = http::Request::builder()
       38453  +
            .uri("/FloatHttpLabels/-Infinity/-Infinity")
       38454  +
            .method("GET")
       38455  +
            .body(::aws_smithy_http_server::body::Body::from(
       38456  +
                ::bytes::Bytes::from_static("".as_bytes()),
       38457  +
            ))
       38458  +
            .unwrap();
       38459  +
        #[allow(unused_mut)]
       38460  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       38461  +
        let config = crate::service::RestJsonConfig::builder().build();
       38462  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       38463  +
                        .http_request_with_float_labels(move |input: crate::input::HttpRequestWithFloatLabelsInput| {
       38464  +
                            let sender = sender.clone();
       38465  +
                            async move {
       38466  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       38467  +
        let expected =
       38468  +
            crate::input::HttpRequestWithFloatLabelsInput {
       38469  +
                float:
       38470  +
                    <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
       38471  +
                ,
       38472  +
                double:
       38473  +
                    <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
       38474  +
                ,
39227  38475   
            }
       38476  +
        ;
       38477  +
        assert!(input.float.float_equals(&expected.float),
       38478  +
                                            "Unexpected value for `float` {:?} vs. {:?}", expected.float, input.float);
       38479  +
        assert!(input.double.float_equals(&expected.double),
       38480  +
                                            "Unexpected value for `double` {:?} vs. {:?}", expected.double, input.double);
       38481  +
        let response =
       38482  +
            crate::output::HttpRequestWithFloatLabelsOutput {
       38483  +
            }
       38484  +
        ;
       38485  +
        Ok(response) };
       38486  +
                                sender.send(()).await.expect("receiver dropped early");
       38487  +
                                result
39228  38488   
                            }
       38489  +
                        })
       38490  +
                        .build_unchecked();
       38491  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       38492  +
            .await
       38493  +
            .expect("unable to make an HTTP request");
       38494  +
        assert!(
       38495  +
            receiver.recv().await.is_some(),
       38496  +
            "we expected operation handler to be invoked but it was not entered"
       38497  +
        );
39229  38498   
    }
39230  38499   
}
39231  38500   
       38501  +
const CONTENT_TYPE_HTTPREQUESTWITHGREEDYLABELINPATH: ::mime::Mime = ::mime::APPLICATION_JSON;
39232  38502   
::pin_project_lite::pin_project! {
39233  38503   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39234         -
    /// [`HttpPayloadTraitsInput`](crate::input::HttpPayloadTraitsInput) using modelled bindings.
39235         -
    pub struct HttpPayloadTraitsInputFuture {
39236         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPayloadTraitsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       38504  +
    /// [`HttpRequestWithGreedyLabelInPathInput`](crate::input::HttpRequestWithGreedyLabelInPathInput) using modelled bindings.
       38505  +
    pub struct HttpRequestWithGreedyLabelInPathInputFuture {
       38506  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithGreedyLabelInPathInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39237  38507   
    }
39238  38508   
}
39239  38509   
39240         -
impl std::future::Future for HttpPayloadTraitsInputFuture {
       38510  +
impl std::future::Future for HttpRequestWithGreedyLabelInPathInputFuture {
39241  38511   
    type Output = Result<
39242         -
        crate::input::HttpPayloadTraitsInput,
       38512  +
        crate::input::HttpRequestWithGreedyLabelInPathInput,
39243  38513   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39244  38514   
    >;
39245  38515   
39246  38516   
    fn poll(
39247  38517   
        self: std::pin::Pin<&mut Self>,
39248  38518   
        cx: &mut std::task::Context<'_>,
39249  38519   
    ) -> std::task::Poll<Self::Output> {
39250  38520   
        let this = self.project();
39251  38521   
        this.inner.as_mut().poll(cx)
39252  38522   
    }
39253  38523   
}
39254  38524   
39255  38525   
impl<B>
39256  38526   
    ::aws_smithy_http_server::request::FromRequest<
39257  38527   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39258  38528   
        B,
39259         -
    > for crate::input::HttpPayloadTraitsInput
       38529  +
    > for crate::input::HttpRequestWithGreedyLabelInPathInput
39260  38530   
where
39261  38531   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39262  38532   
    B: 'static,
39263  38533   
39264  38534   
    B::Data: Send,
39265  38535   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39266  38536   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39267  38537   
{
39268  38538   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39269         -
    type Future = HttpPayloadTraitsInputFuture;
       38539  +
    type Future = HttpRequestWithGreedyLabelInPathInputFuture;
39270  38540   
39271  38541   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39272  38542   
        let fut = async move {
39273         -
            crate::protocol_serde::shape_http_payload_traits::de_http_payload_traits_http_request(
39274         -
                request,
39275         -
            )
       38543  +
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
       38544  +
                request.headers(),
       38545  +
                &CONTENT_TYPE_HTTPREQUESTWITHGREEDYLABELINPATH,
       38546  +
            ) {
       38547  +
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       38548  +
            }
       38549  +
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path::de_http_request_with_greedy_label_in_path_http_request(request)
39276  38550   
                            .await
39277  38551   
                            .map_err(Into::into)
39278  38552   
        };
39279  38553   
        use ::futures_util::future::TryFutureExt;
39280  38554   
        let fut = fut.map_err(
39281  38555   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39282  38556   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39283  38557   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39284  38558   
                    e,
39285  38559   
                )
39286  38560   
            },
39287  38561   
        );
39288         -
        HttpPayloadTraitsInputFuture {
       38562  +
        HttpRequestWithGreedyLabelInPathInputFuture {
39289  38563   
            inner: Box::pin(fut),
39290  38564   
        }
39291  38565   
    }
39292  38566   
}
39293  38567   
impl
39294  38568   
    ::aws_smithy_http_server::response::IntoResponse<
39295  38569   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39296         -
    > for crate::output::HttpPayloadTraitsOutput
       38570  +
    > for crate::output::HttpRequestWithGreedyLabelInPathOutput
39297  38571   
{
39298  38572   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39299         -
        match crate::protocol_serde::shape_http_payload_traits::ser_http_payload_traits_http_response(self) {
       38573  +
        match crate::protocol_serde::shape_http_request_with_greedy_label_in_path::ser_http_request_with_greedy_label_in_path_http_response(self) {
39300  38574   
                        Ok(response) => response,
39301  38575   
                        Err(e) => {
39302  38576   
                            ::tracing::error!(error = %e, "failed to serialize response");
39303  38577   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39304  38578   
                        }
39305  38579   
                    }
39306  38580   
    }
39307  38581   
}
       38582  +
impl
       38583  +
    ::aws_smithy_http_server::response::IntoResponse<
       38584  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       38585  +
    > for crate::error::HttpRequestWithGreedyLabelInPathError
       38586  +
{
       38587  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       38588  +
        match crate::protocol_serde::shape_http_request_with_greedy_label_in_path::ser_http_request_with_greedy_label_in_path_http_error(&self) {
       38589  +
            Ok(mut response) => {
       38590  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       38591  +
                response
       38592  +
            },
       38593  +
            Err(e) => {
       38594  +
                ::tracing::error!(error = %e, "failed to serialize response");
       38595  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       38596  +
            }
       38597  +
        }
       38598  +
    }
       38599  +
}
39308  38600   
39309         -
const CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE: ::mime::Mime = ::mime::APPLICATION_JSON;
       38601  +
#[allow(unreachable_code, unused_variables)]
       38602  +
#[cfg(test)]
       38603  +
mod http_request_with_greedy_label_in_path_test {
       38604  +
       38605  +
    /// Serializes greedy labels and normal labels
       38606  +
    /// Test ID: RestJsonHttpRequestWithGreedyLabelInPath
       38607  +
    #[::tokio::test]
       38608  +
    #[::tracing_test::traced_test]
       38609  +
    async fn rest_json_http_request_with_greedy_label_in_path_request() {
       38610  +
        #[allow(unused_mut)]
       38611  +
        let mut http_request = http::Request::builder()
       38612  +
            .uri("/HttpRequestWithGreedyLabelInPath/foo/hello%2Fescape/baz/there/guy")
       38613  +
            .method("GET")
       38614  +
            .body(::aws_smithy_http_server::body::Body::from(
       38615  +
                ::bytes::Bytes::from_static("".as_bytes()),
       38616  +
            ))
       38617  +
            .unwrap();
       38618  +
        #[allow(unused_mut)]
       38619  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       38620  +
        let config = crate::service::RestJsonConfig::builder().build();
       38621  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       38622  +
            .http_request_with_greedy_label_in_path(
       38623  +
                move |input: crate::input::HttpRequestWithGreedyLabelInPathInput| {
       38624  +
                    let sender = sender.clone();
       38625  +
                    async move {
       38626  +
                        let result = {
       38627  +
                            let expected = crate::input::HttpRequestWithGreedyLabelInPathInput {
       38628  +
                                foo: "hello/escape".to_owned(),
       38629  +
                                baz: "there/guy".to_owned(),
       38630  +
                            };
       38631  +
                            ::pretty_assertions::assert_eq!(input, expected);
       38632  +
                            let response = crate::output::HttpRequestWithGreedyLabelInPathOutput {};
       38633  +
                            Ok(response)
       38634  +
                        };
       38635  +
                        sender.send(()).await.expect("receiver dropped early");
       38636  +
                        result
       38637  +
                    }
       38638  +
                },
       38639  +
            )
       38640  +
            .build_unchecked();
       38641  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       38642  +
            .await
       38643  +
            .expect("unable to make an HTTP request");
       38644  +
        assert!(
       38645  +
            receiver.recv().await.is_some(),
       38646  +
            "we expected operation handler to be invoked but it was not entered"
       38647  +
        );
       38648  +
    }
       38649  +
}
       38650  +
       38651  +
const CONTENT_TYPE_HTTPREQUESTWITHLABELSANDTIMESTAMPFORMAT: ::mime::Mime = ::mime::APPLICATION_JSON;
39310  38652   
::pin_project_lite::pin_project! {
39311  38653   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39312         -
    /// [`HttpPrefixHeadersInResponseInput`](crate::input::HttpPrefixHeadersInResponseInput) using modelled bindings.
39313         -
    pub struct HttpPrefixHeadersInResponseInputFuture {
39314         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPrefixHeadersInResponseInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       38654  +
    /// [`HttpRequestWithLabelsAndTimestampFormatInput`](crate::input::HttpRequestWithLabelsAndTimestampFormatInput) using modelled bindings.
       38655  +
    pub struct HttpRequestWithLabelsAndTimestampFormatInputFuture {
       38656  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithLabelsAndTimestampFormatInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39315  38657   
    }
39316  38658   
}
39317  38659   
39318         -
impl std::future::Future for HttpPrefixHeadersInResponseInputFuture {
       38660  +
impl std::future::Future for HttpRequestWithLabelsAndTimestampFormatInputFuture {
39319  38661   
    type Output = Result<
39320         -
        crate::input::HttpPrefixHeadersInResponseInput,
       38662  +
        crate::input::HttpRequestWithLabelsAndTimestampFormatInput,
39321  38663   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39322  38664   
    >;
39323  38665   
39324  38666   
    fn poll(
39325  38667   
        self: std::pin::Pin<&mut Self>,
39326  38668   
        cx: &mut std::task::Context<'_>,
39327  38669   
    ) -> std::task::Poll<Self::Output> {
39328  38670   
        let this = self.project();
39329  38671   
        this.inner.as_mut().poll(cx)
39330  38672   
    }
39331  38673   
}
39332  38674   
39333  38675   
impl<B>
39334  38676   
    ::aws_smithy_http_server::request::FromRequest<
39335  38677   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39336  38678   
        B,
39337         -
    > for crate::input::HttpPrefixHeadersInResponseInput
       38679  +
    > for crate::input::HttpRequestWithLabelsAndTimestampFormatInput
39338  38680   
where
39339  38681   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39340  38682   
    B: 'static,
39341  38683   
39342  38684   
    B::Data: Send,
39343  38685   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39344  38686   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39345  38687   
{
39346  38688   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39347         -
    type Future = HttpPrefixHeadersInResponseInputFuture;
       38689  +
    type Future = HttpRequestWithLabelsAndTimestampFormatInputFuture;
39348  38690   
39349  38691   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39350  38692   
        let fut = async move {
39351  38693   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39352  38694   
                request.headers(),
39353         -
                &CONTENT_TYPE_HTTPPREFIXHEADERSINRESPONSE,
       38695  +
                &CONTENT_TYPE_HTTPREQUESTWITHLABELSANDTIMESTAMPFORMAT,
39354  38696   
            ) {
39355  38697   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39356  38698   
            }
39357         -
            crate::protocol_serde::shape_http_prefix_headers_in_response::de_http_prefix_headers_in_response_http_request(request)
       38699  +
            crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::de_http_request_with_labels_and_timestamp_format_http_request(request)
39358  38700   
                            .await
39359  38701   
                            .map_err(Into::into)
39360  38702   
        };
39361  38703   
        use ::futures_util::future::TryFutureExt;
39362  38704   
        let fut = fut.map_err(
39363  38705   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39364  38706   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39365  38707   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39366  38708   
                    e,
39367  38709   
                )
39368  38710   
            },
39369  38711   
        );
39370         -
        HttpPrefixHeadersInResponseInputFuture {
       38712  +
        HttpRequestWithLabelsAndTimestampFormatInputFuture {
39371  38713   
            inner: Box::pin(fut),
39372  38714   
        }
39373  38715   
    }
39374  38716   
}
39375  38717   
impl
39376  38718   
    ::aws_smithy_http_server::response::IntoResponse<
39377  38719   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39378         -
    > for crate::output::HttpPrefixHeadersInResponseOutput
       38720  +
    > for crate::output::HttpRequestWithLabelsAndTimestampFormatOutput
39379  38721   
{
39380  38722   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39381         -
        match crate::protocol_serde::shape_http_prefix_headers_in_response::ser_http_prefix_headers_in_response_http_response(self) {
       38723  +
        match crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::ser_http_request_with_labels_and_timestamp_format_http_response(self) {
39382  38724   
                        Ok(response) => response,
39383  38725   
                        Err(e) => {
39384  38726   
                            ::tracing::error!(error = %e, "failed to serialize response");
39385  38727   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39386  38728   
                        }
39387  38729   
                    }
39388  38730   
    }
39389  38731   
}
       38732  +
impl
       38733  +
    ::aws_smithy_http_server::response::IntoResponse<
       38734  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       38735  +
    > for crate::error::HttpRequestWithLabelsAndTimestampFormatError
       38736  +
{
       38737  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       38738  +
        match crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::ser_http_request_with_labels_and_timestamp_format_http_error(&self) {
       38739  +
            Ok(mut response) => {
       38740  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       38741  +
                response
       38742  +
            },
       38743  +
            Err(e) => {
       38744  +
                ::tracing::error!(error = %e, "failed to serialize response");
       38745  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       38746  +
            }
       38747  +
        }
       38748  +
    }
       38749  +
}
39390  38750   
39391         -
const CONTENT_TYPE_HTTPPREFIXHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
       38751  +
#[allow(unreachable_code, unused_variables)]
       38752  +
#[cfg(test)]
       38753  +
mod http_request_with_labels_and_timestamp_format_test {
       38754  +
       38755  +
    /// Serializes different timestamp formats in URI labels
       38756  +
    /// Test ID: RestJsonHttpRequestWithLabelsAndTimestampFormat
       38757  +
    #[::tokio::test]
       38758  +
    #[::tracing_test::traced_test]
       38759  +
    async fn rest_json_http_request_with_labels_and_timestamp_format_request() {
       38760  +
        #[allow(unused_mut)]
       38761  +
                    let mut http_request = http::Request::builder()
       38762  +
                        .uri("/HttpRequestWithLabelsAndTimestampFormat/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z/2019-12-16T23%3A48%3A18Z/1576540098/Mon%2C%2016%20Dec%202019%2023%3A48%3A18%20GMT/2019-12-16T23%3A48%3A18Z")
       38763  +
                        .method("GET")
       38764  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("".as_bytes()))).unwrap();
       38765  +
        #[allow(unused_mut)]
       38766  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       38767  +
        let config = crate::service::RestJsonConfig::builder().build();
       38768  +
        let service =
       38769  +
            crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       38770  +
                .http_request_with_labels_and_timestamp_format(
       38771  +
                    move |input: crate::input::HttpRequestWithLabelsAndTimestampFormatInput| {
       38772  +
                        let sender = sender.clone();
       38773  +
                        async move {
       38774  +
                            let result =
       38775  +
                                {
       38776  +
                                    let expected =
       38777  +
            crate::input::HttpRequestWithLabelsAndTimestampFormatInput {
       38778  +
                member_epoch_seconds:
       38779  +
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
       38780  +
                ,
       38781  +
                member_http_date:
       38782  +
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
       38783  +
                ,
       38784  +
                member_date_time:
       38785  +
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
       38786  +
                ,
       38787  +
                default_format:
       38788  +
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
       38789  +
                ,
       38790  +
                target_epoch_seconds:
       38791  +
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
       38792  +
                ,
       38793  +
                target_http_date:
       38794  +
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
       38795  +
                ,
       38796  +
                target_date_time:
       38797  +
                    ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64)
       38798  +
                ,
       38799  +
            }
       38800  +
        ;
       38801  +
                                    ::pretty_assertions::assert_eq!(input, expected);
       38802  +
                                    let response =
       38803  +
            crate::output::HttpRequestWithLabelsAndTimestampFormatOutput {
       38804  +
            }
       38805  +
        ;
       38806  +
                                    Ok(response)
       38807  +
                                };
       38808  +
                            sender.send(()).await.expect("receiver dropped early");
       38809  +
                            result
       38810  +
                        }
       38811  +
                    },
       38812  +
                )
       38813  +
                .build_unchecked();
       38814  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       38815  +
            .await
       38816  +
            .expect("unable to make an HTTP request");
       38817  +
        assert!(
       38818  +
            receiver.recv().await.is_some(),
       38819  +
            "we expected operation handler to be invoked but it was not entered"
       38820  +
        );
       38821  +
    }
       38822  +
}
       38823  +
       38824  +
const CONTENT_TYPE_HTTPREQUESTWITHLABELS: ::mime::Mime = ::mime::APPLICATION_JSON;
39392  38825   
::pin_project_lite::pin_project! {
39393  38826   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39394         -
    /// [`HttpPrefixHeadersInput`](crate::input::HttpPrefixHeadersInput) using modelled bindings.
39395         -
    pub struct HttpPrefixHeadersInputFuture {
39396         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpPrefixHeadersInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       38827  +
    /// [`HttpRequestWithLabelsInput`](crate::input::HttpRequestWithLabelsInput) using modelled bindings.
       38828  +
    pub struct HttpRequestWithLabelsInputFuture {
       38829  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithLabelsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39397  38830   
    }
39398  38831   
}
39399  38832   
39400         -
impl std::future::Future for HttpPrefixHeadersInputFuture {
       38833  +
impl std::future::Future for HttpRequestWithLabelsInputFuture {
39401  38834   
    type Output = Result<
39402         -
        crate::input::HttpPrefixHeadersInput,
       38835  +
        crate::input::HttpRequestWithLabelsInput,
39403  38836   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39404  38837   
    >;
39405  38838   
39406  38839   
    fn poll(
39407  38840   
        self: std::pin::Pin<&mut Self>,
39408  38841   
        cx: &mut std::task::Context<'_>,
39409  38842   
    ) -> std::task::Poll<Self::Output> {
39410  38843   
        let this = self.project();
39411  38844   
        this.inner.as_mut().poll(cx)
39412  38845   
    }
39413  38846   
}
39414  38847   
39415  38848   
impl<B>
39416  38849   
    ::aws_smithy_http_server::request::FromRequest<
39417  38850   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39418  38851   
        B,
39419         -
    > for crate::input::HttpPrefixHeadersInput
       38852  +
    > for crate::input::HttpRequestWithLabelsInput
39420  38853   
where
39421  38854   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39422  38855   
    B: 'static,
39423  38856   
39424  38857   
    B::Data: Send,
39425  38858   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39426  38859   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39427  38860   
{
39428  38861   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39429         -
    type Future = HttpPrefixHeadersInputFuture;
       38862  +
    type Future = HttpRequestWithLabelsInputFuture;
39430  38863   
39431  38864   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39432  38865   
        let fut = async move {
39433  38866   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39434  38867   
                request.headers(),
39435         -
                &CONTENT_TYPE_HTTPPREFIXHEADERS,
       38868  +
                &CONTENT_TYPE_HTTPREQUESTWITHLABELS,
39436  38869   
            ) {
39437  38870   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39438  38871   
            }
39439         -
            crate::protocol_serde::shape_http_prefix_headers::de_http_prefix_headers_http_request(
39440         -
                request,
39441         -
            )
       38872  +
            crate::protocol_serde::shape_http_request_with_labels::de_http_request_with_labels_http_request(request)
39442  38873   
                            .await
39443  38874   
                            .map_err(Into::into)
39444  38875   
        };
39445  38876   
        use ::futures_util::future::TryFutureExt;
39446  38877   
        let fut = fut.map_err(
39447  38878   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39448  38879   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39449  38880   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39450  38881   
                    e,
39451  38882   
                )
39452  38883   
            },
39453  38884   
        );
39454         -
        HttpPrefixHeadersInputFuture {
       38885  +
        HttpRequestWithLabelsInputFuture {
39455  38886   
            inner: Box::pin(fut),
39456  38887   
        }
39457  38888   
    }
39458  38889   
}
39459  38890   
impl
39460  38891   
    ::aws_smithy_http_server::response::IntoResponse<
39461  38892   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39462         -
    > for crate::output::HttpPrefixHeadersOutput
       38893  +
    > for crate::output::HttpRequestWithLabelsOutput
39463  38894   
{
39464  38895   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39465         -
        match crate::protocol_serde::shape_http_prefix_headers::ser_http_prefix_headers_http_response(self) {
       38896  +
        match crate::protocol_serde::shape_http_request_with_labels::ser_http_request_with_labels_http_response(self) {
39466  38897   
                        Ok(response) => response,
39467  38898   
                        Err(e) => {
39468  38899   
                            ::tracing::error!(error = %e, "failed to serialize response");
39469  38900   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39470  38901   
                        }
39471  38902   
                    }
39472  38903   
    }
39473  38904   
}
       38905  +
impl
       38906  +
    ::aws_smithy_http_server::response::IntoResponse<
       38907  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       38908  +
    > for crate::error::HttpRequestWithLabelsError
       38909  +
{
       38910  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       38911  +
        match crate::protocol_serde::shape_http_request_with_labels::ser_http_request_with_labels_http_error(&self) {
       38912  +
            Ok(mut response) => {
       38913  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       38914  +
                response
       38915  +
            },
       38916  +
            Err(e) => {
       38917  +
                ::tracing::error!(error = %e, "failed to serialize response");
       38918  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       38919  +
            }
       38920  +
        }
       38921  +
    }
       38922  +
}
39474  38923   
39475         -
const CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP: ::mime::Mime = ::mime::APPLICATION_JSON;
       38924  +
#[allow(unreachable_code, unused_variables)]
       38925  +
#[cfg(test)]
       38926  +
mod http_request_with_labels_test {
       38927  +
       38928  +
    /// Sends a GET request that uses URI label bindings
       38929  +
    /// Test ID: RestJsonInputWithHeadersAndAllParams
       38930  +
    #[::tokio::test]
       38931  +
    #[::tracing_test::traced_test]
       38932  +
    async fn rest_json_input_with_headers_and_all_params_request() {
       38933  +
        #[allow(unused_mut)]
       38934  +
        let mut http_request = http::Request::builder()
       38935  +
            .uri("/HttpRequestWithLabels/string/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z")
       38936  +
            .method("GET")
       38937  +
            .body(::aws_smithy_http_server::body::Body::from(
       38938  +
                ::bytes::Bytes::from_static("".as_bytes()),
       38939  +
            ))
       38940  +
            .unwrap();
       38941  +
        #[allow(unused_mut)]
       38942  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       38943  +
        let config = crate::service::RestJsonConfig::builder().build();
       38944  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       38945  +
            .http_request_with_labels(move |input: crate::input::HttpRequestWithLabelsInput| {
       38946  +
                let sender = sender.clone();
       38947  +
                async move {
       38948  +
                    let result = {
       38949  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       38950  +
                        let expected = crate::input::HttpRequestWithLabelsInput {
       38951  +
                            string: "string".to_owned(),
       38952  +
                            short: 1,
       38953  +
                            integer: 2,
       38954  +
                            long: 3,
       38955  +
                            float: 4.1_f32,
       38956  +
                            double: 5.1_f64,
       38957  +
                            boolean: true,
       38958  +
                            timestamp: ::aws_smithy_types::DateTime::from_fractional_secs(
       38959  +
                                1576540098, 0_f64,
       38960  +
                            ),
       38961  +
                        };
       38962  +
                        ::pretty_assertions::assert_eq!(
       38963  +
                            input.string,
       38964  +
                            expected.string,
       38965  +
                            "Unexpected value for `string`"
       38966  +
                        );
       38967  +
                        ::pretty_assertions::assert_eq!(
       38968  +
                            input.short,
       38969  +
                            expected.short,
       38970  +
                            "Unexpected value for `short`"
       38971  +
                        );
       38972  +
                        ::pretty_assertions::assert_eq!(
       38973  +
                            input.integer,
       38974  +
                            expected.integer,
       38975  +
                            "Unexpected value for `integer`"
       38976  +
                        );
       38977  +
                        ::pretty_assertions::assert_eq!(
       38978  +
                            input.long,
       38979  +
                            expected.long,
       38980  +
                            "Unexpected value for `long`"
       38981  +
                        );
       38982  +
                        assert!(
       38983  +
                            input.float.float_equals(&expected.float),
       38984  +
                            "Unexpected value for `float` {:?} vs. {:?}",
       38985  +
                            expected.float,
       38986  +
                            input.float
       38987  +
                        );
       38988  +
                        assert!(
       38989  +
                            input.double.float_equals(&expected.double),
       38990  +
                            "Unexpected value for `double` {:?} vs. {:?}",
       38991  +
                            expected.double,
       38992  +
                            input.double
       38993  +
                        );
       38994  +
                        ::pretty_assertions::assert_eq!(
       38995  +
                            input.boolean,
       38996  +
                            expected.boolean,
       38997  +
                            "Unexpected value for `boolean`"
       38998  +
                        );
       38999  +
                        ::pretty_assertions::assert_eq!(
       39000  +
                            input.timestamp,
       39001  +
                            expected.timestamp,
       39002  +
                            "Unexpected value for `timestamp`"
       39003  +
                        );
       39004  +
                        let response = crate::output::HttpRequestWithLabelsOutput {};
       39005  +
                        Ok(response)
       39006  +
                    };
       39007  +
                    sender.send(()).await.expect("receiver dropped early");
       39008  +
                    result
       39009  +
                }
       39010  +
            })
       39011  +
            .build_unchecked();
       39012  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       39013  +
            .await
       39014  +
            .expect("unable to make an HTTP request");
       39015  +
        assert!(
       39016  +
            receiver.recv().await.is_some(),
       39017  +
            "we expected operation handler to be invoked but it was not entered"
       39018  +
        );
       39019  +
    }
       39020  +
    /// Sends a GET request that uses URI label bindings
       39021  +
    /// Test ID: RestJsonHttpRequestLabelEscaping
       39022  +
    #[::tokio::test]
       39023  +
    #[::tracing_test::traced_test]
       39024  +
    async fn rest_json_http_request_label_escaping_request() {
       39025  +
        #[allow(unused_mut)]
       39026  +
                    let mut http_request = http::Request::builder()
       39027  +
                        .uri("/HttpRequestWithLabels/%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9/1/2/3/4.1/5.1/true/2019-12-16T23%3A48%3A18Z")
       39028  +
                        .method("GET")
       39029  +
        .body(::aws_smithy_http_server::body::Body::from(::bytes::Bytes::from_static("".as_bytes()))).unwrap();
       39030  +
        #[allow(unused_mut)]
       39031  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       39032  +
        let config = crate::service::RestJsonConfig::builder().build();
       39033  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       39034  +
            .http_request_with_labels(move |input: crate::input::HttpRequestWithLabelsInput| {
       39035  +
                let sender = sender.clone();
       39036  +
                async move {
       39037  +
                    let result = {
       39038  +
                        use ::aws_smithy_protocol_test::FloatEquals;
       39039  +
                        let expected = crate::input::HttpRequestWithLabelsInput {
       39040  +
                            string: " %:/?#[]@!$&'()*+,;=😹".to_owned(),
       39041  +
                            short: 1,
       39042  +
                            integer: 2,
       39043  +
                            long: 3,
       39044  +
                            float: 4.1_f32,
       39045  +
                            double: 5.1_f64,
       39046  +
                            boolean: true,
       39047  +
                            timestamp: ::aws_smithy_types::DateTime::from_fractional_secs(
       39048  +
                                1576540098, 0_f64,
       39049  +
                            ),
       39050  +
                        };
       39051  +
                        ::pretty_assertions::assert_eq!(
       39052  +
                            input.string,
       39053  +
                            expected.string,
       39054  +
                            "Unexpected value for `string`"
       39055  +
                        );
       39056  +
                        ::pretty_assertions::assert_eq!(
       39057  +
                            input.short,
       39058  +
                            expected.short,
       39059  +
                            "Unexpected value for `short`"
       39060  +
                        );
       39061  +
                        ::pretty_assertions::assert_eq!(
       39062  +
                            input.integer,
       39063  +
                            expected.integer,
       39064  +
                            "Unexpected value for `integer`"
       39065  +
                        );
       39066  +
                        ::pretty_assertions::assert_eq!(
       39067  +
                            input.long,
       39068  +
                            expected.long,
       39069  +
                            "Unexpected value for `long`"
       39070  +
                        );
       39071  +
                        assert!(
       39072  +
                            input.float.float_equals(&expected.float),
       39073  +
                            "Unexpected value for `float` {:?} vs. {:?}",
       39074  +
                            expected.float,
       39075  +
                            input.float
       39076  +
                        );
       39077  +
                        assert!(
       39078  +
                            input.double.float_equals(&expected.double),
       39079  +
                            "Unexpected value for `double` {:?} vs. {:?}",
       39080  +
                            expected.double,
       39081  +
                            input.double
       39082  +
                        );
       39083  +
                        ::pretty_assertions::assert_eq!(
       39084  +
                            input.boolean,
       39085  +
                            expected.boolean,
       39086  +
                            "Unexpected value for `boolean`"
       39087  +
                        );
       39088  +
                        ::pretty_assertions::assert_eq!(
       39089  +
                            input.timestamp,
       39090  +
                            expected.timestamp,
       39091  +
                            "Unexpected value for `timestamp`"
       39092  +
                        );
       39093  +
                        let response = crate::output::HttpRequestWithLabelsOutput {};
       39094  +
                        Ok(response)
       39095  +
                    };
       39096  +
                    sender.send(()).await.expect("receiver dropped early");
       39097  +
                    result
       39098  +
                }
       39099  +
            })
       39100  +
            .build_unchecked();
       39101  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       39102  +
            .await
       39103  +
            .expect("unable to make an HTTP request");
       39104  +
        assert!(
       39105  +
            receiver.recv().await.is_some(),
       39106  +
            "we expected operation handler to be invoked but it was not entered"
       39107  +
        );
       39108  +
    }
       39109  +
}
       39110  +
       39111  +
const CONTENT_TYPE_MEDIATYPEHEADER: ::mime::Mime = ::mime::APPLICATION_JSON;
39476  39112   
::pin_project_lite::pin_project! {
39477  39113   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39478         -
    /// [`QueryParamsAsStringListMapInput`](crate::input::QueryParamsAsStringListMapInput) using modelled bindings.
39479         -
    pub struct QueryParamsAsStringListMapInputFuture {
39480         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::QueryParamsAsStringListMapInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       39114  +
    /// [`MediaTypeHeaderInput`](crate::input::MediaTypeHeaderInput) using modelled bindings.
       39115  +
    pub struct MediaTypeHeaderInputFuture {
       39116  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MediaTypeHeaderInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39481  39117   
    }
39482  39118   
}
39483  39119   
39484         -
impl std::future::Future for QueryParamsAsStringListMapInputFuture {
       39120  +
impl std::future::Future for MediaTypeHeaderInputFuture {
39485  39121   
    type Output = Result<
39486         -
        crate::input::QueryParamsAsStringListMapInput,
       39122  +
        crate::input::MediaTypeHeaderInput,
39487  39123   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39488  39124   
    >;
39489  39125   
39490  39126   
    fn poll(
39491  39127   
        self: std::pin::Pin<&mut Self>,
39492  39128   
        cx: &mut std::task::Context<'_>,
39493  39129   
    ) -> std::task::Poll<Self::Output> {
39494  39130   
        let this = self.project();
39495  39131   
        this.inner.as_mut().poll(cx)
39496  39132   
    }
39497  39133   
}
39498  39134   
39499  39135   
impl<B>
39500  39136   
    ::aws_smithy_http_server::request::FromRequest<
39501  39137   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39502  39138   
        B,
39503         -
    > for crate::input::QueryParamsAsStringListMapInput
       39139  +
    > for crate::input::MediaTypeHeaderInput
39504  39140   
where
39505  39141   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39506  39142   
    B: 'static,
39507  39143   
39508  39144   
    B::Data: Send,
39509  39145   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39510  39146   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39511  39147   
{
39512  39148   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39513         -
    type Future = QueryParamsAsStringListMapInputFuture;
       39149  +
    type Future = MediaTypeHeaderInputFuture;
39514  39150   
39515  39151   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39516  39152   
        let fut = async move {
39517  39153   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39518  39154   
                request.headers(),
39519         -
                &CONTENT_TYPE_QUERYPARAMSASSTRINGLISTMAP,
       39155  +
                &CONTENT_TYPE_MEDIATYPEHEADER,
39520  39156   
            ) {
39521  39157   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39522  39158   
            }
39523         -
            crate::protocol_serde::shape_query_params_as_string_list_map::de_query_params_as_string_list_map_http_request(request)
       39159  +
            crate::protocol_serde::shape_media_type_header::de_media_type_header_http_request(
       39160  +
                request,
       39161  +
            )
39524  39162   
            .await
39525  39163   
            .map_err(Into::into)
39526  39164   
        };
39527  39165   
        use ::futures_util::future::TryFutureExt;
39528  39166   
        let fut = fut.map_err(
39529  39167   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39530  39168   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39531  39169   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39532  39170   
                    e,
39533  39171   
                )
39534  39172   
            },
39535  39173   
        );
39536         -
        QueryParamsAsStringListMapInputFuture {
       39174  +
        MediaTypeHeaderInputFuture {
39537  39175   
            inner: Box::pin(fut),
39538  39176   
        }
39539  39177   
    }
39540  39178   
}
39541  39179   
impl
39542  39180   
    ::aws_smithy_http_server::response::IntoResponse<
39543  39181   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39544         -
    > for crate::output::QueryParamsAsStringListMapOutput
       39182  +
    > for crate::output::MediaTypeHeaderOutput
39545  39183   
{
39546  39184   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39547         -
        match crate::protocol_serde::shape_query_params_as_string_list_map::ser_query_params_as_string_list_map_http_response(self) {
       39185  +
        match crate::protocol_serde::shape_media_type_header::ser_media_type_header_http_response(
       39186  +
            self,
       39187  +
        ) {
39548  39188   
            Ok(response) => response,
39549  39189   
            Err(e) => {
39550  39190   
                ::tracing::error!(error = %e, "failed to serialize response");
39551  39191   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39552  39192   
            }
39553  39193   
        }
39554  39194   
    }
39555  39195   
}
39556  39196   
39557         -
const CONTENT_TYPE_QUERYPRECEDENCE: ::mime::Mime = ::mime::APPLICATION_JSON;
       39197  +
#[allow(unreachable_code, unused_variables)]
       39198  +
#[cfg(test)]
       39199  +
mod media_type_header_test {
       39200  +
       39201  +
    /// Headers that target strings with a mediaType are base64 encoded
       39202  +
    /// Test ID: MediaTypeHeaderInputBase64
       39203  +
    #[::tokio::test]
       39204  +
    #[::tracing_test::traced_test]
       39205  +
    async fn media_type_header_input_base64_request() {
       39206  +
        #[allow(unused_mut)]
       39207  +
        let mut http_request = http::Request::builder()
       39208  +
            .uri("/MediaTypeHeader")
       39209  +
            .method("GET")
       39210  +
            .header("X-Json", "dHJ1ZQ==")
       39211  +
            .body(::aws_smithy_http_server::body::Body::from(
       39212  +
                ::bytes::Bytes::from_static("".as_bytes()),
       39213  +
            ))
       39214  +
            .unwrap();
       39215  +
        #[allow(unused_mut)]
       39216  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       39217  +
        let config = crate::service::RestJsonConfig::builder().build();
       39218  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       39219  +
            .media_type_header(move |input: crate::input::MediaTypeHeaderInput| {
       39220  +
                let sender = sender.clone();
       39221  +
                async move {
       39222  +
                    let result = {
       39223  +
                        let expected = crate::input::MediaTypeHeaderInput {
       39224  +
                            json: ::std::option::Option::Some("true".to_owned()),
       39225  +
                        };
       39226  +
                        ::pretty_assertions::assert_eq!(input, expected);
       39227  +
                        let response = crate::output::MediaTypeHeaderOutput {
       39228  +
                            json: ::std::option::Option::None,
       39229  +
                        };
       39230  +
                        response
       39231  +
                    };
       39232  +
                    sender.send(()).await.expect("receiver dropped early");
       39233  +
                    result
       39234  +
                }
       39235  +
            })
       39236  +
            .build_unchecked();
       39237  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       39238  +
            .await
       39239  +
            .expect("unable to make an HTTP request");
       39240  +
        assert!(
       39241  +
            receiver.recv().await.is_some(),
       39242  +
            "we expected operation handler to be invoked but it was not entered"
       39243  +
        );
       39244  +
    }
       39245  +
    /// Headers that target strings with a mediaType are base64 encoded
       39246  +
    /// Test ID: MediaTypeHeaderOutputBase64
       39247  +
    #[::tokio::test]
       39248  +
    #[::tracing_test::traced_test]
       39249  +
    async fn media_type_header_output_base64_response() {
       39250  +
        let output = crate::output::MediaTypeHeaderOutput {
       39251  +
            json: ::std::option::Option::Some("true".to_owned()),
       39252  +
        };
       39253  +
        use ::aws_smithy_http_server::response::IntoResponse;
       39254  +
        let http_response = output.into_response();
       39255  +
        ::pretty_assertions::assert_eq!(
       39256  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       39257  +
            http_response.status()
       39258  +
        );
       39259  +
        let expected_headers = [("X-Json", "dHJ1ZQ==")];
       39260  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       39261  +
            http_response.headers(),
       39262  +
            expected_headers,
       39263  +
        ));
       39264  +
    }
       39265  +
}
       39266  +
       39267  +
const CONTENT_TYPE_TIMESTAMPFORMATHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
39558  39268   
::pin_project_lite::pin_project! {
39559  39269   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39560         -
    /// [`QueryPrecedenceInput`](crate::input::QueryPrecedenceInput) using modelled bindings.
39561         -
    pub struct QueryPrecedenceInputFuture {
39562         -
        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>>
       39270  +
    /// [`TimestampFormatHeadersInput`](crate::input::TimestampFormatHeadersInput) using modelled bindings.
       39271  +
    pub struct TimestampFormatHeadersInputFuture {
       39272  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TimestampFormatHeadersInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39563  39273   
    }
39564  39274   
}
39565  39275   
39566         -
impl std::future::Future for QueryPrecedenceInputFuture {
       39276  +
impl std::future::Future for TimestampFormatHeadersInputFuture {
39567  39277   
    type Output = Result<
39568         -
        crate::input::QueryPrecedenceInput,
       39278  +
        crate::input::TimestampFormatHeadersInput,
39569  39279   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39570  39280   
    >;
39571  39281   
39572  39282   
    fn poll(
39573  39283   
        self: std::pin::Pin<&mut Self>,
39574  39284   
        cx: &mut std::task::Context<'_>,
39575  39285   
    ) -> std::task::Poll<Self::Output> {
39576  39286   
        let this = self.project();
39577  39287   
        this.inner.as_mut().poll(cx)
39578  39288   
    }
39579  39289   
}
39580  39290   
39581  39291   
impl<B>
39582  39292   
    ::aws_smithy_http_server::request::FromRequest<
39583  39293   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39584  39294   
        B,
39585         -
    > for crate::input::QueryPrecedenceInput
       39295  +
    > for crate::input::TimestampFormatHeadersInput
39586  39296   
where
39587  39297   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39588  39298   
    B: 'static,
39589  39299   
39590  39300   
    B::Data: Send,
39591  39301   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39592  39302   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39593  39303   
{
39594  39304   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39595         -
    type Future = QueryPrecedenceInputFuture;
       39305  +
    type Future = TimestampFormatHeadersInputFuture;
39596  39306   
39597  39307   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39598  39308   
        let fut = async move {
39599  39309   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39600  39310   
                request.headers(),
39601         -
                &CONTENT_TYPE_QUERYPRECEDENCE,
       39311  +
                &CONTENT_TYPE_TIMESTAMPFORMATHEADERS,
39602  39312   
            ) {
39603  39313   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39604  39314   
            }
39605         -
            crate::protocol_serde::shape_query_precedence::de_query_precedence_http_request(request)
       39315  +
            crate::protocol_serde::shape_timestamp_format_headers::de_timestamp_format_headers_http_request(request)
39606  39316   
                            .await
39607  39317   
                            .map_err(Into::into)
39608  39318   
        };
39609  39319   
        use ::futures_util::future::TryFutureExt;
39610  39320   
        let fut = fut.map_err(
39611  39321   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39612  39322   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39613  39323   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39614  39324   
                    e,
39615  39325   
                )
39616  39326   
            },
39617  39327   
        );
39618         -
        QueryPrecedenceInputFuture {
       39328  +
        TimestampFormatHeadersInputFuture {
39619  39329   
            inner: Box::pin(fut),
39620  39330   
        }
39621  39331   
    }
39622  39332   
}
39623  39333   
impl
39624  39334   
    ::aws_smithy_http_server::response::IntoResponse<
39625  39335   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39626         -
    > for crate::output::QueryPrecedenceOutput
       39336  +
    > for crate::output::TimestampFormatHeadersOutput
39627  39337   
{
39628  39338   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39629         -
        match crate::protocol_serde::shape_query_precedence::ser_query_precedence_http_response(
39630         -
            self,
39631         -
        ) {
       39339  +
        match crate::protocol_serde::shape_timestamp_format_headers::ser_timestamp_format_headers_http_response(self) {
39632  39340   
                        Ok(response) => response,
39633  39341   
                        Err(e) => {
39634  39342   
                            ::tracing::error!(error = %e, "failed to serialize response");
39635  39343   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39636  39344   
                        }
39637  39345   
                    }
39638  39346   
    }
39639  39347   
}
39640  39348   
39641         -
const CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL: ::mime::Mime = ::mime::APPLICATION_JSON;
       39349  +
#[allow(unreachable_code, unused_variables)]
       39350  +
#[cfg(test)]
       39351  +
mod timestamp_format_headers_test {
       39352  +
       39353  +
    /// Tests how timestamp request headers are serialized
       39354  +
    /// Test ID: RestJsonTimestampFormatHeaders
       39355  +
    #[::tokio::test]
       39356  +
    #[::tracing_test::traced_test]
       39357  +
    async fn rest_json_timestamp_format_headers_request() {
       39358  +
        #[allow(unused_mut)]
       39359  +
        let mut http_request = http::Request::builder()
       39360  +
            .uri("/TimestampFormatHeaders")
       39361  +
            .method("POST")
       39362  +
            .header("X-defaultFormat", "Mon, 16 Dec 2019 23:48:18 GMT")
       39363  +
            .header("X-memberDateTime", "2019-12-16T23:48:18Z")
       39364  +
            .header("X-memberEpochSeconds", "1576540098")
       39365  +
            .header("X-memberHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT")
       39366  +
            .header("X-targetDateTime", "2019-12-16T23:48:18Z")
       39367  +
            .header("X-targetEpochSeconds", "1576540098")
       39368  +
            .header("X-targetHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT")
       39369  +
            .body(::aws_smithy_http_server::body::Body::from(
       39370  +
                ::bytes::Bytes::from_static("".as_bytes()),
       39371  +
            ))
       39372  +
            .unwrap();
       39373  +
        #[allow(unused_mut)]
       39374  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       39375  +
        let config = crate::service::RestJsonConfig::builder().build();
       39376  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       39377  +
            .timestamp_format_headers(move |input: crate::input::TimestampFormatHeadersInput| {
       39378  +
                let sender = sender.clone();
       39379  +
                async move {
       39380  +
                    let result = {
       39381  +
                        let expected = crate::input::TimestampFormatHeadersInput {
       39382  +
                            member_epoch_seconds: ::std::option::Option::Some(
       39383  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       39384  +
                                    1576540098, 0_f64,
       39385  +
                                ),
       39386  +
                            ),
       39387  +
                            member_http_date: ::std::option::Option::Some(
       39388  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       39389  +
                                    1576540098, 0_f64,
       39390  +
                                ),
       39391  +
                            ),
       39392  +
                            member_date_time: ::std::option::Option::Some(
       39393  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       39394  +
                                    1576540098, 0_f64,
       39395  +
                                ),
       39396  +
                            ),
       39397  +
                            default_format: ::std::option::Option::Some(
       39398  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       39399  +
                                    1576540098, 0_f64,
       39400  +
                                ),
       39401  +
                            ),
       39402  +
                            target_epoch_seconds: ::std::option::Option::Some(
       39403  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       39404  +
                                    1576540098, 0_f64,
       39405  +
                                ),
       39406  +
                            ),
       39407  +
                            target_http_date: ::std::option::Option::Some(
       39408  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       39409  +
                                    1576540098, 0_f64,
       39410  +
                                ),
       39411  +
                            ),
       39412  +
                            target_date_time: ::std::option::Option::Some(
       39413  +
                                ::aws_smithy_types::DateTime::from_fractional_secs(
       39414  +
                                    1576540098, 0_f64,
       39415  +
                                ),
       39416  +
                            ),
       39417  +
                        };
       39418  +
                        ::pretty_assertions::assert_eq!(input, expected);
       39419  +
                        let response = crate::output::TimestampFormatHeadersOutput {
       39420  +
                            member_epoch_seconds: ::std::option::Option::None,
       39421  +
                            member_http_date: ::std::option::Option::None,
       39422  +
                            member_date_time: ::std::option::Option::None,
       39423  +
                            default_format: ::std::option::Option::None,
       39424  +
                            target_epoch_seconds: ::std::option::Option::None,
       39425  +
                            target_http_date: ::std::option::Option::None,
       39426  +
                            target_date_time: ::std::option::Option::None,
       39427  +
                        };
       39428  +
                        response
       39429  +
                    };
       39430  +
                    sender.send(()).await.expect("receiver dropped early");
       39431  +
                    result
       39432  +
                }
       39433  +
            })
       39434  +
            .build_unchecked();
       39435  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       39436  +
            .await
       39437  +
            .expect("unable to make an HTTP request");
       39438  +
        assert!(
       39439  +
            receiver.recv().await.is_some(),
       39440  +
            "we expected operation handler to be invoked but it was not entered"
       39441  +
        );
       39442  +
    }
       39443  +
    /// Tests how timestamp response headers are serialized
       39444  +
    /// Test ID: RestJsonTimestampFormatHeaders
       39445  +
    #[::tokio::test]
       39446  +
    #[::tracing_test::traced_test]
       39447  +
    async fn rest_json_timestamp_format_headers_response() {
       39448  +
        let output = crate::output::TimestampFormatHeadersOutput {
       39449  +
            member_epoch_seconds: ::std::option::Option::Some(
       39450  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       39451  +
            ),
       39452  +
            member_http_date: ::std::option::Option::Some(
       39453  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       39454  +
            ),
       39455  +
            member_date_time: ::std::option::Option::Some(
       39456  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       39457  +
            ),
       39458  +
            default_format: ::std::option::Option::Some(
       39459  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       39460  +
            ),
       39461  +
            target_epoch_seconds: ::std::option::Option::Some(
       39462  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       39463  +
            ),
       39464  +
            target_http_date: ::std::option::Option::Some(
       39465  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       39466  +
            ),
       39467  +
            target_date_time: ::std::option::Option::Some(
       39468  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       39469  +
            ),
       39470  +
        };
       39471  +
        use ::aws_smithy_http_server::response::IntoResponse;
       39472  +
        let http_response = output.into_response();
       39473  +
        ::pretty_assertions::assert_eq!(
       39474  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       39475  +
            http_response.status()
       39476  +
        );
       39477  +
        let expected_headers = [
       39478  +
            ("X-defaultFormat", "Mon, 16 Dec 2019 23:48:18 GMT"),
       39479  +
            ("X-memberDateTime", "2019-12-16T23:48:18Z"),
       39480  +
            ("X-memberEpochSeconds", "1576540098"),
       39481  +
            ("X-memberHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT"),
       39482  +
            ("X-targetDateTime", "2019-12-16T23:48:18Z"),
       39483  +
            ("X-targetEpochSeconds", "1576540098"),
       39484  +
            ("X-targetHttpDate", "Mon, 16 Dec 2019 23:48:18 GMT"),
       39485  +
        ];
       39486  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       39487  +
            http_response.headers(),
       39488  +
            expected_headers,
       39489  +
        ));
       39490  +
    }
       39491  +
}
       39492  +
       39493  +
const CONTENT_TYPE_NULLANDEMPTYHEADERSSERVER: ::mime::Mime = ::mime::APPLICATION_JSON;
39642  39494   
::pin_project_lite::pin_project! {
39643  39495   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39644         -
    /// [`QueryIdempotencyTokenAutoFillInput`](crate::input::QueryIdempotencyTokenAutoFillInput) using modelled bindings.
39645         -
    pub struct QueryIdempotencyTokenAutoFillInputFuture {
39646         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::QueryIdempotencyTokenAutoFillInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       39496  +
    /// [`NullAndEmptyHeadersServerInput`](crate::input::NullAndEmptyHeadersServerInput) using modelled bindings.
       39497  +
    pub struct NullAndEmptyHeadersServerInputFuture {
       39498  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::NullAndEmptyHeadersServerInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39647  39499   
    }
39648  39500   
}
39649  39501   
39650         -
impl std::future::Future for QueryIdempotencyTokenAutoFillInputFuture {
       39502  +
impl std::future::Future for NullAndEmptyHeadersServerInputFuture {
39651  39503   
    type Output = Result<
39652         -
        crate::input::QueryIdempotencyTokenAutoFillInput,
       39504  +
        crate::input::NullAndEmptyHeadersServerInput,
39653  39505   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39654  39506   
    >;
39655  39507   
39656  39508   
    fn poll(
39657  39509   
        self: std::pin::Pin<&mut Self>,
39658  39510   
        cx: &mut std::task::Context<'_>,
39659  39511   
    ) -> std::task::Poll<Self::Output> {
39660  39512   
        let this = self.project();
39661  39513   
        this.inner.as_mut().poll(cx)
39662  39514   
    }
39663  39515   
}
39664  39516   
39665  39517   
impl<B>
39666  39518   
    ::aws_smithy_http_server::request::FromRequest<
39667  39519   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39668  39520   
        B,
39669         -
    > for crate::input::QueryIdempotencyTokenAutoFillInput
       39521  +
    > for crate::input::NullAndEmptyHeadersServerInput
39670  39522   
where
39671  39523   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39672  39524   
    B: 'static,
39673  39525   
39674  39526   
    B::Data: Send,
39675  39527   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39676  39528   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39677  39529   
{
39678  39530   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39679         -
    type Future = QueryIdempotencyTokenAutoFillInputFuture;
       39531  +
    type Future = NullAndEmptyHeadersServerInputFuture;
39680  39532   
39681  39533   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39682  39534   
        let fut = async move {
39683  39535   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39684  39536   
                request.headers(),
39685         -
                &CONTENT_TYPE_QUERYIDEMPOTENCYTOKENAUTOFILL,
       39537  +
                &CONTENT_TYPE_NULLANDEMPTYHEADERSSERVER,
39686  39538   
            ) {
39687  39539   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39688  39540   
            }
39689         -
            crate::protocol_serde::shape_query_idempotency_token_auto_fill::de_query_idempotency_token_auto_fill_http_request(request)
       39541  +
            crate::protocol_serde::shape_null_and_empty_headers_server::de_null_and_empty_headers_server_http_request(request)
39690  39542   
                            .await
39691  39543   
                            .map_err(Into::into)
39692  39544   
        };
39693  39545   
        use ::futures_util::future::TryFutureExt;
39694  39546   
        let fut = fut.map_err(
39695  39547   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39696  39548   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39697  39549   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39698  39550   
                    e,
39699  39551   
                )
39700  39552   
            },
39701  39553   
        );
39702         -
        QueryIdempotencyTokenAutoFillInputFuture {
       39554  +
        NullAndEmptyHeadersServerInputFuture {
39703  39555   
            inner: Box::pin(fut),
39704  39556   
        }
39705  39557   
    }
39706  39558   
}
39707  39559   
impl
39708  39560   
    ::aws_smithy_http_server::response::IntoResponse<
39709  39561   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39710         -
    > for crate::output::QueryIdempotencyTokenAutoFillOutput
       39562  +
    > for crate::output::NullAndEmptyHeadersServerOutput
39711  39563   
{
39712  39564   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39713         -
        match crate::protocol_serde::shape_query_idempotency_token_auto_fill::ser_query_idempotency_token_auto_fill_http_response(self) {
       39565  +
        match crate::protocol_serde::shape_null_and_empty_headers_server::ser_null_and_empty_headers_server_http_response(self) {
39714  39566   
                        Ok(response) => response,
39715  39567   
                        Err(e) => {
39716  39568   
                            ::tracing::error!(error = %e, "failed to serialize response");
39717  39569   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39718  39570   
                        }
39719  39571   
                    }
39720  39572   
    }
39721  39573   
}
39722  39574   
39723         -
const CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS: ::mime::Mime = ::mime::APPLICATION_JSON;
       39575  +
#[allow(unreachable_code, unused_variables)]
       39576  +
#[cfg(test)]
       39577  +
mod null_and_empty_headers_server_test {
       39578  +
       39579  +
    /// Do not send null or empty headers
       39580  +
    /// Test ID: RestJsonNullAndEmptyHeaders
       39581  +
    #[::tokio::test]
       39582  +
    #[::tracing_test::traced_test]
       39583  +
    async fn rest_json_null_and_empty_headers_response() {
       39584  +
        let output = crate::output::NullAndEmptyHeadersServerOutput {
       39585  +
            a: ::std::option::Option::None,
       39586  +
            b: ::std::option::Option::Some("".to_owned()),
       39587  +
            c: ::std::option::Option::Some(vec![]),
       39588  +
        };
       39589  +
        use ::aws_smithy_http_server::response::IntoResponse;
       39590  +
        let http_response = output.into_response();
       39591  +
        ::pretty_assertions::assert_eq!(
       39592  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       39593  +
            http_response.status()
       39594  +
        );
       39595  +
        let forbidden_headers = &["X-A", "X-B", "X-C"];
       39596  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::forbid_headers(
       39597  +
            http_response.headers(),
       39598  +
            forbidden_headers,
       39599  +
        ));
       39600  +
    }
       39601  +
}
       39602  +
       39603  +
const CONTENT_TYPE_NULLANDEMPTYHEADERSCLIENT: ::mime::Mime = ::mime::APPLICATION_JSON;
39724  39604   
::pin_project_lite::pin_project! {
39725  39605   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39726         -
    /// [`OmitsSerializingEmptyListsInput`](crate::input::OmitsSerializingEmptyListsInput) using modelled bindings.
39727         -
    pub struct OmitsSerializingEmptyListsInputFuture {
39728         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OmitsSerializingEmptyListsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       39606  +
    /// [`NullAndEmptyHeadersClientInput`](crate::input::NullAndEmptyHeadersClientInput) using modelled bindings.
       39607  +
    pub struct NullAndEmptyHeadersClientInputFuture {
       39608  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::NullAndEmptyHeadersClientInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39729  39609   
    }
39730  39610   
}
39731  39611   
39732         -
impl std::future::Future for OmitsSerializingEmptyListsInputFuture {
       39612  +
impl std::future::Future for NullAndEmptyHeadersClientInputFuture {
39733  39613   
    type Output = Result<
39734         -
        crate::input::OmitsSerializingEmptyListsInput,
       39614  +
        crate::input::NullAndEmptyHeadersClientInput,
39735  39615   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39736  39616   
    >;
39737  39617   
39738  39618   
    fn poll(
39739  39619   
        self: std::pin::Pin<&mut Self>,
39740  39620   
        cx: &mut std::task::Context<'_>,
39741  39621   
    ) -> std::task::Poll<Self::Output> {
39742  39622   
        let this = self.project();
39743  39623   
        this.inner.as_mut().poll(cx)
39744  39624   
    }
39745  39625   
}
39746  39626   
39747  39627   
impl<B>
39748  39628   
    ::aws_smithy_http_server::request::FromRequest<
39749  39629   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39750  39630   
        B,
39751         -
    > for crate::input::OmitsSerializingEmptyListsInput
       39631  +
    > for crate::input::NullAndEmptyHeadersClientInput
39752  39632   
where
39753  39633   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39754  39634   
    B: 'static,
39755  39635   
39756  39636   
    B::Data: Send,
39757  39637   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39758  39638   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39759  39639   
{
39760  39640   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39761         -
    type Future = OmitsSerializingEmptyListsInputFuture;
       39641  +
    type Future = NullAndEmptyHeadersClientInputFuture;
39762  39642   
39763  39643   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39764  39644   
        let fut = async move {
39765  39645   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39766  39646   
                request.headers(),
39767         -
                &CONTENT_TYPE_OMITSSERIALIZINGEMPTYLISTS,
       39647  +
                &CONTENT_TYPE_NULLANDEMPTYHEADERSCLIENT,
39768  39648   
            ) {
39769  39649   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39770  39650   
            }
39771         -
            crate::protocol_serde::shape_omits_serializing_empty_lists::de_omits_serializing_empty_lists_http_request(request)
       39651  +
            crate::protocol_serde::shape_null_and_empty_headers_client::de_null_and_empty_headers_client_http_request(request)
39772  39652   
                            .await
39773  39653   
                            .map_err(Into::into)
39774  39654   
        };
39775  39655   
        use ::futures_util::future::TryFutureExt;
39776  39656   
        let fut = fut.map_err(
39777  39657   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39778  39658   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39779  39659   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39780  39660   
                    e,
39781  39661   
                )
39782  39662   
            },
39783  39663   
        );
39784         -
        OmitsSerializingEmptyListsInputFuture {
       39664  +
        NullAndEmptyHeadersClientInputFuture {
39785  39665   
            inner: Box::pin(fut),
39786  39666   
        }
39787  39667   
    }
39788  39668   
}
39789  39669   
impl
39790  39670   
    ::aws_smithy_http_server::response::IntoResponse<
39791  39671   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39792         -
    > for crate::output::OmitsSerializingEmptyListsOutput
       39672  +
    > for crate::output::NullAndEmptyHeadersClientOutput
39793  39673   
{
39794  39674   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39795         -
        match crate::protocol_serde::shape_omits_serializing_empty_lists::ser_omits_serializing_empty_lists_http_response(self) {
       39675  +
        match crate::protocol_serde::shape_null_and_empty_headers_client::ser_null_and_empty_headers_client_http_response(self) {
39796  39676   
                        Ok(response) => response,
39797  39677   
                        Err(e) => {
39798  39678   
                            ::tracing::error!(error = %e, "failed to serialize response");
39799  39679   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39800  39680   
                        }
39801  39681   
                    }
39802  39682   
    }
39803  39683   
}
39804         -
impl
39805         -
    ::aws_smithy_http_server::response::IntoResponse<
39806         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39807         -
    > for crate::error::OmitsSerializingEmptyListsError
39808         -
{
39809         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39810         -
        match crate::protocol_serde::shape_omits_serializing_empty_lists::ser_omits_serializing_empty_lists_http_error(&self) {
39811         -
            Ok(mut response) => {
39812         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
39813         -
                response
39814         -
            },
39815         -
            Err(e) => {
39816         -
                ::tracing::error!(error = %e, "failed to serialize response");
39817         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39818         -
            }
39819         -
        }
39820         -
    }
39821         -
}
39822  39684   
39823         -
const CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
       39685  +
const CONTENT_TYPE_INPUTANDOUTPUTWITHHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
39824  39686   
::pin_project_lite::pin_project! {
39825  39687   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39826         -
    /// [`OmitsNullSerializesEmptyStringInput`](crate::input::OmitsNullSerializesEmptyStringInput) using modelled bindings.
39827         -
    pub struct OmitsNullSerializesEmptyStringInputFuture {
39828         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OmitsNullSerializesEmptyStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       39688  +
    /// [`InputAndOutputWithHeadersInput`](crate::input::InputAndOutputWithHeadersInput) using modelled bindings.
       39689  +
    pub struct InputAndOutputWithHeadersInputFuture {
       39690  +
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::InputAndOutputWithHeadersInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39829  39691   
    }
39830  39692   
}
39831  39693   
39832         -
impl std::future::Future for OmitsNullSerializesEmptyStringInputFuture {
       39694  +
impl std::future::Future for InputAndOutputWithHeadersInputFuture {
39833  39695   
    type Output = Result<
39834         -
        crate::input::OmitsNullSerializesEmptyStringInput,
       39696  +
        crate::input::InputAndOutputWithHeadersInput,
39835  39697   
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39836  39698   
    >;
39837  39699   
39838  39700   
    fn poll(
39839  39701   
        self: std::pin::Pin<&mut Self>,
39840  39702   
        cx: &mut std::task::Context<'_>,
39841  39703   
    ) -> std::task::Poll<Self::Output> {
39842  39704   
        let this = self.project();
39843  39705   
        this.inner.as_mut().poll(cx)
39844  39706   
    }
39845  39707   
}
39846  39708   
39847  39709   
impl<B>
39848  39710   
    ::aws_smithy_http_server::request::FromRequest<
39849  39711   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39850  39712   
        B,
39851         -
    > for crate::input::OmitsNullSerializesEmptyStringInput
       39713  +
    > for crate::input::InputAndOutputWithHeadersInput
39852  39714   
where
39853  39715   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39854  39716   
    B: 'static,
39855  39717   
39856  39718   
    B::Data: Send,
39857  39719   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39858  39720   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39859  39721   
{
39860  39722   
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39861         -
    type Future = OmitsNullSerializesEmptyStringInputFuture;
       39723  +
    type Future = InputAndOutputWithHeadersInputFuture;
39862  39724   
39863  39725   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39864  39726   
        let fut = async move {
39865  39727   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39866  39728   
                request.headers(),
39867         -
                &CONTENT_TYPE_OMITSNULLSERIALIZESEMPTYSTRING,
       39729  +
                &CONTENT_TYPE_INPUTANDOUTPUTWITHHEADERS,
39868  39730   
            ) {
39869  39731   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39870  39732   
            }
39871         -
            crate::protocol_serde::shape_omits_null_serializes_empty_string::de_omits_null_serializes_empty_string_http_request(request)
       39733  +
            crate::protocol_serde::shape_input_and_output_with_headers::de_input_and_output_with_headers_http_request(request)
39872  39734   
                            .await
39873  39735   
                            .map_err(Into::into)
39874  39736   
        };
39875  39737   
        use ::futures_util::future::TryFutureExt;
39876  39738   
        let fut = fut.map_err(
39877  39739   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39878  39740   
                ::tracing::debug!(error = %e, "failed to deserialize request");
39879  39741   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39880  39742   
                    e,
39881  39743   
                )
39882  39744   
            },
39883  39745   
        );
39884         -
        OmitsNullSerializesEmptyStringInputFuture {
       39746  +
        InputAndOutputWithHeadersInputFuture {
39885  39747   
            inner: Box::pin(fut),
39886  39748   
        }
39887  39749   
    }
39888  39750   
}
39889  39751   
impl
39890  39752   
    ::aws_smithy_http_server::response::IntoResponse<
39891  39753   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39892         -
    > for crate::output::OmitsNullSerializesEmptyStringOutput
       39754  +
    > for crate::output::InputAndOutputWithHeadersOutput
39893  39755   
{
39894  39756   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39895         -
        match crate::protocol_serde::shape_omits_null_serializes_empty_string::ser_omits_null_serializes_empty_string_http_response(self) {
       39757  +
        match crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_http_response(self) {
39896  39758   
                        Ok(response) => response,
39897  39759   
                        Err(e) => {
39898  39760   
                            ::tracing::error!(error = %e, "failed to serialize response");
39899  39761   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39900  39762   
                        }
39901  39763   
                    }
39902  39764   
    }
39903  39765   
}
39904         -
39905         -
const CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE: ::mime::Mime = ::mime::APPLICATION_JSON;
39906         -
::pin_project_lite::pin_project! {
39907         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39908         -
    /// [`IgnoreQueryParamsInResponseInput`](crate::input::IgnoreQueryParamsInResponseInput) using modelled bindings.
39909         -
    pub struct IgnoreQueryParamsInResponseInputFuture {
39910         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::IgnoreQueryParamsInResponseInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       39766  +
impl
       39767  +
    ::aws_smithy_http_server::response::IntoResponse<
       39768  +
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
       39769  +
    > for crate::error::InputAndOutputWithHeadersError
       39770  +
{
       39771  +
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
       39772  +
        match crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_http_error(&self) {
       39773  +
            Ok(mut response) => {
       39774  +
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
       39775  +
                response
       39776  +
            },
       39777  +
            Err(e) => {
       39778  +
                ::tracing::error!(error = %e, "failed to serialize response");
       39779  +
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       39780  +
            }
39911  39781   
        }
39912         -
}
39913         -
39914         -
impl std::future::Future for IgnoreQueryParamsInResponseInputFuture {
39915         -
    type Output = Result<
39916         -
        crate::input::IgnoreQueryParamsInResponseInput,
39917         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
39918         -
    >;
39919         -
39920         -
    fn poll(
39921         -
        self: std::pin::Pin<&mut Self>,
39922         -
        cx: &mut std::task::Context<'_>,
39923         -
    ) -> std::task::Poll<Self::Output> {
39924         -
        let this = self.project();
39925         -
        this.inner.as_mut().poll(cx)
39926  39782   
    }
39927  39783   
}
39928  39784   
39929         -
impl<B>
39930         -
    ::aws_smithy_http_server::request::FromRequest<
39931         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39932         -
        B,
39933         -
    > for crate::input::IgnoreQueryParamsInResponseInput
39934         -
where
39935         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
39936         -
    B: 'static,
39937         -
39938         -
    B::Data: Send,
39939         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
39940         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
39941         -
{
39942         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
39943         -
    type Future = IgnoreQueryParamsInResponseInputFuture;
       39785  +
#[allow(unreachable_code, unused_variables)]
       39786  +
#[cfg(test)]
       39787  +
mod input_and_output_with_headers_test {
39944  39788   
39945         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
39946         -
        let fut = async move {
39947         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
39948         -
                request.headers(),
39949         -
                &CONTENT_TYPE_IGNOREQUERYPARAMSINRESPONSE,
39950         -
            ) {
39951         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
39952         -
            }
39953         -
            crate::protocol_serde::shape_ignore_query_params_in_response::de_ignore_query_params_in_response_http_request(request)
39954         -
                            .await
39955         -
                            .map_err(Into::into)
       39789  +
    /// Tests requests with string header bindings
       39790  +
    /// Test ID: RestJsonInputAndOutputWithStringHeaders
       39791  +
    #[::tokio::test]
       39792  +
    #[::tracing_test::traced_test]
       39793  +
    async fn rest_json_input_and_output_with_string_headers_request() {
       39794  +
        #[allow(unused_mut)]
       39795  +
        let mut http_request = http::Request::builder()
       39796  +
            .uri("/InputAndOutputWithHeaders")
       39797  +
            .method("POST")
       39798  +
            .header("X-String", "Hello")
       39799  +
            .header("X-StringList", "a, b, c")
       39800  +
            .header("X-StringSet", "a, b, c")
       39801  +
            .body(::aws_smithy_http_server::body::Body::from(
       39802  +
                ::bytes::Bytes::from_static("".as_bytes()),
       39803  +
            ))
       39804  +
            .unwrap();
       39805  +
        #[allow(unused_mut)]
       39806  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       39807  +
        let config = crate::service::RestJsonConfig::builder().build();
       39808  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       39809  +
            .input_and_output_with_headers(
       39810  +
                move |input: crate::input::InputAndOutputWithHeadersInput| {
       39811  +
                    let sender = sender.clone();
       39812  +
                    async move {
       39813  +
                        let result = {
       39814  +
                            use ::aws_smithy_protocol_test::FloatEquals;
       39815  +
                            let expected = crate::input::InputAndOutputWithHeadersInput {
       39816  +
                                header_string: ::std::option::Option::Some("Hello".to_owned()),
       39817  +
                                header_string_list: ::std::option::Option::Some(vec![
       39818  +
                                    "a".to_owned(),
       39819  +
                                    "b".to_owned(),
       39820  +
                                    "c".to_owned(),
       39821  +
                                ]),
       39822  +
                                header_string_set: ::std::option::Option::Some(
       39823  +
                                    vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]
       39824  +
                                        .try_into()
       39825  +
                                        .expect("this is only used in tests"),
       39826  +
                                ),
       39827  +
                                header_byte: ::std::option::Option::None,
       39828  +
                                header_short: ::std::option::Option::None,
       39829  +
                                header_integer: ::std::option::Option::None,
       39830  +
                                header_long: ::std::option::Option::None,
       39831  +
                                header_float: ::std::option::Option::None,
       39832  +
                                header_double: ::std::option::Option::None,
       39833  +
                                header_true_bool: ::std::option::Option::None,
       39834  +
                                header_false_bool: ::std::option::Option::None,
       39835  +
                                header_integer_list: ::std::option::Option::None,
       39836  +
                                header_boolean_list: ::std::option::Option::None,
       39837  +
                                header_timestamp_list: ::std::option::Option::None,
       39838  +
                                header_enum: ::std::option::Option::None,
       39839  +
                                header_enum_list: ::std::option::Option::None,
       39840  +
                                header_integer_enum: ::std::option::Option::None,
       39841  +
                                header_integer_enum_list: ::std::option::Option::None,
       39842  +
                            };
       39843  +
                            ::pretty_assertions::assert_eq!(
       39844  +
                                input.header_string,
       39845  +
                                expected.header_string,
       39846  +
                                "Unexpected value for `header_string`"
       39847  +
                            );
       39848  +
                            ::pretty_assertions::assert_eq!(
       39849  +
                                input.header_byte,
       39850  +
                                expected.header_byte,
       39851  +
                                "Unexpected value for `header_byte`"
       39852  +
                            );
       39853  +
                            ::pretty_assertions::assert_eq!(
       39854  +
                                input.header_short,
       39855  +
                                expected.header_short,
       39856  +
                                "Unexpected value for `header_short`"
       39857  +
                            );
       39858  +
                            ::pretty_assertions::assert_eq!(
       39859  +
                                input.header_integer,
       39860  +
                                expected.header_integer,
       39861  +
                                "Unexpected value for `header_integer`"
       39862  +
                            );
       39863  +
                            ::pretty_assertions::assert_eq!(
       39864  +
                                input.header_long,
       39865  +
                                expected.header_long,
       39866  +
                                "Unexpected value for `header_long`"
       39867  +
                            );
       39868  +
                            assert!(
       39869  +
                                input.header_float.float_equals(&expected.header_float),
       39870  +
                                "Unexpected value for `header_float` {:?} vs. {:?}",
       39871  +
                                expected.header_float,
       39872  +
                                input.header_float
       39873  +
                            );
       39874  +
                            assert!(
       39875  +
                                input.header_double.float_equals(&expected.header_double),
       39876  +
                                "Unexpected value for `header_double` {:?} vs. {:?}",
       39877  +
                                expected.header_double,
       39878  +
                                input.header_double
       39879  +
                            );
       39880  +
                            ::pretty_assertions::assert_eq!(
       39881  +
                                input.header_true_bool,
       39882  +
                                expected.header_true_bool,
       39883  +
                                "Unexpected value for `header_true_bool`"
       39884  +
                            );
       39885  +
                            ::pretty_assertions::assert_eq!(
       39886  +
                                input.header_false_bool,
       39887  +
                                expected.header_false_bool,
       39888  +
                                "Unexpected value for `header_false_bool`"
       39889  +
                            );
       39890  +
                            ::pretty_assertions::assert_eq!(
       39891  +
                                input.header_string_list,
       39892  +
                                expected.header_string_list,
       39893  +
                                "Unexpected value for `header_string_list`"
       39894  +
                            );
       39895  +
                            ::pretty_assertions::assert_eq!(
       39896  +
                                input.header_string_set,
       39897  +
                                expected.header_string_set,
       39898  +
                                "Unexpected value for `header_string_set`"
       39899  +
                            );
       39900  +
                            ::pretty_assertions::assert_eq!(
       39901  +
                                input.header_integer_list,
       39902  +
                                expected.header_integer_list,
       39903  +
                                "Unexpected value for `header_integer_list`"
       39904  +
                            );
       39905  +
                            ::pretty_assertions::assert_eq!(
       39906  +
                                input.header_boolean_list,
       39907  +
                                expected.header_boolean_list,
       39908  +
                                "Unexpected value for `header_boolean_list`"
       39909  +
                            );
       39910  +
                            ::pretty_assertions::assert_eq!(
       39911  +
                                input.header_timestamp_list,
       39912  +
                                expected.header_timestamp_list,
       39913  +
                                "Unexpected value for `header_timestamp_list`"
       39914  +
                            );
       39915  +
                            ::pretty_assertions::assert_eq!(
       39916  +
                                input.header_enum,
       39917  +
                                expected.header_enum,
       39918  +
                                "Unexpected value for `header_enum`"
       39919  +
                            );
       39920  +
                            ::pretty_assertions::assert_eq!(
       39921  +
                                input.header_enum_list,
       39922  +
                                expected.header_enum_list,
       39923  +
                                "Unexpected value for `header_enum_list`"
       39924  +
                            );
       39925  +
                            ::pretty_assertions::assert_eq!(
       39926  +
                                input.header_integer_enum,
       39927  +
                                expected.header_integer_enum,
       39928  +
                                "Unexpected value for `header_integer_enum`"
       39929  +
                            );
       39930  +
                            ::pretty_assertions::assert_eq!(
       39931  +
                                input.header_integer_enum_list,
       39932  +
                                expected.header_integer_enum_list,
       39933  +
                                "Unexpected value for `header_integer_enum_list`"
       39934  +
                            );
       39935  +
                            let response = crate::output::InputAndOutputWithHeadersOutput {
       39936  +
                                header_string: ::std::option::Option::None,
       39937  +
                                header_byte: ::std::option::Option::None,
       39938  +
                                header_short: ::std::option::Option::None,
       39939  +
                                header_integer: ::std::option::Option::None,
       39940  +
                                header_long: ::std::option::Option::None,
       39941  +
                                header_float: ::std::option::Option::None,
       39942  +
                                header_double: ::std::option::Option::None,
       39943  +
                                header_true_bool: ::std::option::Option::None,
       39944  +
                                header_false_bool: ::std::option::Option::None,
       39945  +
                                header_string_list: ::std::option::Option::None,
       39946  +
                                header_string_set: ::std::option::Option::None,
       39947  +
                                header_integer_list: ::std::option::Option::None,
       39948  +
                                header_boolean_list: ::std::option::Option::None,
       39949  +
                                header_timestamp_list: ::std::option::Option::None,
       39950  +
                                header_enum: ::std::option::Option::None,
       39951  +
                                header_enum_list: ::std::option::Option::None,
       39952  +
                                header_integer_enum: ::std::option::Option::None,
       39953  +
                                header_integer_enum_list: ::std::option::Option::None,
39956  39954   
                            };
39957         -
        use ::futures_util::future::TryFutureExt;
39958         -
        let fut = fut.map_err(
39959         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
39960         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
39961         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
39962         -
                    e,
39963         -
                )
       39955  +
                            Ok(response)
       39956  +
                        };
       39957  +
                        sender.send(()).await.expect("receiver dropped early");
       39958  +
                        result
       39959  +
                    }
39964  39960   
                },
       39961  +
            )
       39962  +
            .build_unchecked();
       39963  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       39964  +
            .await
       39965  +
            .expect("unable to make an HTTP request");
       39966  +
        assert!(
       39967  +
            receiver.recv().await.is_some(),
       39968  +
            "we expected operation handler to be invoked but it was not entered"
39965  39969   
        );
39966         -
        IgnoreQueryParamsInResponseInputFuture {
39967         -
            inner: Box::pin(fut),
39968         -
        }
39969         -
    }
39970         -
}
39971         -
impl
39972         -
    ::aws_smithy_http_server::response::IntoResponse<
39973         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
39974         -
    > for crate::output::IgnoreQueryParamsInResponseOutput
39975         -
{
39976         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
39977         -
        match crate::protocol_serde::shape_ignore_query_params_in_response::ser_ignore_query_params_in_response_http_response(self) {
39978         -
                        Ok(response) => response,
39979         -
                        Err(e) => {
39980         -
                            ::tracing::error!(error = %e, "failed to serialize response");
39981         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
39982         -
                        }
39983         -
                    }
39984         -
    }
39985         -
}
39986         -
39987         -
const CONTENT_TYPE_CONSTANTANDVARIABLEQUERYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
39988         -
::pin_project_lite::pin_project! {
39989         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
39990         -
    /// [`ConstantAndVariableQueryStringInput`](crate::input::ConstantAndVariableQueryStringInput) using modelled bindings.
39991         -
    pub struct ConstantAndVariableQueryStringInputFuture {
39992         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ConstantAndVariableQueryStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
39993         -
    }
39994         -
}
39995         -
39996         -
impl std::future::Future for ConstantAndVariableQueryStringInputFuture {
39997         -
    type Output = Result<
39998         -
        crate::input::ConstantAndVariableQueryStringInput,
39999         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40000         -
    >;
40001         -
40002         -
    fn poll(
40003         -
        self: std::pin::Pin<&mut Self>,
40004         -
        cx: &mut std::task::Context<'_>,
40005         -
    ) -> std::task::Poll<Self::Output> {
40006         -
        let this = self.project();
40007         -
        this.inner.as_mut().poll(cx)
40008         -
    }
40009         -
}
40010         -
40011         -
impl<B>
40012         -
    ::aws_smithy_http_server::request::FromRequest<
40013         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40014         -
        B,
40015         -
    > for crate::input::ConstantAndVariableQueryStringInput
40016         -
where
40017         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40018         -
    B: 'static,
40019         -
40020         -
    B::Data: Send,
40021         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40022         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40023         -
{
40024         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40025         -
    type Future = ConstantAndVariableQueryStringInputFuture;
40026         -
40027         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40028         -
        let fut = async move {
40029         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40030         -
                request.headers(),
40031         -
                &CONTENT_TYPE_CONSTANTANDVARIABLEQUERYSTRING,
40032         -
            ) {
40033         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40034  39970   
    }
40035         -
            crate::protocol_serde::shape_constant_and_variable_query_string::de_constant_and_variable_query_string_http_request(request)
40036         -
                            .await
40037         -
                            .map_err(Into::into)
       39971  +
    /// Tests requests with string list header bindings that require quoting
       39972  +
    /// Test ID: RestJsonInputAndOutputWithQuotedStringHeaders
       39973  +
    #[::tokio::test]
       39974  +
    #[::tracing_test::traced_test]
       39975  +
    async fn rest_json_input_and_output_with_quoted_string_headers_request() {
       39976  +
        #[allow(unused_mut)]
       39977  +
        let mut http_request = http::Request::builder()
       39978  +
            .uri("/InputAndOutputWithHeaders")
       39979  +
            .method("POST")
       39980  +
            .header("X-StringList", "\"b,c\", \"\\\"def\\\"\", a")
       39981  +
            .body(::aws_smithy_http_server::body::Body::from(
       39982  +
                ::bytes::Bytes::from_static("".as_bytes()),
       39983  +
            ))
       39984  +
            .unwrap();
       39985  +
        #[allow(unused_mut)]
       39986  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       39987  +
        let config = crate::service::RestJsonConfig::builder().build();
       39988  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       39989  +
            .input_and_output_with_headers(
       39990  +
                move |input: crate::input::InputAndOutputWithHeadersInput| {
       39991  +
                    let sender = sender.clone();
       39992  +
                    async move {
       39993  +
                        let result = {
       39994  +
                            use ::aws_smithy_protocol_test::FloatEquals;
       39995  +
                            let expected = crate::input::InputAndOutputWithHeadersInput {
       39996  +
                                header_string_list: ::std::option::Option::Some(vec![
       39997  +
                                    "b,c".to_owned(),
       39998  +
                                    "\"def\"".to_owned(),
       39999  +
                                    "a".to_owned(),
       40000  +
                                ]),
       40001  +
                                header_string: ::std::option::Option::None,
       40002  +
                                header_byte: ::std::option::Option::None,
       40003  +
                                header_short: ::std::option::Option::None,
       40004  +
                                header_integer: ::std::option::Option::None,
       40005  +
                                header_long: ::std::option::Option::None,
       40006  +
                                header_float: ::std::option::Option::None,
       40007  +
                                header_double: ::std::option::Option::None,
       40008  +
                                header_true_bool: ::std::option::Option::None,
       40009  +
                                header_false_bool: ::std::option::Option::None,
       40010  +
                                header_string_set: ::std::option::Option::None,
       40011  +
                                header_integer_list: ::std::option::Option::None,
       40012  +
                                header_boolean_list: ::std::option::Option::None,
       40013  +
                                header_timestamp_list: ::std::option::Option::None,
       40014  +
                                header_enum: ::std::option::Option::None,
       40015  +
                                header_enum_list: ::std::option::Option::None,
       40016  +
                                header_integer_enum: ::std::option::Option::None,
       40017  +
                                header_integer_enum_list: ::std::option::Option::None,
40038  40018   
                            };
40039         -
        use ::futures_util::future::TryFutureExt;
40040         -
        let fut = fut.map_err(
40041         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40042         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40043         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40044         -
                    e,
40045         -
                )
40046         -
            },
       40019  +
                            ::pretty_assertions::assert_eq!(
       40020  +
                                input.header_string,
       40021  +
                                expected.header_string,
       40022  +
                                "Unexpected value for `header_string`"
40047  40023   
                            );
40048         -
        ConstantAndVariableQueryStringInputFuture {
40049         -
            inner: Box::pin(fut),
40050         -
        }
40051         -
    }
40052         -
}
40053         -
impl
40054         -
    ::aws_smithy_http_server::response::IntoResponse<
40055         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40056         -
    > for crate::output::ConstantAndVariableQueryStringOutput
40057         -
{
40058         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40059         -
        match crate::protocol_serde::shape_constant_and_variable_query_string::ser_constant_and_variable_query_string_http_response(self) {
40060         -
                        Ok(response) => response,
40061         -
                        Err(e) => {
40062         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40063         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40064         -
                        }
40065         -
                    }
40066         -
    }
40067         -
}
40068         -
40069         -
const CONTENT_TYPE_CONSTANTQUERYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
40070         -
::pin_project_lite::pin_project! {
40071         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40072         -
    /// [`ConstantQueryStringInput`](crate::input::ConstantQueryStringInput) using modelled bindings.
40073         -
    pub struct ConstantQueryStringInputFuture {
40074         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ConstantQueryStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40075         -
    }
40076         -
}
40077         -
40078         -
impl std::future::Future for ConstantQueryStringInputFuture {
40079         -
    type Output = Result<
40080         -
        crate::input::ConstantQueryStringInput,
40081         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40082         -
    >;
40083         -
40084         -
    fn poll(
40085         -
        self: std::pin::Pin<&mut Self>,
40086         -
        cx: &mut std::task::Context<'_>,
40087         -
    ) -> std::task::Poll<Self::Output> {
40088         -
        let this = self.project();
40089         -
        this.inner.as_mut().poll(cx)
40090         -
    }
40091         -
}
40092         -
40093         -
impl<B>
40094         -
    ::aws_smithy_http_server::request::FromRequest<
40095         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40096         -
        B,
40097         -
    > for crate::input::ConstantQueryStringInput
40098         -
where
40099         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40100         -
    B: 'static,
40101         -
40102         -
    B::Data: Send,
40103         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40104         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40105         -
{
40106         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40107         -
    type Future = ConstantQueryStringInputFuture;
40108         -
40109         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40110         -
        let fut = async move {
40111         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40112         -
                request.headers(),
40113         -
                &CONTENT_TYPE_CONSTANTQUERYSTRING,
40114         -
            ) {
40115         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       40024  +
                            ::pretty_assertions::assert_eq!(
       40025  +
                                input.header_byte,
       40026  +
                                expected.header_byte,
       40027  +
                                "Unexpected value for `header_byte`"
       40028  +
                            );
       40029  +
                            ::pretty_assertions::assert_eq!(
       40030  +
                                input.header_short,
       40031  +
                                expected.header_short,
       40032  +
                                "Unexpected value for `header_short`"
       40033  +
                            );
       40034  +
                            ::pretty_assertions::assert_eq!(
       40035  +
                                input.header_integer,
       40036  +
                                expected.header_integer,
       40037  +
                                "Unexpected value for `header_integer`"
       40038  +
                            );
       40039  +
                            ::pretty_assertions::assert_eq!(
       40040  +
                                input.header_long,
       40041  +
                                expected.header_long,
       40042  +
                                "Unexpected value for `header_long`"
       40043  +
                            );
       40044  +
                            assert!(
       40045  +
                                input.header_float.float_equals(&expected.header_float),
       40046  +
                                "Unexpected value for `header_float` {:?} vs. {:?}",
       40047  +
                                expected.header_float,
       40048  +
                                input.header_float
       40049  +
                            );
       40050  +
                            assert!(
       40051  +
                                input.header_double.float_equals(&expected.header_double),
       40052  +
                                "Unexpected value for `header_double` {:?} vs. {:?}",
       40053  +
                                expected.header_double,
       40054  +
                                input.header_double
       40055  +
                            );
       40056  +
                            ::pretty_assertions::assert_eq!(
       40057  +
                                input.header_true_bool,
       40058  +
                                expected.header_true_bool,
       40059  +
                                "Unexpected value for `header_true_bool`"
       40060  +
                            );
       40061  +
                            ::pretty_assertions::assert_eq!(
       40062  +
                                input.header_false_bool,
       40063  +
                                expected.header_false_bool,
       40064  +
                                "Unexpected value for `header_false_bool`"
       40065  +
                            );
       40066  +
                            ::pretty_assertions::assert_eq!(
       40067  +
                                input.header_string_list,
       40068  +
                                expected.header_string_list,
       40069  +
                                "Unexpected value for `header_string_list`"
       40070  +
                            );
       40071  +
                            ::pretty_assertions::assert_eq!(
       40072  +
                                input.header_string_set,
       40073  +
                                expected.header_string_set,
       40074  +
                                "Unexpected value for `header_string_set`"
       40075  +
                            );
       40076  +
                            ::pretty_assertions::assert_eq!(
       40077  +
                                input.header_integer_list,
       40078  +
                                expected.header_integer_list,
       40079  +
                                "Unexpected value for `header_integer_list`"
       40080  +
                            );
       40081  +
                            ::pretty_assertions::assert_eq!(
       40082  +
                                input.header_boolean_list,
       40083  +
                                expected.header_boolean_list,
       40084  +
                                "Unexpected value for `header_boolean_list`"
       40085  +
                            );
       40086  +
                            ::pretty_assertions::assert_eq!(
       40087  +
                                input.header_timestamp_list,
       40088  +
                                expected.header_timestamp_list,
       40089  +
                                "Unexpected value for `header_timestamp_list`"
       40090  +
                            );
       40091  +
                            ::pretty_assertions::assert_eq!(
       40092  +
                                input.header_enum,
       40093  +
                                expected.header_enum,
       40094  +
                                "Unexpected value for `header_enum`"
       40095  +
                            );
       40096  +
                            ::pretty_assertions::assert_eq!(
       40097  +
                                input.header_enum_list,
       40098  +
                                expected.header_enum_list,
       40099  +
                                "Unexpected value for `header_enum_list`"
       40100  +
                            );
       40101  +
                            ::pretty_assertions::assert_eq!(
       40102  +
                                input.header_integer_enum,
       40103  +
                                expected.header_integer_enum,
       40104  +
                                "Unexpected value for `header_integer_enum`"
       40105  +
                            );
       40106  +
                            ::pretty_assertions::assert_eq!(
       40107  +
                                input.header_integer_enum_list,
       40108  +
                                expected.header_integer_enum_list,
       40109  +
                                "Unexpected value for `header_integer_enum_list`"
       40110  +
                            );
       40111  +
                            let response = crate::output::InputAndOutputWithHeadersOutput {
       40112  +
                                header_string: ::std::option::Option::None,
       40113  +
                                header_byte: ::std::option::Option::None,
       40114  +
                                header_short: ::std::option::Option::None,
       40115  +
                                header_integer: ::std::option::Option::None,
       40116  +
                                header_long: ::std::option::Option::None,
       40117  +
                                header_float: ::std::option::Option::None,
       40118  +
                                header_double: ::std::option::Option::None,
       40119  +
                                header_true_bool: ::std::option::Option::None,
       40120  +
                                header_false_bool: ::std::option::Option::None,
       40121  +
                                header_string_list: ::std::option::Option::None,
       40122  +
                                header_string_set: ::std::option::Option::None,
       40123  +
                                header_integer_list: ::std::option::Option::None,
       40124  +
                                header_boolean_list: ::std::option::Option::None,
       40125  +
                                header_timestamp_list: ::std::option::Option::None,
       40126  +
                                header_enum: ::std::option::Option::None,
       40127  +
                                header_enum_list: ::std::option::Option::None,
       40128  +
                                header_integer_enum: ::std::option::Option::None,
       40129  +
                                header_integer_enum_list: ::std::option::Option::None,
       40130  +
                            };
       40131  +
                            Ok(response)
       40132  +
                        };
       40133  +
                        sender.send(()).await.expect("receiver dropped early");
       40134  +
                        result
40116  40135   
                    }
40117         -
            crate::protocol_serde::shape_constant_query_string::de_constant_query_string_http_request(request)
       40136  +
                },
       40137  +
            )
       40138  +
            .build_unchecked();
       40139  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
40118  40140   
            .await
40119         -
                            .map_err(Into::into)
       40141  +
            .expect("unable to make an HTTP request");
       40142  +
        assert!(
       40143  +
            receiver.recv().await.is_some(),
       40144  +
            "we expected operation handler to be invoked but it was not entered"
       40145  +
        );
       40146  +
    }
       40147  +
    /// Tests requests with numeric header bindings
       40148  +
    /// Test ID: RestJsonInputAndOutputWithNumericHeaders
       40149  +
    #[::tokio::test]
       40150  +
    #[::tracing_test::traced_test]
       40151  +
    async fn rest_json_input_and_output_with_numeric_headers_request() {
       40152  +
        #[allow(unused_mut)]
       40153  +
        let mut http_request = http::Request::builder()
       40154  +
            .uri("/InputAndOutputWithHeaders")
       40155  +
            .method("POST")
       40156  +
            .header("X-Byte", "1")
       40157  +
            .header("X-Double", "1.1")
       40158  +
            .header("X-Float", "1.1")
       40159  +
            .header("X-Integer", "123")
       40160  +
            .header("X-IntegerList", "1, 2, 3")
       40161  +
            .header("X-Long", "123")
       40162  +
            .header("X-Short", "123")
       40163  +
            .body(::aws_smithy_http_server::body::Body::from(
       40164  +
                ::bytes::Bytes::from_static("".as_bytes()),
       40165  +
            ))
       40166  +
            .unwrap();
       40167  +
        #[allow(unused_mut)]
       40168  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       40169  +
        let config = crate::service::RestJsonConfig::builder().build();
       40170  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       40171  +
            .input_and_output_with_headers(
       40172  +
                move |input: crate::input::InputAndOutputWithHeadersInput| {
       40173  +
                    let sender = sender.clone();
       40174  +
                    async move {
       40175  +
                        let result = {
       40176  +
                            use ::aws_smithy_protocol_test::FloatEquals;
       40177  +
                            let expected = crate::input::InputAndOutputWithHeadersInput {
       40178  +
                                header_byte: ::std::option::Option::Some(1),
       40179  +
                                header_short: ::std::option::Option::Some(123),
       40180  +
                                header_integer: ::std::option::Option::Some(123),
       40181  +
                                header_long: ::std::option::Option::Some(123),
       40182  +
                                header_float: ::std::option::Option::Some(1.1_f32),
       40183  +
                                header_double: ::std::option::Option::Some(1.1_f64),
       40184  +
                                header_integer_list: ::std::option::Option::Some(vec![1, 2, 3]),
       40185  +
                                header_string: ::std::option::Option::None,
       40186  +
                                header_true_bool: ::std::option::Option::None,
       40187  +
                                header_false_bool: ::std::option::Option::None,
       40188  +
                                header_string_list: ::std::option::Option::None,
       40189  +
                                header_string_set: ::std::option::Option::None,
       40190  +
                                header_boolean_list: ::std::option::Option::None,
       40191  +
                                header_timestamp_list: ::std::option::Option::None,
       40192  +
                                header_enum: ::std::option::Option::None,
       40193  +
                                header_enum_list: ::std::option::Option::None,
       40194  +
                                header_integer_enum: ::std::option::Option::None,
       40195  +
                                header_integer_enum_list: ::std::option::Option::None,
40120  40196   
                            };
40121         -
        use ::futures_util::future::TryFutureExt;
40122         -
        let fut = fut.map_err(
40123         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40124         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40125         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40126         -
                    e,
40127         -
                )
40128         -
            },
       40197  +
                            ::pretty_assertions::assert_eq!(
       40198  +
                                input.header_string,
       40199  +
                                expected.header_string,
       40200  +
                                "Unexpected value for `header_string`"
       40201  +
                            );
       40202  +
                            ::pretty_assertions::assert_eq!(
       40203  +
                                input.header_byte,
       40204  +
                                expected.header_byte,
       40205  +
                                "Unexpected value for `header_byte`"
       40206  +
                            );
       40207  +
                            ::pretty_assertions::assert_eq!(
       40208  +
                                input.header_short,
       40209  +
                                expected.header_short,
       40210  +
                                "Unexpected value for `header_short`"
       40211  +
                            );
       40212  +
                            ::pretty_assertions::assert_eq!(
       40213  +
                                input.header_integer,
       40214  +
                                expected.header_integer,
       40215  +
                                "Unexpected value for `header_integer`"
       40216  +
                            );
       40217  +
                            ::pretty_assertions::assert_eq!(
       40218  +
                                input.header_long,
       40219  +
                                expected.header_long,
       40220  +
                                "Unexpected value for `header_long`"
       40221  +
                            );
       40222  +
                            assert!(
       40223  +
                                input.header_float.float_equals(&expected.header_float),
       40224  +
                                "Unexpected value for `header_float` {:?} vs. {:?}",
       40225  +
                                expected.header_float,
       40226  +
                                input.header_float
       40227  +
                            );
       40228  +
                            assert!(
       40229  +
                                input.header_double.float_equals(&expected.header_double),
       40230  +
                                "Unexpected value for `header_double` {:?} vs. {:?}",
       40231  +
                                expected.header_double,
       40232  +
                                input.header_double
       40233  +
                            );
       40234  +
                            ::pretty_assertions::assert_eq!(
       40235  +
                                input.header_true_bool,
       40236  +
                                expected.header_true_bool,
       40237  +
                                "Unexpected value for `header_true_bool`"
       40238  +
                            );
       40239  +
                            ::pretty_assertions::assert_eq!(
       40240  +
                                input.header_false_bool,
       40241  +
                                expected.header_false_bool,
       40242  +
                                "Unexpected value for `header_false_bool`"
       40243  +
                            );
       40244  +
                            ::pretty_assertions::assert_eq!(
       40245  +
                                input.header_string_list,
       40246  +
                                expected.header_string_list,
       40247  +
                                "Unexpected value for `header_string_list`"
       40248  +
                            );
       40249  +
                            ::pretty_assertions::assert_eq!(
       40250  +
                                input.header_string_set,
       40251  +
                                expected.header_string_set,
       40252  +
                                "Unexpected value for `header_string_set`"
       40253  +
                            );
       40254  +
                            ::pretty_assertions::assert_eq!(
       40255  +
                                input.header_integer_list,
       40256  +
                                expected.header_integer_list,
       40257  +
                                "Unexpected value for `header_integer_list`"
       40258  +
                            );
       40259  +
                            ::pretty_assertions::assert_eq!(
       40260  +
                                input.header_boolean_list,
       40261  +
                                expected.header_boolean_list,
       40262  +
                                "Unexpected value for `header_boolean_list`"
       40263  +
                            );
       40264  +
                            ::pretty_assertions::assert_eq!(
       40265  +
                                input.header_timestamp_list,
       40266  +
                                expected.header_timestamp_list,
       40267  +
                                "Unexpected value for `header_timestamp_list`"
       40268  +
                            );
       40269  +
                            ::pretty_assertions::assert_eq!(
       40270  +
                                input.header_enum,
       40271  +
                                expected.header_enum,
       40272  +
                                "Unexpected value for `header_enum`"
       40273  +
                            );
       40274  +
                            ::pretty_assertions::assert_eq!(
       40275  +
                                input.header_enum_list,
       40276  +
                                expected.header_enum_list,
       40277  +
                                "Unexpected value for `header_enum_list`"
40129  40278   
                            );
40130         -
        ConstantQueryStringInputFuture {
40131         -
            inner: Box::pin(fut),
40132         -
        }
40133         -
    }
40134         -
}
40135         -
impl
40136         -
    ::aws_smithy_http_server::response::IntoResponse<
40137         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40138         -
    > for crate::output::ConstantQueryStringOutput
40139         -
{
40140         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40141         -
        match crate::protocol_serde::shape_constant_query_string::ser_constant_query_string_http_response(self) {
40142         -
                        Ok(response) => response,
40143         -
                        Err(e) => {
40144         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40145         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40146         -
                        }
40147         -
                    }
       40279  +
                            ::pretty_assertions::assert_eq!(
       40280  +
                                input.header_integer_enum,
       40281  +
                                expected.header_integer_enum,
       40282  +
                                "Unexpected value for `header_integer_enum`"
       40283  +
                            );
       40284  +
                            ::pretty_assertions::assert_eq!(
       40285  +
                                input.header_integer_enum_list,
       40286  +
                                expected.header_integer_enum_list,
       40287  +
                                "Unexpected value for `header_integer_enum_list`"
       40288  +
                            );
       40289  +
                            let response = crate::output::InputAndOutputWithHeadersOutput {
       40290  +
                                header_string: ::std::option::Option::None,
       40291  +
                                header_byte: ::std::option::Option::None,
       40292  +
                                header_short: ::std::option::Option::None,
       40293  +
                                header_integer: ::std::option::Option::None,
       40294  +
                                header_long: ::std::option::Option::None,
       40295  +
                                header_float: ::std::option::Option::None,
       40296  +
                                header_double: ::std::option::Option::None,
       40297  +
                                header_true_bool: ::std::option::Option::None,
       40298  +
                                header_false_bool: ::std::option::Option::None,
       40299  +
                                header_string_list: ::std::option::Option::None,
       40300  +
                                header_string_set: ::std::option::Option::None,
       40301  +
                                header_integer_list: ::std::option::Option::None,
       40302  +
                                header_boolean_list: ::std::option::Option::None,
       40303  +
                                header_timestamp_list: ::std::option::Option::None,
       40304  +
                                header_enum: ::std::option::Option::None,
       40305  +
                                header_enum_list: ::std::option::Option::None,
       40306  +
                                header_integer_enum: ::std::option::Option::None,
       40307  +
                                header_integer_enum_list: ::std::option::Option::None,
       40308  +
                            };
       40309  +
                            Ok(response)
       40310  +
                        };
       40311  +
                        sender.send(()).await.expect("receiver dropped early");
       40312  +
                        result
40148  40313   
                    }
40149         -
}
40150         -
impl
40151         -
    ::aws_smithy_http_server::response::IntoResponse<
40152         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40153         -
    > for crate::error::ConstantQueryStringError
40154         -
{
40155         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40156         -
        match crate::protocol_serde::shape_constant_query_string::ser_constant_query_string_http_error(&self) {
40157         -
            Ok(mut response) => {
40158         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40159         -
                response
40160  40314   
                },
40161         -
            Err(e) => {
40162         -
                ::tracing::error!(error = %e, "failed to serialize response");
40163         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40164         -
            }
40165         -
        }
40166         -
    }
40167         -
}
40168         -
40169         -
const CONTENT_TYPE_ALLQUERYSTRINGTYPES: ::mime::Mime = ::mime::APPLICATION_JSON;
40170         -
::pin_project_lite::pin_project! {
40171         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40172         -
    /// [`AllQueryStringTypesInput`](crate::input::AllQueryStringTypesInput) using modelled bindings.
40173         -
    pub struct AllQueryStringTypesInputFuture {
40174         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::AllQueryStringTypesInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40175         -
    }
40176         -
}
40177         -
40178         -
impl std::future::Future for AllQueryStringTypesInputFuture {
40179         -
    type Output = Result<
40180         -
        crate::input::AllQueryStringTypesInput,
40181         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40182         -
    >;
40183         -
40184         -
    fn poll(
40185         -
        self: std::pin::Pin<&mut Self>,
40186         -
        cx: &mut std::task::Context<'_>,
40187         -
    ) -> std::task::Poll<Self::Output> {
40188         -
        let this = self.project();
40189         -
        this.inner.as_mut().poll(cx)
40190         -
    }
40191         -
}
40192         -
40193         -
impl<B>
40194         -
    ::aws_smithy_http_server::request::FromRequest<
40195         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40196         -
        B,
40197         -
    > for crate::input::AllQueryStringTypesInput
40198         -
where
40199         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40200         -
    B: 'static,
40201         -
40202         -
    B::Data: Send,
40203         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40204         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40205         -
{
40206         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40207         -
    type Future = AllQueryStringTypesInputFuture;
40208         -
40209         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40210         -
        let fut = async move {
40211         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40212         -
                request.headers(),
40213         -
                &CONTENT_TYPE_ALLQUERYSTRINGTYPES,
40214         -
            ) {
40215         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40216         -
            }
40217         -
            crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_http_request(request)
40218         -
                            .await
40219         -
                            .map_err(Into::into)
40220         -
        };
40221         -
        use ::futures_util::future::TryFutureExt;
40222         -
        let fut = fut.map_err(
40223         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40224         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40225         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40226         -
                    e,
40227  40315   
            )
40228         -
            },
       40316  +
            .build_unchecked();
       40317  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       40318  +
            .await
       40319  +
            .expect("unable to make an HTTP request");
       40320  +
        assert!(
       40321  +
            receiver.recv().await.is_some(),
       40322  +
            "we expected operation handler to be invoked but it was not entered"
40229  40323   
        );
40230         -
        AllQueryStringTypesInputFuture {
40231         -
            inner: Box::pin(fut),
40232         -
        }
40233         -
    }
40234         -
}
40235         -
impl
40236         -
    ::aws_smithy_http_server::response::IntoResponse<
40237         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40238         -
    > for crate::output::AllQueryStringTypesOutput
40239         -
{
40240         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40241         -
        match crate::protocol_serde::shape_all_query_string_types::ser_all_query_string_types_http_response(self) {
40242         -
                        Ok(response) => response,
40243         -
                        Err(e) => {
40244         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40245         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40246         -
                        }
40247  40324   
    }
       40325  +
    /// Tests requests with boolean header bindings
       40326  +
    /// Test ID: RestJsonInputAndOutputWithBooleanHeaders
       40327  +
    #[::tokio::test]
       40328  +
    #[::tracing_test::traced_test]
       40329  +
    async fn rest_json_input_and_output_with_boolean_headers_request() {
       40330  +
        #[allow(unused_mut)]
       40331  +
        let mut http_request = http::Request::builder()
       40332  +
            .uri("/InputAndOutputWithHeaders")
       40333  +
            .method("POST")
       40334  +
            .header("X-Boolean1", "true")
       40335  +
            .header("X-Boolean2", "false")
       40336  +
            .header("X-BooleanList", "true, false, true")
       40337  +
            .body(::aws_smithy_http_server::body::Body::from(
       40338  +
                ::bytes::Bytes::from_static("".as_bytes()),
       40339  +
            ))
       40340  +
            .unwrap();
       40341  +
        #[allow(unused_mut)]
       40342  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       40343  +
        let config = crate::service::RestJsonConfig::builder().build();
       40344  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       40345  +
            .input_and_output_with_headers(
       40346  +
                move |input: crate::input::InputAndOutputWithHeadersInput| {
       40347  +
                    let sender = sender.clone();
       40348  +
                    async move {
       40349  +
                        let result = {
       40350  +
                            use ::aws_smithy_protocol_test::FloatEquals;
       40351  +
                            let expected = crate::input::InputAndOutputWithHeadersInput {
       40352  +
                                header_true_bool: ::std::option::Option::Some(true),
       40353  +
                                header_false_bool: ::std::option::Option::Some(false),
       40354  +
                                header_boolean_list: ::std::option::Option::Some(vec![
       40355  +
                                    true, false, true,
       40356  +
                                ]),
       40357  +
                                header_string: ::std::option::Option::None,
       40358  +
                                header_byte: ::std::option::Option::None,
       40359  +
                                header_short: ::std::option::Option::None,
       40360  +
                                header_integer: ::std::option::Option::None,
       40361  +
                                header_long: ::std::option::Option::None,
       40362  +
                                header_float: ::std::option::Option::None,
       40363  +
                                header_double: ::std::option::Option::None,
       40364  +
                                header_string_list: ::std::option::Option::None,
       40365  +
                                header_string_set: ::std::option::Option::None,
       40366  +
                                header_integer_list: ::std::option::Option::None,
       40367  +
                                header_timestamp_list: ::std::option::Option::None,
       40368  +
                                header_enum: ::std::option::Option::None,
       40369  +
                                header_enum_list: ::std::option::Option::None,
       40370  +
                                header_integer_enum: ::std::option::Option::None,
       40371  +
                                header_integer_enum_list: ::std::option::Option::None,
       40372  +
                            };
       40373  +
                            ::pretty_assertions::assert_eq!(
       40374  +
                                input.header_string,
       40375  +
                                expected.header_string,
       40376  +
                                "Unexpected value for `header_string`"
       40377  +
                            );
       40378  +
                            ::pretty_assertions::assert_eq!(
       40379  +
                                input.header_byte,
       40380  +
                                expected.header_byte,
       40381  +
                                "Unexpected value for `header_byte`"
       40382  +
                            );
       40383  +
                            ::pretty_assertions::assert_eq!(
       40384  +
                                input.header_short,
       40385  +
                                expected.header_short,
       40386  +
                                "Unexpected value for `header_short`"
       40387  +
                            );
       40388  +
                            ::pretty_assertions::assert_eq!(
       40389  +
                                input.header_integer,
       40390  +
                                expected.header_integer,
       40391  +
                                "Unexpected value for `header_integer`"
       40392  +
                            );
       40393  +
                            ::pretty_assertions::assert_eq!(
       40394  +
                                input.header_long,
       40395  +
                                expected.header_long,
       40396  +
                                "Unexpected value for `header_long`"
       40397  +
                            );
       40398  +
                            assert!(
       40399  +
                                input.header_float.float_equals(&expected.header_float),
       40400  +
                                "Unexpected value for `header_float` {:?} vs. {:?}",
       40401  +
                                expected.header_float,
       40402  +
                                input.header_float
       40403  +
                            );
       40404  +
                            assert!(
       40405  +
                                input.header_double.float_equals(&expected.header_double),
       40406  +
                                "Unexpected value for `header_double` {:?} vs. {:?}",
       40407  +
                                expected.header_double,
       40408  +
                                input.header_double
       40409  +
                            );
       40410  +
                            ::pretty_assertions::assert_eq!(
       40411  +
                                input.header_true_bool,
       40412  +
                                expected.header_true_bool,
       40413  +
                                "Unexpected value for `header_true_bool`"
       40414  +
                            );
       40415  +
                            ::pretty_assertions::assert_eq!(
       40416  +
                                input.header_false_bool,
       40417  +
                                expected.header_false_bool,
       40418  +
                                "Unexpected value for `header_false_bool`"
       40419  +
                            );
       40420  +
                            ::pretty_assertions::assert_eq!(
       40421  +
                                input.header_string_list,
       40422  +
                                expected.header_string_list,
       40423  +
                                "Unexpected value for `header_string_list`"
       40424  +
                            );
       40425  +
                            ::pretty_assertions::assert_eq!(
       40426  +
                                input.header_string_set,
       40427  +
                                expected.header_string_set,
       40428  +
                                "Unexpected value for `header_string_set`"
       40429  +
                            );
       40430  +
                            ::pretty_assertions::assert_eq!(
       40431  +
                                input.header_integer_list,
       40432  +
                                expected.header_integer_list,
       40433  +
                                "Unexpected value for `header_integer_list`"
       40434  +
                            );
       40435  +
                            ::pretty_assertions::assert_eq!(
       40436  +
                                input.header_boolean_list,
       40437  +
                                expected.header_boolean_list,
       40438  +
                                "Unexpected value for `header_boolean_list`"
       40439  +
                            );
       40440  +
                            ::pretty_assertions::assert_eq!(
       40441  +
                                input.header_timestamp_list,
       40442  +
                                expected.header_timestamp_list,
       40443  +
                                "Unexpected value for `header_timestamp_list`"
       40444  +
                            );
       40445  +
                            ::pretty_assertions::assert_eq!(
       40446  +
                                input.header_enum,
       40447  +
                                expected.header_enum,
       40448  +
                                "Unexpected value for `header_enum`"
       40449  +
                            );
       40450  +
                            ::pretty_assertions::assert_eq!(
       40451  +
                                input.header_enum_list,
       40452  +
                                expected.header_enum_list,
       40453  +
                                "Unexpected value for `header_enum_list`"
       40454  +
                            );
       40455  +
                            ::pretty_assertions::assert_eq!(
       40456  +
                                input.header_integer_enum,
       40457  +
                                expected.header_integer_enum,
       40458  +
                                "Unexpected value for `header_integer_enum`"
       40459  +
                            );
       40460  +
                            ::pretty_assertions::assert_eq!(
       40461  +
                                input.header_integer_enum_list,
       40462  +
                                expected.header_integer_enum_list,
       40463  +
                                "Unexpected value for `header_integer_enum_list`"
       40464  +
                            );
       40465  +
                            let response = crate::output::InputAndOutputWithHeadersOutput {
       40466  +
                                header_string: ::std::option::Option::None,
       40467  +
                                header_byte: ::std::option::Option::None,
       40468  +
                                header_short: ::std::option::Option::None,
       40469  +
                                header_integer: ::std::option::Option::None,
       40470  +
                                header_long: ::std::option::Option::None,
       40471  +
                                header_float: ::std::option::Option::None,
       40472  +
                                header_double: ::std::option::Option::None,
       40473  +
                                header_true_bool: ::std::option::Option::None,
       40474  +
                                header_false_bool: ::std::option::Option::None,
       40475  +
                                header_string_list: ::std::option::Option::None,
       40476  +
                                header_string_set: ::std::option::Option::None,
       40477  +
                                header_integer_list: ::std::option::Option::None,
       40478  +
                                header_boolean_list: ::std::option::Option::None,
       40479  +
                                header_timestamp_list: ::std::option::Option::None,
       40480  +
                                header_enum: ::std::option::Option::None,
       40481  +
                                header_enum_list: ::std::option::Option::None,
       40482  +
                                header_integer_enum: ::std::option::Option::None,
       40483  +
                                header_integer_enum_list: ::std::option::Option::None,
       40484  +
                            };
       40485  +
                            Ok(response)
       40486  +
                        };
       40487  +
                        sender.send(()).await.expect("receiver dropped early");
       40488  +
                        result
40248  40489   
                    }
40249         -
}
40250         -
impl
40251         -
    ::aws_smithy_http_server::response::IntoResponse<
40252         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40253         -
    > for crate::error::AllQueryStringTypesError
40254         -
{
40255         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40256         -
        match crate::protocol_serde::shape_all_query_string_types::ser_all_query_string_types_http_error(&self) {
40257         -
            Ok(mut response) => {
40258         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40259         -
                response
40260  40490   
                },
40261         -
            Err(e) => {
40262         -
                ::tracing::error!(error = %e, "failed to serialize response");
40263         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40264         -
            }
40265         -
        }
40266         -
    }
40267         -
}
40268         -
40269         -
const CONTENT_TYPE_HTTPREQUESTWITHREGEXLITERAL: ::mime::Mime = ::mime::APPLICATION_JSON;
40270         -
::pin_project_lite::pin_project! {
40271         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40272         -
    /// [`HttpRequestWithRegexLiteralInput`](crate::input::HttpRequestWithRegexLiteralInput) using modelled bindings.
40273         -
    pub struct HttpRequestWithRegexLiteralInputFuture {
40274         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithRegexLiteralInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40275         -
    }
40276         -
}
40277         -
40278         -
impl std::future::Future for HttpRequestWithRegexLiteralInputFuture {
40279         -
    type Output = Result<
40280         -
        crate::input::HttpRequestWithRegexLiteralInput,
40281         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40282         -
    >;
40283         -
40284         -
    fn poll(
40285         -
        self: std::pin::Pin<&mut Self>,
40286         -
        cx: &mut std::task::Context<'_>,
40287         -
    ) -> std::task::Poll<Self::Output> {
40288         -
        let this = self.project();
40289         -
        this.inner.as_mut().poll(cx)
40290         -
    }
40291         -
}
40292         -
40293         -
impl<B>
40294         -
    ::aws_smithy_http_server::request::FromRequest<
40295         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40296         -
        B,
40297         -
    > for crate::input::HttpRequestWithRegexLiteralInput
40298         -
where
40299         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40300         -
    B: 'static,
40301         -
40302         -
    B::Data: Send,
40303         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40304         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40305         -
{
40306         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40307         -
    type Future = HttpRequestWithRegexLiteralInputFuture;
40308         -
40309         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40310         -
        let fut = async move {
40311         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40312         -
                request.headers(),
40313         -
                &CONTENT_TYPE_HTTPREQUESTWITHREGEXLITERAL,
40314         -
            ) {
40315         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40316         -
            }
40317         -
            crate::protocol_serde::shape_http_request_with_regex_literal::de_http_request_with_regex_literal_http_request(request)
       40491  +
            )
       40492  +
            .build_unchecked();
       40493  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
40318  40494   
            .await
40319         -
                            .map_err(Into::into)
40320         -
        };
40321         -
        use ::futures_util::future::TryFutureExt;
40322         -
        let fut = fut.map_err(
40323         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40324         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40325         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40326         -
                    e,
       40495  +
            .expect("unable to make an HTTP request");
       40496  +
        assert!(
       40497  +
            receiver.recv().await.is_some(),
       40498  +
            "we expected operation handler to be invoked but it was not entered"
       40499  +
        );
       40500  +
    }
       40501  +
    /// Tests requests with timestamp header bindings
       40502  +
    /// Test ID: RestJsonInputAndOutputWithTimestampHeaders
       40503  +
    #[::tokio::test]
       40504  +
    #[::tracing_test::traced_test]
       40505  +
    async fn rest_json_input_and_output_with_timestamp_headers_request() {
       40506  +
        #[allow(unused_mut)]
       40507  +
        let mut http_request = http::Request::builder()
       40508  +
            .uri("/InputAndOutputWithHeaders")
       40509  +
            .method("POST")
       40510  +
            .header(
       40511  +
                "X-TimestampList",
       40512  +
                "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT",
40327  40513   
            )
40328         -
            },
       40514  +
            .body(::aws_smithy_http_server::body::Body::from(
       40515  +
                ::bytes::Bytes::from_static("".as_bytes()),
       40516  +
            ))
       40517  +
            .unwrap();
       40518  +
        #[allow(unused_mut)]
       40519  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       40520  +
        let config = crate::service::RestJsonConfig::builder().build();
       40521  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       40522  +
            .input_and_output_with_headers(
       40523  +
                move |input: crate::input::InputAndOutputWithHeadersInput| {
       40524  +
                    let sender = sender.clone();
       40525  +
                    async move {
       40526  +
                        let result = {
       40527  +
                            use ::aws_smithy_protocol_test::FloatEquals;
       40528  +
                            let expected = crate::input::InputAndOutputWithHeadersInput {
       40529  +
                                header_timestamp_list: ::std::option::Option::Some(vec![
       40530  +
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
       40531  +
                                        1576540098, 0_f64,
       40532  +
                                    ),
       40533  +
                                    ::aws_smithy_types::DateTime::from_fractional_secs(
       40534  +
                                        1576540098, 0_f64,
       40535  +
                                    ),
       40536  +
                                ]),
       40537  +
                                header_string: ::std::option::Option::None,
       40538  +
                                header_byte: ::std::option::Option::None,
       40539  +
                                header_short: ::std::option::Option::None,
       40540  +
                                header_integer: ::std::option::Option::None,
       40541  +
                                header_long: ::std::option::Option::None,
       40542  +
                                header_float: ::std::option::Option::None,
       40543  +
                                header_double: ::std::option::Option::None,
       40544  +
                                header_true_bool: ::std::option::Option::None,
       40545  +
                                header_false_bool: ::std::option::Option::None,
       40546  +
                                header_string_list: ::std::option::Option::None,
       40547  +
                                header_string_set: ::std::option::Option::None,
       40548  +
                                header_integer_list: ::std::option::Option::None,
       40549  +
                                header_boolean_list: ::std::option::Option::None,
       40550  +
                                header_enum: ::std::option::Option::None,
       40551  +
                                header_enum_list: ::std::option::Option::None,
       40552  +
                                header_integer_enum: ::std::option::Option::None,
       40553  +
                                header_integer_enum_list: ::std::option::Option::None,
       40554  +
                            };
       40555  +
                            ::pretty_assertions::assert_eq!(
       40556  +
                                input.header_string,
       40557  +
                                expected.header_string,
       40558  +
                                "Unexpected value for `header_string`"
       40559  +
                            );
       40560  +
                            ::pretty_assertions::assert_eq!(
       40561  +
                                input.header_byte,
       40562  +
                                expected.header_byte,
       40563  +
                                "Unexpected value for `header_byte`"
       40564  +
                            );
       40565  +
                            ::pretty_assertions::assert_eq!(
       40566  +
                                input.header_short,
       40567  +
                                expected.header_short,
       40568  +
                                "Unexpected value for `header_short`"
       40569  +
                            );
       40570  +
                            ::pretty_assertions::assert_eq!(
       40571  +
                                input.header_integer,
       40572  +
                                expected.header_integer,
       40573  +
                                "Unexpected value for `header_integer`"
       40574  +
                            );
       40575  +
                            ::pretty_assertions::assert_eq!(
       40576  +
                                input.header_long,
       40577  +
                                expected.header_long,
       40578  +
                                "Unexpected value for `header_long`"
       40579  +
                            );
       40580  +
                            assert!(
       40581  +
                                input.header_float.float_equals(&expected.header_float),
       40582  +
                                "Unexpected value for `header_float` {:?} vs. {:?}",
       40583  +
                                expected.header_float,
       40584  +
                                input.header_float
       40585  +
                            );
       40586  +
                            assert!(
       40587  +
                                input.header_double.float_equals(&expected.header_double),
       40588  +
                                "Unexpected value for `header_double` {:?} vs. {:?}",
       40589  +
                                expected.header_double,
       40590  +
                                input.header_double
       40591  +
                            );
       40592  +
                            ::pretty_assertions::assert_eq!(
       40593  +
                                input.header_true_bool,
       40594  +
                                expected.header_true_bool,
       40595  +
                                "Unexpected value for `header_true_bool`"
       40596  +
                            );
       40597  +
                            ::pretty_assertions::assert_eq!(
       40598  +
                                input.header_false_bool,
       40599  +
                                expected.header_false_bool,
       40600  +
                                "Unexpected value for `header_false_bool`"
       40601  +
                            );
       40602  +
                            ::pretty_assertions::assert_eq!(
       40603  +
                                input.header_string_list,
       40604  +
                                expected.header_string_list,
       40605  +
                                "Unexpected value for `header_string_list`"
       40606  +
                            );
       40607  +
                            ::pretty_assertions::assert_eq!(
       40608  +
                                input.header_string_set,
       40609  +
                                expected.header_string_set,
       40610  +
                                "Unexpected value for `header_string_set`"
       40611  +
                            );
       40612  +
                            ::pretty_assertions::assert_eq!(
       40613  +
                                input.header_integer_list,
       40614  +
                                expected.header_integer_list,
       40615  +
                                "Unexpected value for `header_integer_list`"
40329  40616   
                            );
40330         -
        HttpRequestWithRegexLiteralInputFuture {
40331         -
            inner: Box::pin(fut),
40332         -
        }
40333         -
    }
40334         -
}
40335         -
impl
40336         -
    ::aws_smithy_http_server::response::IntoResponse<
40337         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40338         -
    > for crate::output::HttpRequestWithRegexLiteralOutput
40339         -
{
40340         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40341         -
        match crate::protocol_serde::shape_http_request_with_regex_literal::ser_http_request_with_regex_literal_http_response(self) {
40342         -
                        Ok(response) => response,
40343         -
                        Err(e) => {
40344         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40345         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40346         -
                        }
40347         -
                    }
       40617  +
                            ::pretty_assertions::assert_eq!(
       40618  +
                                input.header_boolean_list,
       40619  +
                                expected.header_boolean_list,
       40620  +
                                "Unexpected value for `header_boolean_list`"
       40621  +
                            );
       40622  +
                            ::pretty_assertions::assert_eq!(
       40623  +
                                input.header_timestamp_list,
       40624  +
                                expected.header_timestamp_list,
       40625  +
                                "Unexpected value for `header_timestamp_list`"
       40626  +
                            );
       40627  +
                            ::pretty_assertions::assert_eq!(
       40628  +
                                input.header_enum,
       40629  +
                                expected.header_enum,
       40630  +
                                "Unexpected value for `header_enum`"
       40631  +
                            );
       40632  +
                            ::pretty_assertions::assert_eq!(
       40633  +
                                input.header_enum_list,
       40634  +
                                expected.header_enum_list,
       40635  +
                                "Unexpected value for `header_enum_list`"
       40636  +
                            );
       40637  +
                            ::pretty_assertions::assert_eq!(
       40638  +
                                input.header_integer_enum,
       40639  +
                                expected.header_integer_enum,
       40640  +
                                "Unexpected value for `header_integer_enum`"
       40641  +
                            );
       40642  +
                            ::pretty_assertions::assert_eq!(
       40643  +
                                input.header_integer_enum_list,
       40644  +
                                expected.header_integer_enum_list,
       40645  +
                                "Unexpected value for `header_integer_enum_list`"
       40646  +
                            );
       40647  +
                            let response = crate::output::InputAndOutputWithHeadersOutput {
       40648  +
                                header_string: ::std::option::Option::None,
       40649  +
                                header_byte: ::std::option::Option::None,
       40650  +
                                header_short: ::std::option::Option::None,
       40651  +
                                header_integer: ::std::option::Option::None,
       40652  +
                                header_long: ::std::option::Option::None,
       40653  +
                                header_float: ::std::option::Option::None,
       40654  +
                                header_double: ::std::option::Option::None,
       40655  +
                                header_true_bool: ::std::option::Option::None,
       40656  +
                                header_false_bool: ::std::option::Option::None,
       40657  +
                                header_string_list: ::std::option::Option::None,
       40658  +
                                header_string_set: ::std::option::Option::None,
       40659  +
                                header_integer_list: ::std::option::Option::None,
       40660  +
                                header_boolean_list: ::std::option::Option::None,
       40661  +
                                header_timestamp_list: ::std::option::Option::None,
       40662  +
                                header_enum: ::std::option::Option::None,
       40663  +
                                header_enum_list: ::std::option::Option::None,
       40664  +
                                header_integer_enum: ::std::option::Option::None,
       40665  +
                                header_integer_enum_list: ::std::option::Option::None,
       40666  +
                            };
       40667  +
                            Ok(response)
       40668  +
                        };
       40669  +
                        sender.send(()).await.expect("receiver dropped early");
       40670  +
                        result
40348  40671   
                    }
40349         -
}
40350         -
impl
40351         -
    ::aws_smithy_http_server::response::IntoResponse<
40352         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40353         -
    > for crate::error::HttpRequestWithRegexLiteralError
40354         -
{
40355         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40356         -
        match crate::protocol_serde::shape_http_request_with_regex_literal::ser_http_request_with_regex_literal_http_error(&self) {
40357         -
            Ok(mut response) => {
40358         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40359         -
                response
40360  40672   
                },
40361         -
            Err(e) => {
40362         -
                ::tracing::error!(error = %e, "failed to serialize response");
40363         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40364         -
            }
40365         -
        }
40366         -
    }
40367         -
}
40368         -
40369         -
const CONTENT_TYPE_HTTPREQUESTWITHFLOATLABELS: ::mime::Mime = ::mime::APPLICATION_JSON;
40370         -
::pin_project_lite::pin_project! {
40371         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40372         -
    /// [`HttpRequestWithFloatLabelsInput`](crate::input::HttpRequestWithFloatLabelsInput) using modelled bindings.
40373         -
    pub struct HttpRequestWithFloatLabelsInputFuture {
40374         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithFloatLabelsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40375         -
    }
40376         -
}
40377         -
40378         -
impl std::future::Future for HttpRequestWithFloatLabelsInputFuture {
40379         -
    type Output = Result<
40380         -
        crate::input::HttpRequestWithFloatLabelsInput,
40381         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40382         -
    >;
40383         -
40384         -
    fn poll(
40385         -
        self: std::pin::Pin<&mut Self>,
40386         -
        cx: &mut std::task::Context<'_>,
40387         -
    ) -> std::task::Poll<Self::Output> {
40388         -
        let this = self.project();
40389         -
        this.inner.as_mut().poll(cx)
40390         -
    }
40391         -
}
40392         -
40393         -
impl<B>
40394         -
    ::aws_smithy_http_server::request::FromRequest<
40395         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40396         -
        B,
40397         -
    > for crate::input::HttpRequestWithFloatLabelsInput
40398         -
where
40399         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40400         -
    B: 'static,
40401         -
40402         -
    B::Data: Send,
40403         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40404         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40405         -
{
40406         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40407         -
    type Future = HttpRequestWithFloatLabelsInputFuture;
40408         -
40409         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40410         -
        let fut = async move {
40411         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40412         -
                request.headers(),
40413         -
                &CONTENT_TYPE_HTTPREQUESTWITHFLOATLABELS,
40414         -
            ) {
40415         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40416         -
            }
40417         -
            crate::protocol_serde::shape_http_request_with_float_labels::de_http_request_with_float_labels_http_request(request)
40418         -
                            .await
40419         -
                            .map_err(Into::into)
40420         -
        };
40421         -
        use ::futures_util::future::TryFutureExt;
40422         -
        let fut = fut.map_err(
40423         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40424         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40425         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40426         -
                    e,
40427  40673   
            )
40428         -
            },
       40674  +
            .build_unchecked();
       40675  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       40676  +
            .await
       40677  +
            .expect("unable to make an HTTP request");
       40678  +
        assert!(
       40679  +
            receiver.recv().await.is_some(),
       40680  +
            "we expected operation handler to be invoked but it was not entered"
40429  40681   
        );
40430         -
        HttpRequestWithFloatLabelsInputFuture {
40431         -
            inner: Box::pin(fut),
40432         -
        }
40433         -
    }
40434         -
}
40435         -
impl
40436         -
    ::aws_smithy_http_server::response::IntoResponse<
40437         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40438         -
    > for crate::output::HttpRequestWithFloatLabelsOutput
40439         -
{
40440         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40441         -
        match crate::protocol_serde::shape_http_request_with_float_labels::ser_http_request_with_float_labels_http_response(self) {
40442         -
                        Ok(response) => response,
40443         -
                        Err(e) => {
40444         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40445         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40446         -
                        }
40447         -
                    }
40448         -
    }
40449         -
}
40450         -
impl
40451         -
    ::aws_smithy_http_server::response::IntoResponse<
40452         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40453         -
    > for crate::error::HttpRequestWithFloatLabelsError
40454         -
{
40455         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40456         -
        match crate::protocol_serde::shape_http_request_with_float_labels::ser_http_request_with_float_labels_http_error(&self) {
40457         -
            Ok(mut response) => {
40458         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40459         -
                response
40460         -
            },
40461         -
            Err(e) => {
40462         -
                ::tracing::error!(error = %e, "failed to serialize response");
40463         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40464         -
            }
40465  40682   
    }
40466         -
    }
40467         -
}
40468         -
40469         -
const CONTENT_TYPE_HTTPREQUESTWITHGREEDYLABELINPATH: ::mime::Mime = ::mime::APPLICATION_JSON;
40470         -
::pin_project_lite::pin_project! {
40471         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40472         -
    /// [`HttpRequestWithGreedyLabelInPathInput`](crate::input::HttpRequestWithGreedyLabelInPathInput) using modelled bindings.
40473         -
    pub struct HttpRequestWithGreedyLabelInPathInputFuture {
40474         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithGreedyLabelInPathInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40475         -
    }
40476         -
}
40477         -
40478         -
impl std::future::Future for HttpRequestWithGreedyLabelInPathInputFuture {
40479         -
    type Output = Result<
40480         -
        crate::input::HttpRequestWithGreedyLabelInPathInput,
40481         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40482         -
    >;
40483         -
40484         -
    fn poll(
40485         -
        self: std::pin::Pin<&mut Self>,
40486         -
        cx: &mut std::task::Context<'_>,
40487         -
    ) -> std::task::Poll<Self::Output> {
40488         -
        let this = self.project();
40489         -
        this.inner.as_mut().poll(cx)
40490         -
    }
40491         -
}
40492         -
40493         -
impl<B>
40494         -
    ::aws_smithy_http_server::request::FromRequest<
40495         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40496         -
        B,
40497         -
    > for crate::input::HttpRequestWithGreedyLabelInPathInput
40498         -
where
40499         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40500         -
    B: 'static,
40501         -
40502         -
    B::Data: Send,
40503         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40504         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40505         -
{
40506         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40507         -
    type Future = HttpRequestWithGreedyLabelInPathInputFuture;
40508         -
40509         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40510         -
        let fut = async move {
40511         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40512         -
                request.headers(),
40513         -
                &CONTENT_TYPE_HTTPREQUESTWITHGREEDYLABELINPATH,
40514         -
            ) {
40515         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40516         -
            }
40517         -
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path::de_http_request_with_greedy_label_in_path_http_request(request)
40518         -
                            .await
40519         -
                            .map_err(Into::into)
       40683  +
    /// Tests requests with enum header bindings
       40684  +
    /// Test ID: RestJsonInputAndOutputWithEnumHeaders
       40685  +
    #[::tokio::test]
       40686  +
    #[::tracing_test::traced_test]
       40687  +
    async fn rest_json_input_and_output_with_enum_headers_request() {
       40688  +
        #[allow(unused_mut)]
       40689  +
        let mut http_request = http::Request::builder()
       40690  +
            .uri("/InputAndOutputWithHeaders")
       40691  +
            .method("POST")
       40692  +
            .header("X-Enum", "Foo")
       40693  +
            .header("X-EnumList", "Foo, Bar, Baz")
       40694  +
            .body(::aws_smithy_http_server::body::Body::from(
       40695  +
                ::bytes::Bytes::from_static("".as_bytes()),
       40696  +
            ))
       40697  +
            .unwrap();
       40698  +
        #[allow(unused_mut)]
       40699  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       40700  +
        let config = crate::service::RestJsonConfig::builder().build();
       40701  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       40702  +
            .input_and_output_with_headers(
       40703  +
                move |input: crate::input::InputAndOutputWithHeadersInput| {
       40704  +
                    let sender = sender.clone();
       40705  +
                    async move {
       40706  +
                        let result = {
       40707  +
                            use ::aws_smithy_protocol_test::FloatEquals;
       40708  +
                            let expected = crate::input::InputAndOutputWithHeadersInput {
       40709  +
                                header_enum: ::std::option::Option::Some(
       40710  +
                                    "Foo"
       40711  +
                                        .parse::<crate::model::FooEnum>()
       40712  +
                                        .expect("static value validated to member"),
       40713  +
                                ),
       40714  +
                                header_enum_list: ::std::option::Option::Some(vec![
       40715  +
                                    "Foo"
       40716  +
                                        .parse::<crate::model::FooEnum>()
       40717  +
                                        .expect("static value validated to member"),
       40718  +
                                    "Bar"
       40719  +
                                        .parse::<crate::model::FooEnum>()
       40720  +
                                        .expect("static value validated to member"),
       40721  +
                                    "Baz"
       40722  +
                                        .parse::<crate::model::FooEnum>()
       40723  +
                                        .expect("static value validated to member"),
       40724  +
                                ]),
       40725  +
                                header_string: ::std::option::Option::None,
       40726  +
                                header_byte: ::std::option::Option::None,
       40727  +
                                header_short: ::std::option::Option::None,
       40728  +
                                header_integer: ::std::option::Option::None,
       40729  +
                                header_long: ::std::option::Option::None,
       40730  +
                                header_float: ::std::option::Option::None,
       40731  +
                                header_double: ::std::option::Option::None,
       40732  +
                                header_true_bool: ::std::option::Option::None,
       40733  +
                                header_false_bool: ::std::option::Option::None,
       40734  +
                                header_string_list: ::std::option::Option::None,
       40735  +
                                header_string_set: ::std::option::Option::None,
       40736  +
                                header_integer_list: ::std::option::Option::None,
       40737  +
                                header_boolean_list: ::std::option::Option::None,
       40738  +
                                header_timestamp_list: ::std::option::Option::None,
       40739  +
                                header_integer_enum: ::std::option::Option::None,
       40740  +
                                header_integer_enum_list: ::std::option::Option::None,
40520  40741   
                            };
40521         -
        use ::futures_util::future::TryFutureExt;
40522         -
        let fut = fut.map_err(
40523         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40524         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40525         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40526         -
                    e,
40527         -
                )
40528         -
            },
       40742  +
                            ::pretty_assertions::assert_eq!(
       40743  +
                                input.header_string,
       40744  +
                                expected.header_string,
       40745  +
                                "Unexpected value for `header_string`"
40529  40746   
                            );
40530         -
        HttpRequestWithGreedyLabelInPathInputFuture {
40531         -
            inner: Box::pin(fut),
40532         -
        }
40533         -
    }
40534         -
}
40535         -
impl
40536         -
    ::aws_smithy_http_server::response::IntoResponse<
40537         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40538         -
    > for crate::output::HttpRequestWithGreedyLabelInPathOutput
40539         -
{
40540         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40541         -
        match crate::protocol_serde::shape_http_request_with_greedy_label_in_path::ser_http_request_with_greedy_label_in_path_http_response(self) {
40542         -
                        Ok(response) => response,
40543         -
                        Err(e) => {
40544         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40545         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40546         -
                        }
40547         -
                    }
40548         -
    }
40549         -
}
40550         -
impl
40551         -
    ::aws_smithy_http_server::response::IntoResponse<
40552         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40553         -
    > for crate::error::HttpRequestWithGreedyLabelInPathError
40554         -
{
40555         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40556         -
        match crate::protocol_serde::shape_http_request_with_greedy_label_in_path::ser_http_request_with_greedy_label_in_path_http_error(&self) {
40557         -
            Ok(mut response) => {
40558         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40559         -
                response
40560         -
            },
40561         -
            Err(e) => {
40562         -
                ::tracing::error!(error = %e, "failed to serialize response");
40563         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40564         -
            }
40565         -
        }
40566         -
    }
40567         -
}
40568         -
40569         -
const CONTENT_TYPE_HTTPREQUESTWITHLABELSANDTIMESTAMPFORMAT: ::mime::Mime = ::mime::APPLICATION_JSON;
40570         -
::pin_project_lite::pin_project! {
40571         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40572         -
    /// [`HttpRequestWithLabelsAndTimestampFormatInput`](crate::input::HttpRequestWithLabelsAndTimestampFormatInput) using modelled bindings.
40573         -
    pub struct HttpRequestWithLabelsAndTimestampFormatInputFuture {
40574         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithLabelsAndTimestampFormatInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40575         -
    }
40576         -
}
40577         -
40578         -
impl std::future::Future for HttpRequestWithLabelsAndTimestampFormatInputFuture {
40579         -
    type Output = Result<
40580         -
        crate::input::HttpRequestWithLabelsAndTimestampFormatInput,
40581         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40582         -
    >;
40583         -
40584         -
    fn poll(
40585         -
        self: std::pin::Pin<&mut Self>,
40586         -
        cx: &mut std::task::Context<'_>,
40587         -
    ) -> std::task::Poll<Self::Output> {
40588         -
        let this = self.project();
40589         -
        this.inner.as_mut().poll(cx)
40590         -
    }
40591         -
}
40592         -
40593         -
impl<B>
40594         -
    ::aws_smithy_http_server::request::FromRequest<
40595         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40596         -
        B,
40597         -
    > for crate::input::HttpRequestWithLabelsAndTimestampFormatInput
40598         -
where
40599         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40600         -
    B: 'static,
40601         -
40602         -
    B::Data: Send,
40603         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40604         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40605         -
{
40606         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40607         -
    type Future = HttpRequestWithLabelsAndTimestampFormatInputFuture;
40608         -
40609         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40610         -
        let fut = async move {
40611         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40612         -
                request.headers(),
40613         -
                &CONTENT_TYPE_HTTPREQUESTWITHLABELSANDTIMESTAMPFORMAT,
40614         -
            ) {
40615         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40616         -
            }
40617         -
            crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::de_http_request_with_labels_and_timestamp_format_http_request(request)
40618         -
                            .await
40619         -
                            .map_err(Into::into)
       40747  +
                            ::pretty_assertions::assert_eq!(
       40748  +
                                input.header_byte,
       40749  +
                                expected.header_byte,
       40750  +
                                "Unexpected value for `header_byte`"
       40751  +
                            );
       40752  +
                            ::pretty_assertions::assert_eq!(
       40753  +
                                input.header_short,
       40754  +
                                expected.header_short,
       40755  +
                                "Unexpected value for `header_short`"
       40756  +
                            );
       40757  +
                            ::pretty_assertions::assert_eq!(
       40758  +
                                input.header_integer,
       40759  +
                                expected.header_integer,
       40760  +
                                "Unexpected value for `header_integer`"
       40761  +
                            );
       40762  +
                            ::pretty_assertions::assert_eq!(
       40763  +
                                input.header_long,
       40764  +
                                expected.header_long,
       40765  +
                                "Unexpected value for `header_long`"
       40766  +
                            );
       40767  +
                            assert!(
       40768  +
                                input.header_float.float_equals(&expected.header_float),
       40769  +
                                "Unexpected value for `header_float` {:?} vs. {:?}",
       40770  +
                                expected.header_float,
       40771  +
                                input.header_float
       40772  +
                            );
       40773  +
                            assert!(
       40774  +
                                input.header_double.float_equals(&expected.header_double),
       40775  +
                                "Unexpected value for `header_double` {:?} vs. {:?}",
       40776  +
                                expected.header_double,
       40777  +
                                input.header_double
       40778  +
                            );
       40779  +
                            ::pretty_assertions::assert_eq!(
       40780  +
                                input.header_true_bool,
       40781  +
                                expected.header_true_bool,
       40782  +
                                "Unexpected value for `header_true_bool`"
       40783  +
                            );
       40784  +
                            ::pretty_assertions::assert_eq!(
       40785  +
                                input.header_false_bool,
       40786  +
                                expected.header_false_bool,
       40787  +
                                "Unexpected value for `header_false_bool`"
       40788  +
                            );
       40789  +
                            ::pretty_assertions::assert_eq!(
       40790  +
                                input.header_string_list,
       40791  +
                                expected.header_string_list,
       40792  +
                                "Unexpected value for `header_string_list`"
       40793  +
                            );
       40794  +
                            ::pretty_assertions::assert_eq!(
       40795  +
                                input.header_string_set,
       40796  +
                                expected.header_string_set,
       40797  +
                                "Unexpected value for `header_string_set`"
       40798  +
                            );
       40799  +
                            ::pretty_assertions::assert_eq!(
       40800  +
                                input.header_integer_list,
       40801  +
                                expected.header_integer_list,
       40802  +
                                "Unexpected value for `header_integer_list`"
       40803  +
                            );
       40804  +
                            ::pretty_assertions::assert_eq!(
       40805  +
                                input.header_boolean_list,
       40806  +
                                expected.header_boolean_list,
       40807  +
                                "Unexpected value for `header_boolean_list`"
       40808  +
                            );
       40809  +
                            ::pretty_assertions::assert_eq!(
       40810  +
                                input.header_timestamp_list,
       40811  +
                                expected.header_timestamp_list,
       40812  +
                                "Unexpected value for `header_timestamp_list`"
       40813  +
                            );
       40814  +
                            ::pretty_assertions::assert_eq!(
       40815  +
                                input.header_enum,
       40816  +
                                expected.header_enum,
       40817  +
                                "Unexpected value for `header_enum`"
       40818  +
                            );
       40819  +
                            ::pretty_assertions::assert_eq!(
       40820  +
                                input.header_enum_list,
       40821  +
                                expected.header_enum_list,
       40822  +
                                "Unexpected value for `header_enum_list`"
       40823  +
                            );
       40824  +
                            ::pretty_assertions::assert_eq!(
       40825  +
                                input.header_integer_enum,
       40826  +
                                expected.header_integer_enum,
       40827  +
                                "Unexpected value for `header_integer_enum`"
       40828  +
                            );
       40829  +
                            ::pretty_assertions::assert_eq!(
       40830  +
                                input.header_integer_enum_list,
       40831  +
                                expected.header_integer_enum_list,
       40832  +
                                "Unexpected value for `header_integer_enum_list`"
       40833  +
                            );
       40834  +
                            let response = crate::output::InputAndOutputWithHeadersOutput {
       40835  +
                                header_string: ::std::option::Option::None,
       40836  +
                                header_byte: ::std::option::Option::None,
       40837  +
                                header_short: ::std::option::Option::None,
       40838  +
                                header_integer: ::std::option::Option::None,
       40839  +
                                header_long: ::std::option::Option::None,
       40840  +
                                header_float: ::std::option::Option::None,
       40841  +
                                header_double: ::std::option::Option::None,
       40842  +
                                header_true_bool: ::std::option::Option::None,
       40843  +
                                header_false_bool: ::std::option::Option::None,
       40844  +
                                header_string_list: ::std::option::Option::None,
       40845  +
                                header_string_set: ::std::option::Option::None,
       40846  +
                                header_integer_list: ::std::option::Option::None,
       40847  +
                                header_boolean_list: ::std::option::Option::None,
       40848  +
                                header_timestamp_list: ::std::option::Option::None,
       40849  +
                                header_enum: ::std::option::Option::None,
       40850  +
                                header_enum_list: ::std::option::Option::None,
       40851  +
                                header_integer_enum: ::std::option::Option::None,
       40852  +
                                header_integer_enum_list: ::std::option::Option::None,
       40853  +
                            };
       40854  +
                            Ok(response)
40620  40855   
                        };
40621         -
        use ::futures_util::future::TryFutureExt;
40622         -
        let fut = fut.map_err(
40623         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40624         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40625         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40626         -
                    e,
40627         -
                )
40628         -
            },
40629         -
        );
40630         -
        HttpRequestWithLabelsAndTimestampFormatInputFuture {
40631         -
            inner: Box::pin(fut),
40632         -
        }
40633         -
    }
40634         -
}
40635         -
impl
40636         -
    ::aws_smithy_http_server::response::IntoResponse<
40637         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40638         -
    > for crate::output::HttpRequestWithLabelsAndTimestampFormatOutput
40639         -
{
40640         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40641         -
        match crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::ser_http_request_with_labels_and_timestamp_format_http_response(self) {
40642         -
                        Ok(response) => response,
40643         -
                        Err(e) => {
40644         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40645         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40646         -
                        }
40647         -
                    }
       40856  +
                        sender.send(()).await.expect("receiver dropped early");
       40857  +
                        result
40648  40858   
                    }
40649         -
}
40650         -
impl
40651         -
    ::aws_smithy_http_server::response::IntoResponse<
40652         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40653         -
    > for crate::error::HttpRequestWithLabelsAndTimestampFormatError
40654         -
{
40655         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40656         -
        match crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format::ser_http_request_with_labels_and_timestamp_format_http_error(&self) {
40657         -
            Ok(mut response) => {
40658         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40659         -
                response
40660  40859   
                },
40661         -
            Err(e) => {
40662         -
                ::tracing::error!(error = %e, "failed to serialize response");
40663         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40664         -
            }
40665         -
        }
40666         -
    }
40667         -
}
40668         -
40669         -
const CONTENT_TYPE_HTTPREQUESTWITHLABELS: ::mime::Mime = ::mime::APPLICATION_JSON;
40670         -
::pin_project_lite::pin_project! {
40671         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40672         -
    /// [`HttpRequestWithLabelsInput`](crate::input::HttpRequestWithLabelsInput) using modelled bindings.
40673         -
    pub struct HttpRequestWithLabelsInputFuture {
40674         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::HttpRequestWithLabelsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40675         -
    }
40676         -
}
40677         -
40678         -
impl std::future::Future for HttpRequestWithLabelsInputFuture {
40679         -
    type Output = Result<
40680         -
        crate::input::HttpRequestWithLabelsInput,
40681         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40682         -
    >;
40683         -
40684         -
    fn poll(
40685         -
        self: std::pin::Pin<&mut Self>,
40686         -
        cx: &mut std::task::Context<'_>,
40687         -
    ) -> std::task::Poll<Self::Output> {
40688         -
        let this = self.project();
40689         -
        this.inner.as_mut().poll(cx)
40690         -
    }
40691         -
}
40692         -
40693         -
impl<B>
40694         -
    ::aws_smithy_http_server::request::FromRequest<
40695         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40696         -
        B,
40697         -
    > for crate::input::HttpRequestWithLabelsInput
40698         -
where
40699         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40700         -
    B: 'static,
40701         -
40702         -
    B::Data: Send,
40703         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40704         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40705         -
{
40706         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40707         -
    type Future = HttpRequestWithLabelsInputFuture;
40708         -
40709         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40710         -
        let fut = async move {
40711         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40712         -
                request.headers(),
40713         -
                &CONTENT_TYPE_HTTPREQUESTWITHLABELS,
40714         -
            ) {
40715         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40716         -
            }
40717         -
            crate::protocol_serde::shape_http_request_with_labels::de_http_request_with_labels_http_request(request)
40718         -
                            .await
40719         -
                            .map_err(Into::into)
40720         -
        };
40721         -
        use ::futures_util::future::TryFutureExt;
40722         -
        let fut = fut.map_err(
40723         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40724         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40725         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40726         -
                    e,
40727  40860   
            )
40728         -
            },
       40861  +
            .build_unchecked();
       40862  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       40863  +
            .await
       40864  +
            .expect("unable to make an HTTP request");
       40865  +
        assert!(
       40866  +
            receiver.recv().await.is_some(),
       40867  +
            "we expected operation handler to be invoked but it was not entered"
40729  40868   
        );
40730         -
        HttpRequestWithLabelsInputFuture {
40731         -
            inner: Box::pin(fut),
40732         -
        }
40733         -
    }
40734         -
}
40735         -
impl
40736         -
    ::aws_smithy_http_server::response::IntoResponse<
40737         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40738         -
    > for crate::output::HttpRequestWithLabelsOutput
40739         -
{
40740         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40741         -
        match crate::protocol_serde::shape_http_request_with_labels::ser_http_request_with_labels_http_response(self) {
40742         -
                        Ok(response) => response,
40743         -
                        Err(e) => {
40744         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40745         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40746         -
                        }
40747  40869   
    }
       40870  +
    /// Tests requests with intEnum header bindings
       40871  +
    /// Test ID: RestJsonInputAndOutputWithIntEnumHeaders
       40872  +
    #[::tokio::test]
       40873  +
    #[::tracing_test::traced_test]
       40874  +
    async fn rest_json_input_and_output_with_int_enum_headers_request() {
       40875  +
        #[allow(unused_mut)]
       40876  +
        let mut http_request = http::Request::builder()
       40877  +
            .uri("/InputAndOutputWithHeaders")
       40878  +
            .method("POST")
       40879  +
            .header("X-IntegerEnum", "1")
       40880  +
            .header("X-IntegerEnumList", "1, 2, 3")
       40881  +
            .body(::aws_smithy_http_server::body::Body::from(
       40882  +
                ::bytes::Bytes::from_static("".as_bytes()),
       40883  +
            ))
       40884  +
            .unwrap();
       40885  +
        #[allow(unused_mut)]
       40886  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       40887  +
        let config = crate::service::RestJsonConfig::builder().build();
       40888  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       40889  +
            .input_and_output_with_headers(
       40890  +
                move |input: crate::input::InputAndOutputWithHeadersInput| {
       40891  +
                    let sender = sender.clone();
       40892  +
                    async move {
       40893  +
                        let result = {
       40894  +
                            use ::aws_smithy_protocol_test::FloatEquals;
       40895  +
                            let expected = crate::input::InputAndOutputWithHeadersInput {
       40896  +
                                header_integer_enum: ::std::option::Option::Some(1),
       40897  +
                                header_integer_enum_list: ::std::option::Option::Some(vec![
       40898  +
                                    1, 2, 3,
       40899  +
                                ]),
       40900  +
                                header_string: ::std::option::Option::None,
       40901  +
                                header_byte: ::std::option::Option::None,
       40902  +
                                header_short: ::std::option::Option::None,
       40903  +
                                header_integer: ::std::option::Option::None,
       40904  +
                                header_long: ::std::option::Option::None,
       40905  +
                                header_float: ::std::option::Option::None,
       40906  +
                                header_double: ::std::option::Option::None,
       40907  +
                                header_true_bool: ::std::option::Option::None,
       40908  +
                                header_false_bool: ::std::option::Option::None,
       40909  +
                                header_string_list: ::std::option::Option::None,
       40910  +
                                header_string_set: ::std::option::Option::None,
       40911  +
                                header_integer_list: ::std::option::Option::None,
       40912  +
                                header_boolean_list: ::std::option::Option::None,
       40913  +
                                header_timestamp_list: ::std::option::Option::None,
       40914  +
                                header_enum: ::std::option::Option::None,
       40915  +
                                header_enum_list: ::std::option::Option::None,
       40916  +
                            };
       40917  +
                            ::pretty_assertions::assert_eq!(
       40918  +
                                input.header_string,
       40919  +
                                expected.header_string,
       40920  +
                                "Unexpected value for `header_string`"
       40921  +
                            );
       40922  +
                            ::pretty_assertions::assert_eq!(
       40923  +
                                input.header_byte,
       40924  +
                                expected.header_byte,
       40925  +
                                "Unexpected value for `header_byte`"
       40926  +
                            );
       40927  +
                            ::pretty_assertions::assert_eq!(
       40928  +
                                input.header_short,
       40929  +
                                expected.header_short,
       40930  +
                                "Unexpected value for `header_short`"
       40931  +
                            );
       40932  +
                            ::pretty_assertions::assert_eq!(
       40933  +
                                input.header_integer,
       40934  +
                                expected.header_integer,
       40935  +
                                "Unexpected value for `header_integer`"
       40936  +
                            );
       40937  +
                            ::pretty_assertions::assert_eq!(
       40938  +
                                input.header_long,
       40939  +
                                expected.header_long,
       40940  +
                                "Unexpected value for `header_long`"
       40941  +
                            );
       40942  +
                            assert!(
       40943  +
                                input.header_float.float_equals(&expected.header_float),
       40944  +
                                "Unexpected value for `header_float` {:?} vs. {:?}",
       40945  +
                                expected.header_float,
       40946  +
                                input.header_float
       40947  +
                            );
       40948  +
                            assert!(
       40949  +
                                input.header_double.float_equals(&expected.header_double),
       40950  +
                                "Unexpected value for `header_double` {:?} vs. {:?}",
       40951  +
                                expected.header_double,
       40952  +
                                input.header_double
       40953  +
                            );
       40954  +
                            ::pretty_assertions::assert_eq!(
       40955  +
                                input.header_true_bool,
       40956  +
                                expected.header_true_bool,
       40957  +
                                "Unexpected value for `header_true_bool`"
       40958  +
                            );
       40959  +
                            ::pretty_assertions::assert_eq!(
       40960  +
                                input.header_false_bool,
       40961  +
                                expected.header_false_bool,
       40962  +
                                "Unexpected value for `header_false_bool`"
       40963  +
                            );
       40964  +
                            ::pretty_assertions::assert_eq!(
       40965  +
                                input.header_string_list,
       40966  +
                                expected.header_string_list,
       40967  +
                                "Unexpected value for `header_string_list`"
       40968  +
                            );
       40969  +
                            ::pretty_assertions::assert_eq!(
       40970  +
                                input.header_string_set,
       40971  +
                                expected.header_string_set,
       40972  +
                                "Unexpected value for `header_string_set`"
       40973  +
                            );
       40974  +
                            ::pretty_assertions::assert_eq!(
       40975  +
                                input.header_integer_list,
       40976  +
                                expected.header_integer_list,
       40977  +
                                "Unexpected value for `header_integer_list`"
       40978  +
                            );
       40979  +
                            ::pretty_assertions::assert_eq!(
       40980  +
                                input.header_boolean_list,
       40981  +
                                expected.header_boolean_list,
       40982  +
                                "Unexpected value for `header_boolean_list`"
       40983  +
                            );
       40984  +
                            ::pretty_assertions::assert_eq!(
       40985  +
                                input.header_timestamp_list,
       40986  +
                                expected.header_timestamp_list,
       40987  +
                                "Unexpected value for `header_timestamp_list`"
       40988  +
                            );
       40989  +
                            ::pretty_assertions::assert_eq!(
       40990  +
                                input.header_enum,
       40991  +
                                expected.header_enum,
       40992  +
                                "Unexpected value for `header_enum`"
       40993  +
                            );
       40994  +
                            ::pretty_assertions::assert_eq!(
       40995  +
                                input.header_enum_list,
       40996  +
                                expected.header_enum_list,
       40997  +
                                "Unexpected value for `header_enum_list`"
       40998  +
                            );
       40999  +
                            ::pretty_assertions::assert_eq!(
       41000  +
                                input.header_integer_enum,
       41001  +
                                expected.header_integer_enum,
       41002  +
                                "Unexpected value for `header_integer_enum`"
       41003  +
                            );
       41004  +
                            ::pretty_assertions::assert_eq!(
       41005  +
                                input.header_integer_enum_list,
       41006  +
                                expected.header_integer_enum_list,
       41007  +
                                "Unexpected value for `header_integer_enum_list`"
       41008  +
                            );
       41009  +
                            let response = crate::output::InputAndOutputWithHeadersOutput {
       41010  +
                                header_string: ::std::option::Option::None,
       41011  +
                                header_byte: ::std::option::Option::None,
       41012  +
                                header_short: ::std::option::Option::None,
       41013  +
                                header_integer: ::std::option::Option::None,
       41014  +
                                header_long: ::std::option::Option::None,
       41015  +
                                header_float: ::std::option::Option::None,
       41016  +
                                header_double: ::std::option::Option::None,
       41017  +
                                header_true_bool: ::std::option::Option::None,
       41018  +
                                header_false_bool: ::std::option::Option::None,
       41019  +
                                header_string_list: ::std::option::Option::None,
       41020  +
                                header_string_set: ::std::option::Option::None,
       41021  +
                                header_integer_list: ::std::option::Option::None,
       41022  +
                                header_boolean_list: ::std::option::Option::None,
       41023  +
                                header_timestamp_list: ::std::option::Option::None,
       41024  +
                                header_enum: ::std::option::Option::None,
       41025  +
                                header_enum_list: ::std::option::Option::None,
       41026  +
                                header_integer_enum: ::std::option::Option::None,
       41027  +
                                header_integer_enum_list: ::std::option::Option::None,
       41028  +
                            };
       41029  +
                            Ok(response)
       41030  +
                        };
       41031  +
                        sender.send(()).await.expect("receiver dropped early");
       41032  +
                        result
40748  41033   
                    }
40749         -
}
40750         -
impl
40751         -
    ::aws_smithy_http_server::response::IntoResponse<
40752         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40753         -
    > for crate::error::HttpRequestWithLabelsError
40754         -
{
40755         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40756         -
        match crate::protocol_serde::shape_http_request_with_labels::ser_http_request_with_labels_http_error(&self) {
40757         -
            Ok(mut response) => {
40758         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
40759         -
                response
40760  41034   
                },
40761         -
            Err(e) => {
40762         -
                ::tracing::error!(error = %e, "failed to serialize response");
40763         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40764         -
            }
40765         -
        }
40766         -
    }
40767         -
}
40768         -
40769         -
const CONTENT_TYPE_MEDIATYPEHEADER: ::mime::Mime = ::mime::APPLICATION_JSON;
40770         -
::pin_project_lite::pin_project! {
40771         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40772         -
    /// [`MediaTypeHeaderInput`](crate::input::MediaTypeHeaderInput) using modelled bindings.
40773         -
    pub struct MediaTypeHeaderInputFuture {
40774         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MediaTypeHeaderInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40775         -
    }
40776         -
}
40777         -
40778         -
impl std::future::Future for MediaTypeHeaderInputFuture {
40779         -
    type Output = Result<
40780         -
        crate::input::MediaTypeHeaderInput,
40781         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40782         -
    >;
40783         -
40784         -
    fn poll(
40785         -
        self: std::pin::Pin<&mut Self>,
40786         -
        cx: &mut std::task::Context<'_>,
40787         -
    ) -> std::task::Poll<Self::Output> {
40788         -
        let this = self.project();
40789         -
        this.inner.as_mut().poll(cx)
40790         -
    }
40791         -
}
40792         -
40793         -
impl<B>
40794         -
    ::aws_smithy_http_server::request::FromRequest<
40795         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40796         -
        B,
40797         -
    > for crate::input::MediaTypeHeaderInput
40798         -
where
40799         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40800         -
    B: 'static,
40801         -
40802         -
    B::Data: Send,
40803         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40804         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40805         -
{
40806         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40807         -
    type Future = MediaTypeHeaderInputFuture;
40808         -
40809         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40810         -
        let fut = async move {
40811         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40812         -
                request.headers(),
40813         -
                &CONTENT_TYPE_MEDIATYPEHEADER,
40814         -
            ) {
40815         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
40816         -
            }
40817         -
            crate::protocol_serde::shape_media_type_header::de_media_type_header_http_request(
40818         -
                request,
40819  41035   
            )
       41036  +
            .build_unchecked();
       41037  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
40820  41038   
            .await
40821         -
            .map_err(Into::into)
40822         -
        };
40823         -
        use ::futures_util::future::TryFutureExt;
40824         -
        let fut = fut.map_err(
40825         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40826         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40827         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40828         -
                    e,
40829         -
                )
40830         -
            },
       41039  +
            .expect("unable to make an HTTP request");
       41040  +
        assert!(
       41041  +
            receiver.recv().await.is_some(),
       41042  +
            "we expected operation handler to be invoked but it was not entered"
40831  41043   
        );
40832         -
        MediaTypeHeaderInputFuture {
40833         -
            inner: Box::pin(fut),
40834         -
        }
40835         -
    }
40836         -
}
40837         -
impl
40838         -
    ::aws_smithy_http_server::response::IntoResponse<
40839         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40840         -
    > for crate::output::MediaTypeHeaderOutput
40841         -
{
40842         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40843         -
        match crate::protocol_serde::shape_media_type_header::ser_media_type_header_http_response(
40844         -
            self,
40845         -
        ) {
40846         -
            Ok(response) => response,
40847         -
            Err(e) => {
40848         -
                ::tracing::error!(error = %e, "failed to serialize response");
40849         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40850         -
            }
40851  41044   
    }
       41045  +
    /// Supports handling NaN float header values.
       41046  +
    /// Test ID: RestJsonSupportsNaNFloatHeaderInputs
       41047  +
    #[::tokio::test]
       41048  +
    #[::tracing_test::traced_test]
       41049  +
    async fn rest_json_supports_na_n_float_header_inputs_request() {
       41050  +
        #[allow(unused_mut)]
       41051  +
        let mut http_request = http::Request::builder()
       41052  +
            .uri("/InputAndOutputWithHeaders")
       41053  +
            .method("POST")
       41054  +
            .header("X-Double", "NaN")
       41055  +
            .header("X-Float", "NaN")
       41056  +
            .body(::aws_smithy_http_server::body::Body::from(
       41057  +
                ::bytes::Bytes::from_static("".as_bytes()),
       41058  +
            ))
       41059  +
            .unwrap();
       41060  +
        #[allow(unused_mut)]
       41061  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       41062  +
        let config = crate::service::RestJsonConfig::builder().build();
       41063  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       41064  +
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
       41065  +
                            let sender = sender.clone();
       41066  +
                            async move {
       41067  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       41068  +
        let expected =
       41069  +
            crate::input::InputAndOutputWithHeadersInput {
       41070  +
                header_float:
       41071  +
                    ::std::option::Option::Some(
       41072  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
       41073  +
                    )
       41074  +
                ,
       41075  +
                header_double:
       41076  +
                    ::std::option::Option::Some(
       41077  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number")
       41078  +
                    )
       41079  +
                ,
       41080  +
                header_string:
       41081  +
                    ::std::option::Option::None
       41082  +
                ,
       41083  +
                header_byte:
       41084  +
                    ::std::option::Option::None
       41085  +
                ,
       41086  +
                header_short:
       41087  +
                    ::std::option::Option::None
       41088  +
                ,
       41089  +
                header_integer:
       41090  +
                    ::std::option::Option::None
       41091  +
                ,
       41092  +
                header_long:
       41093  +
                    ::std::option::Option::None
       41094  +
                ,
       41095  +
                header_true_bool:
       41096  +
                    ::std::option::Option::None
       41097  +
                ,
       41098  +
                header_false_bool:
       41099  +
                    ::std::option::Option::None
       41100  +
                ,
       41101  +
                header_string_list:
       41102  +
                    ::std::option::Option::None
       41103  +
                ,
       41104  +
                header_string_set:
       41105  +
                    ::std::option::Option::None
       41106  +
                ,
       41107  +
                header_integer_list:
       41108  +
                    ::std::option::Option::None
       41109  +
                ,
       41110  +
                header_boolean_list:
       41111  +
                    ::std::option::Option::None
       41112  +
                ,
       41113  +
                header_timestamp_list:
       41114  +
                    ::std::option::Option::None
       41115  +
                ,
       41116  +
                header_enum:
       41117  +
                    ::std::option::Option::None
       41118  +
                ,
       41119  +
                header_enum_list:
       41120  +
                    ::std::option::Option::None
       41121  +
                ,
       41122  +
                header_integer_enum:
       41123  +
                    ::std::option::Option::None
       41124  +
                ,
       41125  +
                header_integer_enum_list:
       41126  +
                    ::std::option::Option::None
       41127  +
                ,
40852  41128   
            }
40853         -
}
40854         -
40855         -
const CONTENT_TYPE_TIMESTAMPFORMATHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
40856         -
::pin_project_lite::pin_project! {
40857         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40858         -
    /// [`TimestampFormatHeadersInput`](crate::input::TimestampFormatHeadersInput) using modelled bindings.
40859         -
    pub struct TimestampFormatHeadersInputFuture {
40860         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::TimestampFormatHeadersInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
40861         -
    }
40862         -
}
40863         -
40864         -
impl std::future::Future for TimestampFormatHeadersInputFuture {
40865         -
    type Output = Result<
40866         -
        crate::input::TimestampFormatHeadersInput,
40867         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40868         -
    >;
40869         -
40870         -
    fn poll(
40871         -
        self: std::pin::Pin<&mut Self>,
40872         -
        cx: &mut std::task::Context<'_>,
40873         -
    ) -> std::task::Poll<Self::Output> {
40874         -
        let this = self.project();
40875         -
        this.inner.as_mut().poll(cx)
       41129  +
        ;
       41130  +
        ::pretty_assertions::assert_eq!(input.header_string, expected.header_string, "Unexpected value for `header_string`");
       41131  +
        ::pretty_assertions::assert_eq!(input.header_byte, expected.header_byte, "Unexpected value for `header_byte`");
       41132  +
        ::pretty_assertions::assert_eq!(input.header_short, expected.header_short, "Unexpected value for `header_short`");
       41133  +
        ::pretty_assertions::assert_eq!(input.header_integer, expected.header_integer, "Unexpected value for `header_integer`");
       41134  +
        ::pretty_assertions::assert_eq!(input.header_long, expected.header_long, "Unexpected value for `header_long`");
       41135  +
        assert!(input.header_float.float_equals(&expected.header_float),
       41136  +
                                            "Unexpected value for `header_float` {:?} vs. {:?}", expected.header_float, input.header_float);
       41137  +
        assert!(input.header_double.float_equals(&expected.header_double),
       41138  +
                                            "Unexpected value for `header_double` {:?} vs. {:?}", expected.header_double, input.header_double);
       41139  +
        ::pretty_assertions::assert_eq!(input.header_true_bool, expected.header_true_bool, "Unexpected value for `header_true_bool`");
       41140  +
        ::pretty_assertions::assert_eq!(input.header_false_bool, expected.header_false_bool, "Unexpected value for `header_false_bool`");
       41141  +
        ::pretty_assertions::assert_eq!(input.header_string_list, expected.header_string_list, "Unexpected value for `header_string_list`");
       41142  +
        ::pretty_assertions::assert_eq!(input.header_string_set, expected.header_string_set, "Unexpected value for `header_string_set`");
       41143  +
        ::pretty_assertions::assert_eq!(input.header_integer_list, expected.header_integer_list, "Unexpected value for `header_integer_list`");
       41144  +
        ::pretty_assertions::assert_eq!(input.header_boolean_list, expected.header_boolean_list, "Unexpected value for `header_boolean_list`");
       41145  +
        ::pretty_assertions::assert_eq!(input.header_timestamp_list, expected.header_timestamp_list, "Unexpected value for `header_timestamp_list`");
       41146  +
        ::pretty_assertions::assert_eq!(input.header_enum, expected.header_enum, "Unexpected value for `header_enum`");
       41147  +
        ::pretty_assertions::assert_eq!(input.header_enum_list, expected.header_enum_list, "Unexpected value for `header_enum_list`");
       41148  +
        ::pretty_assertions::assert_eq!(input.header_integer_enum, expected.header_integer_enum, "Unexpected value for `header_integer_enum`");
       41149  +
        ::pretty_assertions::assert_eq!(input.header_integer_enum_list, expected.header_integer_enum_list, "Unexpected value for `header_integer_enum_list`");
       41150  +
        let response =
       41151  +
            crate::output::InputAndOutputWithHeadersOutput {
       41152  +
                header_string:
       41153  +
                    ::std::option::Option::None
       41154  +
                ,
       41155  +
                header_byte:
       41156  +
                    ::std::option::Option::None
       41157  +
                ,
       41158  +
                header_short:
       41159  +
                    ::std::option::Option::None
       41160  +
                ,
       41161  +
                header_integer:
       41162  +
                    ::std::option::Option::None
       41163  +
                ,
       41164  +
                header_long:
       41165  +
                    ::std::option::Option::None
       41166  +
                ,
       41167  +
                header_float:
       41168  +
                    ::std::option::Option::None
       41169  +
                ,
       41170  +
                header_double:
       41171  +
                    ::std::option::Option::None
       41172  +
                ,
       41173  +
                header_true_bool:
       41174  +
                    ::std::option::Option::None
       41175  +
                ,
       41176  +
                header_false_bool:
       41177  +
                    ::std::option::Option::None
       41178  +
                ,
       41179  +
                header_string_list:
       41180  +
                    ::std::option::Option::None
       41181  +
                ,
       41182  +
                header_string_set:
       41183  +
                    ::std::option::Option::None
       41184  +
                ,
       41185  +
                header_integer_list:
       41186  +
                    ::std::option::Option::None
       41187  +
                ,
       41188  +
                header_boolean_list:
       41189  +
                    ::std::option::Option::None
       41190  +
                ,
       41191  +
                header_timestamp_list:
       41192  +
                    ::std::option::Option::None
       41193  +
                ,
       41194  +
                header_enum:
       41195  +
                    ::std::option::Option::None
       41196  +
                ,
       41197  +
                header_enum_list:
       41198  +
                    ::std::option::Option::None
       41199  +
                ,
       41200  +
                header_integer_enum:
       41201  +
                    ::std::option::Option::None
       41202  +
                ,
       41203  +
                header_integer_enum_list:
       41204  +
                    ::std::option::Option::None
       41205  +
                ,
40876  41206   
            }
40877         -
}
40878         -
40879         -
impl<B>
40880         -
    ::aws_smithy_http_server::request::FromRequest<
40881         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40882         -
        B,
40883         -
    > for crate::input::TimestampFormatHeadersInput
40884         -
where
40885         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40886         -
    B: 'static,
40887         -
40888         -
    B::Data: Send,
40889         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40890         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40891         -
{
40892         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40893         -
    type Future = TimestampFormatHeadersInputFuture;
40894         -
40895         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40896         -
        let fut = async move {
40897         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40898         -
                request.headers(),
40899         -
                &CONTENT_TYPE_TIMESTAMPFORMATHEADERS,
40900         -
            ) {
40901         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       41207  +
        ;
       41208  +
        Ok(response) };
       41209  +
                                sender.send(()).await.expect("receiver dropped early");
       41210  +
                                result
40902  41211   
                            }
40903         -
            crate::protocol_serde::shape_timestamp_format_headers::de_timestamp_format_headers_http_request(request)
       41212  +
                        })
       41213  +
                        .build_unchecked();
       41214  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
40904  41215   
            .await
40905         -
                            .map_err(Into::into)
40906         -
        };
40907         -
        use ::futures_util::future::TryFutureExt;
40908         -
        let fut = fut.map_err(
40909         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40910         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40911         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40912         -
                    e,
40913         -
                )
40914         -
            },
       41216  +
            .expect("unable to make an HTTP request");
       41217  +
        assert!(
       41218  +
            receiver.recv().await.is_some(),
       41219  +
            "we expected operation handler to be invoked but it was not entered"
40915  41220   
        );
40916         -
        TimestampFormatHeadersInputFuture {
40917         -
            inner: Box::pin(fut),
40918         -
        }
40919  41221   
    }
40920         -
}
40921         -
impl
40922         -
    ::aws_smithy_http_server::response::IntoResponse<
40923         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40924         -
    > for crate::output::TimestampFormatHeadersOutput
40925         -
{
40926         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
40927         -
        match crate::protocol_serde::shape_timestamp_format_headers::ser_timestamp_format_headers_http_response(self) {
40928         -
                        Ok(response) => response,
40929         -
                        Err(e) => {
40930         -
                            ::tracing::error!(error = %e, "failed to serialize response");
40931         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
40932         -
                        }
40933         -
                    }
40934         -
    }
40935         -
}
40936         -
40937         -
const CONTENT_TYPE_NULLANDEMPTYHEADERSSERVER: ::mime::Mime = ::mime::APPLICATION_JSON;
40938         -
::pin_project_lite::pin_project! {
40939         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
40940         -
    /// [`NullAndEmptyHeadersServerInput`](crate::input::NullAndEmptyHeadersServerInput) using modelled bindings.
40941         -
    pub struct NullAndEmptyHeadersServerInputFuture {
40942         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::NullAndEmptyHeadersServerInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       41222  +
    /// Supports handling Infinity float header values.
       41223  +
    /// Test ID: RestJsonSupportsInfinityFloatHeaderInputs
       41224  +
    #[::tokio::test]
       41225  +
    #[::tracing_test::traced_test]
       41226  +
    async fn rest_json_supports_infinity_float_header_inputs_request() {
       41227  +
        #[allow(unused_mut)]
       41228  +
        let mut http_request = http::Request::builder()
       41229  +
            .uri("/InputAndOutputWithHeaders")
       41230  +
            .method("POST")
       41231  +
            .header("X-Double", "Infinity")
       41232  +
            .header("X-Float", "Infinity")
       41233  +
            .body(::aws_smithy_http_server::body::Body::from(
       41234  +
                ::bytes::Bytes::from_static("".as_bytes()),
       41235  +
            ))
       41236  +
            .unwrap();
       41237  +
        #[allow(unused_mut)]
       41238  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       41239  +
        let config = crate::service::RestJsonConfig::builder().build();
       41240  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       41241  +
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
       41242  +
                            let sender = sender.clone();
       41243  +
                            async move {
       41244  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       41245  +
        let expected =
       41246  +
            crate::input::InputAndOutputWithHeadersInput {
       41247  +
                header_float:
       41248  +
                    ::std::option::Option::Some(
       41249  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       41250  +
                    )
       41251  +
                ,
       41252  +
                header_double:
       41253  +
                    ::std::option::Option::Some(
       41254  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number")
       41255  +
                    )
       41256  +
                ,
       41257  +
                header_string:
       41258  +
                    ::std::option::Option::None
       41259  +
                ,
       41260  +
                header_byte:
       41261  +
                    ::std::option::Option::None
       41262  +
                ,
       41263  +
                header_short:
       41264  +
                    ::std::option::Option::None
       41265  +
                ,
       41266  +
                header_integer:
       41267  +
                    ::std::option::Option::None
       41268  +
                ,
       41269  +
                header_long:
       41270  +
                    ::std::option::Option::None
       41271  +
                ,
       41272  +
                header_true_bool:
       41273  +
                    ::std::option::Option::None
       41274  +
                ,
       41275  +
                header_false_bool:
       41276  +
                    ::std::option::Option::None
       41277  +
                ,
       41278  +
                header_string_list:
       41279  +
                    ::std::option::Option::None
       41280  +
                ,
       41281  +
                header_string_set:
       41282  +
                    ::std::option::Option::None
       41283  +
                ,
       41284  +
                header_integer_list:
       41285  +
                    ::std::option::Option::None
       41286  +
                ,
       41287  +
                header_boolean_list:
       41288  +
                    ::std::option::Option::None
       41289  +
                ,
       41290  +
                header_timestamp_list:
       41291  +
                    ::std::option::Option::None
       41292  +
                ,
       41293  +
                header_enum:
       41294  +
                    ::std::option::Option::None
       41295  +
                ,
       41296  +
                header_enum_list:
       41297  +
                    ::std::option::Option::None
       41298  +
                ,
       41299  +
                header_integer_enum:
       41300  +
                    ::std::option::Option::None
       41301  +
                ,
       41302  +
                header_integer_enum_list:
       41303  +
                    ::std::option::Option::None
       41304  +
                ,
40943  41305   
            }
40944         -
}
40945         -
40946         -
impl std::future::Future for NullAndEmptyHeadersServerInputFuture {
40947         -
    type Output = Result<
40948         -
        crate::input::NullAndEmptyHeadersServerInput,
40949         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
40950         -
    >;
40951         -
40952         -
    fn poll(
40953         -
        self: std::pin::Pin<&mut Self>,
40954         -
        cx: &mut std::task::Context<'_>,
40955         -
    ) -> std::task::Poll<Self::Output> {
40956         -
        let this = self.project();
40957         -
        this.inner.as_mut().poll(cx)
       41306  +
        ;
       41307  +
        ::pretty_assertions::assert_eq!(input.header_string, expected.header_string, "Unexpected value for `header_string`");
       41308  +
        ::pretty_assertions::assert_eq!(input.header_byte, expected.header_byte, "Unexpected value for `header_byte`");
       41309  +
        ::pretty_assertions::assert_eq!(input.header_short, expected.header_short, "Unexpected value for `header_short`");
       41310  +
        ::pretty_assertions::assert_eq!(input.header_integer, expected.header_integer, "Unexpected value for `header_integer`");
       41311  +
        ::pretty_assertions::assert_eq!(input.header_long, expected.header_long, "Unexpected value for `header_long`");
       41312  +
        assert!(input.header_float.float_equals(&expected.header_float),
       41313  +
                                            "Unexpected value for `header_float` {:?} vs. {:?}", expected.header_float, input.header_float);
       41314  +
        assert!(input.header_double.float_equals(&expected.header_double),
       41315  +
                                            "Unexpected value for `header_double` {:?} vs. {:?}", expected.header_double, input.header_double);
       41316  +
        ::pretty_assertions::assert_eq!(input.header_true_bool, expected.header_true_bool, "Unexpected value for `header_true_bool`");
       41317  +
        ::pretty_assertions::assert_eq!(input.header_false_bool, expected.header_false_bool, "Unexpected value for `header_false_bool`");
       41318  +
        ::pretty_assertions::assert_eq!(input.header_string_list, expected.header_string_list, "Unexpected value for `header_string_list`");
       41319  +
        ::pretty_assertions::assert_eq!(input.header_string_set, expected.header_string_set, "Unexpected value for `header_string_set`");
       41320  +
        ::pretty_assertions::assert_eq!(input.header_integer_list, expected.header_integer_list, "Unexpected value for `header_integer_list`");
       41321  +
        ::pretty_assertions::assert_eq!(input.header_boolean_list, expected.header_boolean_list, "Unexpected value for `header_boolean_list`");
       41322  +
        ::pretty_assertions::assert_eq!(input.header_timestamp_list, expected.header_timestamp_list, "Unexpected value for `header_timestamp_list`");
       41323  +
        ::pretty_assertions::assert_eq!(input.header_enum, expected.header_enum, "Unexpected value for `header_enum`");
       41324  +
        ::pretty_assertions::assert_eq!(input.header_enum_list, expected.header_enum_list, "Unexpected value for `header_enum_list`");
       41325  +
        ::pretty_assertions::assert_eq!(input.header_integer_enum, expected.header_integer_enum, "Unexpected value for `header_integer_enum`");
       41326  +
        ::pretty_assertions::assert_eq!(input.header_integer_enum_list, expected.header_integer_enum_list, "Unexpected value for `header_integer_enum_list`");
       41327  +
        let response =
       41328  +
            crate::output::InputAndOutputWithHeadersOutput {
       41329  +
                header_string:
       41330  +
                    ::std::option::Option::None
       41331  +
                ,
       41332  +
                header_byte:
       41333  +
                    ::std::option::Option::None
       41334  +
                ,
       41335  +
                header_short:
       41336  +
                    ::std::option::Option::None
       41337  +
                ,
       41338  +
                header_integer:
       41339  +
                    ::std::option::Option::None
       41340  +
                ,
       41341  +
                header_long:
       41342  +
                    ::std::option::Option::None
       41343  +
                ,
       41344  +
                header_float:
       41345  +
                    ::std::option::Option::None
       41346  +
                ,
       41347  +
                header_double:
       41348  +
                    ::std::option::Option::None
       41349  +
                ,
       41350  +
                header_true_bool:
       41351  +
                    ::std::option::Option::None
       41352  +
                ,
       41353  +
                header_false_bool:
       41354  +
                    ::std::option::Option::None
       41355  +
                ,
       41356  +
                header_string_list:
       41357  +
                    ::std::option::Option::None
       41358  +
                ,
       41359  +
                header_string_set:
       41360  +
                    ::std::option::Option::None
       41361  +
                ,
       41362  +
                header_integer_list:
       41363  +
                    ::std::option::Option::None
       41364  +
                ,
       41365  +
                header_boolean_list:
       41366  +
                    ::std::option::Option::None
       41367  +
                ,
       41368  +
                header_timestamp_list:
       41369  +
                    ::std::option::Option::None
       41370  +
                ,
       41371  +
                header_enum:
       41372  +
                    ::std::option::Option::None
       41373  +
                ,
       41374  +
                header_enum_list:
       41375  +
                    ::std::option::Option::None
       41376  +
                ,
       41377  +
                header_integer_enum:
       41378  +
                    ::std::option::Option::None
       41379  +
                ,
       41380  +
                header_integer_enum_list:
       41381  +
                    ::std::option::Option::None
       41382  +
                ,
40958  41383   
            }
40959         -
}
40960         -
40961         -
impl<B>
40962         -
    ::aws_smithy_http_server::request::FromRequest<
40963         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
40964         -
        B,
40965         -
    > for crate::input::NullAndEmptyHeadersServerInput
40966         -
where
40967         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
40968         -
    B: 'static,
40969         -
40970         -
    B::Data: Send,
40971         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
40972         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
40973         -
{
40974         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
40975         -
    type Future = NullAndEmptyHeadersServerInputFuture;
40976         -
40977         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
40978         -
        let fut = async move {
40979         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
40980         -
                request.headers(),
40981         -
                &CONTENT_TYPE_NULLANDEMPTYHEADERSSERVER,
40982         -
            ) {
40983         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       41384  +
        ;
       41385  +
        Ok(response) };
       41386  +
                                sender.send(()).await.expect("receiver dropped early");
       41387  +
                                result
40984  41388   
                            }
40985         -
            crate::protocol_serde::shape_null_and_empty_headers_server::de_null_and_empty_headers_server_http_request(request)
       41389  +
                        })
       41390  +
                        .build_unchecked();
       41391  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
40986  41392   
            .await
40987         -
                            .map_err(Into::into)
40988         -
        };
40989         -
        use ::futures_util::future::TryFutureExt;
40990         -
        let fut = fut.map_err(
40991         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
40992         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
40993         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
40994         -
                    e,
40995         -
                )
40996         -
            },
       41393  +
            .expect("unable to make an HTTP request");
       41394  +
        assert!(
       41395  +
            receiver.recv().await.is_some(),
       41396  +
            "we expected operation handler to be invoked but it was not entered"
40997  41397   
        );
40998         -
        NullAndEmptyHeadersServerInputFuture {
40999         -
            inner: Box::pin(fut),
41000         -
        }
41001         -
    }
41002         -
}
41003         -
impl
41004         -
    ::aws_smithy_http_server::response::IntoResponse<
41005         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
41006         -
    > for crate::output::NullAndEmptyHeadersServerOutput
41007         -
{
41008         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
41009         -
        match crate::protocol_serde::shape_null_and_empty_headers_server::ser_null_and_empty_headers_server_http_response(self) {
41010         -
                        Ok(response) => response,
41011         -
                        Err(e) => {
41012         -
                            ::tracing::error!(error = %e, "failed to serialize response");
41013         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
41014  41398   
    }
       41399  +
    /// Supports handling -Infinity float header values.
       41400  +
    /// Test ID: RestJsonSupportsNegativeInfinityFloatHeaderInputs
       41401  +
    #[::tokio::test]
       41402  +
    #[::tracing_test::traced_test]
       41403  +
    async fn rest_json_supports_negative_infinity_float_header_inputs_request() {
       41404  +
        #[allow(unused_mut)]
       41405  +
        let mut http_request = http::Request::builder()
       41406  +
            .uri("/InputAndOutputWithHeaders")
       41407  +
            .method("POST")
       41408  +
            .header("X-Double", "-Infinity")
       41409  +
            .header("X-Float", "-Infinity")
       41410  +
            .body(::aws_smithy_http_server::body::Body::from(
       41411  +
                ::bytes::Bytes::from_static("".as_bytes()),
       41412  +
            ))
       41413  +
            .unwrap();
       41414  +
        #[allow(unused_mut)]
       41415  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       41416  +
        let config = crate::service::RestJsonConfig::builder().build();
       41417  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       41418  +
                        .input_and_output_with_headers(move |input: crate::input::InputAndOutputWithHeadersInput| {
       41419  +
                            let sender = sender.clone();
       41420  +
                            async move {
       41421  +
                                let result = { use ::aws_smithy_protocol_test::FloatEquals;
       41422  +
        let expected =
       41423  +
            crate::input::InputAndOutputWithHeadersInput {
       41424  +
                header_float:
       41425  +
                    ::std::option::Option::Some(
       41426  +
                        <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
       41427  +
                    )
       41428  +
                ,
       41429  +
                header_double:
       41430  +
                    ::std::option::Option::Some(
       41431  +
                        <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number")
       41432  +
                    )
       41433  +
                ,
       41434  +
                header_string:
       41435  +
                    ::std::option::Option::None
       41436  +
                ,
       41437  +
                header_byte:
       41438  +
                    ::std::option::Option::None
       41439  +
                ,
       41440  +
                header_short:
       41441  +
                    ::std::option::Option::None
       41442  +
                ,
       41443  +
                header_integer:
       41444  +
                    ::std::option::Option::None
       41445  +
                ,
       41446  +
                header_long:
       41447  +
                    ::std::option::Option::None
       41448  +
                ,
       41449  +
                header_true_bool:
       41450  +
                    ::std::option::Option::None
       41451  +
                ,
       41452  +
                header_false_bool:
       41453  +
                    ::std::option::Option::None
       41454  +
                ,
       41455  +
                header_string_list:
       41456  +
                    ::std::option::Option::None
       41457  +
                ,
       41458  +
                header_string_set:
       41459  +
                    ::std::option::Option::None
       41460  +
                ,
       41461  +
                header_integer_list:
       41462  +
                    ::std::option::Option::None
       41463  +
                ,
       41464  +
                header_boolean_list:
       41465  +
                    ::std::option::Option::None
       41466  +
                ,
       41467  +
                header_timestamp_list:
       41468  +
                    ::std::option::Option::None
       41469  +
                ,
       41470  +
                header_enum:
       41471  +
                    ::std::option::Option::None
       41472  +
                ,
       41473  +
                header_enum_list:
       41474  +
                    ::std::option::Option::None
       41475  +
                ,
       41476  +
                header_integer_enum:
       41477  +
                    ::std::option::Option::None
       41478  +
                ,
       41479  +
                header_integer_enum_list:
       41480  +
                    ::std::option::Option::None
       41481  +
                ,
41015  41482   
            }
       41483  +
        ;
       41484  +
        ::pretty_assertions::assert_eq!(input.header_string, expected.header_string, "Unexpected value for `header_string`");
       41485  +
        ::pretty_assertions::assert_eq!(input.header_byte, expected.header_byte, "Unexpected value for `header_byte`");
       41486  +
        ::pretty_assertions::assert_eq!(input.header_short, expected.header_short, "Unexpected value for `header_short`");
       41487  +
        ::pretty_assertions::assert_eq!(input.header_integer, expected.header_integer, "Unexpected value for `header_integer`");
       41488  +
        ::pretty_assertions::assert_eq!(input.header_long, expected.header_long, "Unexpected value for `header_long`");
       41489  +
        assert!(input.header_float.float_equals(&expected.header_float),
       41490  +
                                            "Unexpected value for `header_float` {:?} vs. {:?}", expected.header_float, input.header_float);
       41491  +
        assert!(input.header_double.float_equals(&expected.header_double),
       41492  +
                                            "Unexpected value for `header_double` {:?} vs. {:?}", expected.header_double, input.header_double);
       41493  +
        ::pretty_assertions::assert_eq!(input.header_true_bool, expected.header_true_bool, "Unexpected value for `header_true_bool`");
       41494  +
        ::pretty_assertions::assert_eq!(input.header_false_bool, expected.header_false_bool, "Unexpected value for `header_false_bool`");
       41495  +
        ::pretty_assertions::assert_eq!(input.header_string_list, expected.header_string_list, "Unexpected value for `header_string_list`");
       41496  +
        ::pretty_assertions::assert_eq!(input.header_string_set, expected.header_string_set, "Unexpected value for `header_string_set`");
       41497  +
        ::pretty_assertions::assert_eq!(input.header_integer_list, expected.header_integer_list, "Unexpected value for `header_integer_list`");
       41498  +
        ::pretty_assertions::assert_eq!(input.header_boolean_list, expected.header_boolean_list, "Unexpected value for `header_boolean_list`");
       41499  +
        ::pretty_assertions::assert_eq!(input.header_timestamp_list, expected.header_timestamp_list, "Unexpected value for `header_timestamp_list`");
       41500  +
        ::pretty_assertions::assert_eq!(input.header_enum, expected.header_enum, "Unexpected value for `header_enum`");
       41501  +
        ::pretty_assertions::assert_eq!(input.header_enum_list, expected.header_enum_list, "Unexpected value for `header_enum_list`");
       41502  +
        ::pretty_assertions::assert_eq!(input.header_integer_enum, expected.header_integer_enum, "Unexpected value for `header_integer_enum`");
       41503  +
        ::pretty_assertions::assert_eq!(input.header_integer_enum_list, expected.header_integer_enum_list, "Unexpected value for `header_integer_enum_list`");
       41504  +
        let response =
       41505  +
            crate::output::InputAndOutputWithHeadersOutput {
       41506  +
                header_string:
       41507  +
                    ::std::option::Option::None
       41508  +
                ,
       41509  +
                header_byte:
       41510  +
                    ::std::option::Option::None
       41511  +
                ,
       41512  +
                header_short:
       41513  +
                    ::std::option::Option::None
       41514  +
                ,
       41515  +
                header_integer:
       41516  +
                    ::std::option::Option::None
       41517  +
                ,
       41518  +
                header_long:
       41519  +
                    ::std::option::Option::None
       41520  +
                ,
       41521  +
                header_float:
       41522  +
                    ::std::option::Option::None
       41523  +
                ,
       41524  +
                header_double:
       41525  +
                    ::std::option::Option::None
       41526  +
                ,
       41527  +
                header_true_bool:
       41528  +
                    ::std::option::Option::None
       41529  +
                ,
       41530  +
                header_false_bool:
       41531  +
                    ::std::option::Option::None
       41532  +
                ,
       41533  +
                header_string_list:
       41534  +
                    ::std::option::Option::None
       41535  +
                ,
       41536  +
                header_string_set:
       41537  +
                    ::std::option::Option::None
       41538  +
                ,
       41539  +
                header_integer_list:
       41540  +
                    ::std::option::Option::None
       41541  +
                ,
       41542  +
                header_boolean_list:
       41543  +
                    ::std::option::Option::None
       41544  +
                ,
       41545  +
                header_timestamp_list:
       41546  +
                    ::std::option::Option::None
       41547  +
                ,
       41548  +
                header_enum:
       41549  +
                    ::std::option::Option::None
       41550  +
                ,
       41551  +
                header_enum_list:
       41552  +
                    ::std::option::Option::None
       41553  +
                ,
       41554  +
                header_integer_enum:
       41555  +
                    ::std::option::Option::None
       41556  +
                ,
       41557  +
                header_integer_enum_list:
       41558  +
                    ::std::option::Option::None
       41559  +
                ,
41016  41560   
            }
41017         -
}
41018         -
41019         -
const CONTENT_TYPE_NULLANDEMPTYHEADERSCLIENT: ::mime::Mime = ::mime::APPLICATION_JSON;
41020         -
::pin_project_lite::pin_project! {
41021         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
41022         -
    /// [`NullAndEmptyHeadersClientInput`](crate::input::NullAndEmptyHeadersClientInput) using modelled bindings.
41023         -
    pub struct NullAndEmptyHeadersClientInputFuture {
41024         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::NullAndEmptyHeadersClientInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       41561  +
        ;
       41562  +
        Ok(response) };
       41563  +
                                sender.send(()).await.expect("receiver dropped early");
       41564  +
                                result
41025  41565   
                            }
41026         -
}
41027         -
41028         -
impl std::future::Future for NullAndEmptyHeadersClientInputFuture {
41029         -
    type Output = Result<
41030         -
        crate::input::NullAndEmptyHeadersClientInput,
41031         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
41032         -
    >;
41033         -
41034         -
    fn poll(
41035         -
        self: std::pin::Pin<&mut Self>,
41036         -
        cx: &mut std::task::Context<'_>,
41037         -
    ) -> std::task::Poll<Self::Output> {
41038         -
        let this = self.project();
41039         -
        this.inner.as_mut().poll(cx)
       41566  +
                        })
       41567  +
                        .build_unchecked();
       41568  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       41569  +
            .await
       41570  +
            .expect("unable to make an HTTP request");
       41571  +
        assert!(
       41572  +
            receiver.recv().await.is_some(),
       41573  +
            "we expected operation handler to be invoked but it was not entered"
       41574  +
        );
41040  41575   
    }
41041         -
}
41042         -
41043         -
impl<B>
41044         -
    ::aws_smithy_http_server::request::FromRequest<
41045         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
41046         -
        B,
41047         -
    > for crate::input::NullAndEmptyHeadersClientInput
41048         -
where
41049         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
41050         -
    B: 'static,
41051         -
41052         -
    B::Data: Send,
41053         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
41054         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
41055         -
{
41056         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
41057         -
    type Future = NullAndEmptyHeadersClientInputFuture;
41058         -
41059         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
41060         -
        let fut = async move {
41061         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
41062         -
                request.headers(),
41063         -
                &CONTENT_TYPE_NULLANDEMPTYHEADERSCLIENT,
41064         -
            ) {
41065         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       41576  +
    /// Tests responses with string header bindings
       41577  +
    /// Test ID: RestJsonInputAndOutputWithStringHeaders
       41578  +
    #[::tokio::test]
       41579  +
    #[::tracing_test::traced_test]
       41580  +
    async fn rest_json_input_and_output_with_string_headers_response() {
       41581  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41582  +
            header_string: ::std::option::Option::Some("Hello".to_owned()),
       41583  +
            header_string_list: ::std::option::Option::Some(vec![
       41584  +
                "a".to_owned(),
       41585  +
                "b".to_owned(),
       41586  +
                "c".to_owned(),
       41587  +
            ]),
       41588  +
            header_string_set: ::std::option::Option::Some(
       41589  +
                vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]
       41590  +
                    .try_into()
       41591  +
                    .expect("this is only used in tests"),
       41592  +
            ),
       41593  +
            header_byte: ::std::option::Option::None,
       41594  +
            header_short: ::std::option::Option::None,
       41595  +
            header_integer: ::std::option::Option::None,
       41596  +
            header_long: ::std::option::Option::None,
       41597  +
            header_float: ::std::option::Option::None,
       41598  +
            header_double: ::std::option::Option::None,
       41599  +
            header_true_bool: ::std::option::Option::None,
       41600  +
            header_false_bool: ::std::option::Option::None,
       41601  +
            header_integer_list: ::std::option::Option::None,
       41602  +
            header_boolean_list: ::std::option::Option::None,
       41603  +
            header_timestamp_list: ::std::option::Option::None,
       41604  +
            header_enum: ::std::option::Option::None,
       41605  +
            header_enum_list: ::std::option::Option::None,
       41606  +
            header_integer_enum: ::std::option::Option::None,
       41607  +
            header_integer_enum_list: ::std::option::Option::None,
       41608  +
        };
       41609  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41610  +
        let http_response = output.into_response();
       41611  +
        ::pretty_assertions::assert_eq!(
       41612  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41613  +
            http_response.status()
       41614  +
        );
       41615  +
        let expected_headers = [
       41616  +
            ("X-String", "Hello"),
       41617  +
            ("X-StringList", "a, b, c"),
       41618  +
            ("X-StringSet", "a, b, c"),
       41619  +
        ];
       41620  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41621  +
            http_response.headers(),
       41622  +
            expected_headers,
       41623  +
        ));
41066  41624   
    }
41067         -
            crate::protocol_serde::shape_null_and_empty_headers_client::de_null_and_empty_headers_client_http_request(request)
41068         -
                            .await
41069         -
                            .map_err(Into::into)
       41625  +
    /// Tests responses with string list header bindings that require quoting
       41626  +
    /// Test ID: RestJsonInputAndOutputWithQuotedStringHeaders
       41627  +
    #[::tokio::test]
       41628  +
    #[::tracing_test::traced_test]
       41629  +
    async fn rest_json_input_and_output_with_quoted_string_headers_response() {
       41630  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41631  +
            header_string_list: ::std::option::Option::Some(vec![
       41632  +
                "b,c".to_owned(),
       41633  +
                "\"def\"".to_owned(),
       41634  +
                "a".to_owned(),
       41635  +
            ]),
       41636  +
            header_string: ::std::option::Option::None,
       41637  +
            header_byte: ::std::option::Option::None,
       41638  +
            header_short: ::std::option::Option::None,
       41639  +
            header_integer: ::std::option::Option::None,
       41640  +
            header_long: ::std::option::Option::None,
       41641  +
            header_float: ::std::option::Option::None,
       41642  +
            header_double: ::std::option::Option::None,
       41643  +
            header_true_bool: ::std::option::Option::None,
       41644  +
            header_false_bool: ::std::option::Option::None,
       41645  +
            header_string_set: ::std::option::Option::None,
       41646  +
            header_integer_list: ::std::option::Option::None,
       41647  +
            header_boolean_list: ::std::option::Option::None,
       41648  +
            header_timestamp_list: ::std::option::Option::None,
       41649  +
            header_enum: ::std::option::Option::None,
       41650  +
            header_enum_list: ::std::option::Option::None,
       41651  +
            header_integer_enum: ::std::option::Option::None,
       41652  +
            header_integer_enum_list: ::std::option::Option::None,
41070  41653   
        };
41071         -
        use ::futures_util::future::TryFutureExt;
41072         -
        let fut = fut.map_err(
41073         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
41074         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
41075         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
41076         -
                    e,
41077         -
                )
41078         -
            },
       41654  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41655  +
        let http_response = output.into_response();
       41656  +
        ::pretty_assertions::assert_eq!(
       41657  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41658  +
            http_response.status()
41079  41659   
        );
41080         -
        NullAndEmptyHeadersClientInputFuture {
41081         -
            inner: Box::pin(fut),
       41660  +
        let expected_headers = [("X-StringList", "\"b,c\", \"\\\"def\\\"\", a")];
       41661  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41662  +
            http_response.headers(),
       41663  +
            expected_headers,
       41664  +
        ));
41082  41665   
    }
       41666  +
    /// Tests responses with numeric header bindings
       41667  +
    /// Test ID: RestJsonInputAndOutputWithNumericHeaders
       41668  +
    #[::tokio::test]
       41669  +
    #[::tracing_test::traced_test]
       41670  +
    async fn rest_json_input_and_output_with_numeric_headers_response() {
       41671  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41672  +
            header_byte: ::std::option::Option::Some(1),
       41673  +
            header_short: ::std::option::Option::Some(123),
       41674  +
            header_integer: ::std::option::Option::Some(123),
       41675  +
            header_long: ::std::option::Option::Some(123),
       41676  +
            header_float: ::std::option::Option::Some(1.1_f32),
       41677  +
            header_double: ::std::option::Option::Some(1.1_f64),
       41678  +
            header_integer_list: ::std::option::Option::Some(vec![1, 2, 3]),
       41679  +
            header_string: ::std::option::Option::None,
       41680  +
            header_true_bool: ::std::option::Option::None,
       41681  +
            header_false_bool: ::std::option::Option::None,
       41682  +
            header_string_list: ::std::option::Option::None,
       41683  +
            header_string_set: ::std::option::Option::None,
       41684  +
            header_boolean_list: ::std::option::Option::None,
       41685  +
            header_timestamp_list: ::std::option::Option::None,
       41686  +
            header_enum: ::std::option::Option::None,
       41687  +
            header_enum_list: ::std::option::Option::None,
       41688  +
            header_integer_enum: ::std::option::Option::None,
       41689  +
            header_integer_enum_list: ::std::option::Option::None,
       41690  +
        };
       41691  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41692  +
        let http_response = output.into_response();
       41693  +
        ::pretty_assertions::assert_eq!(
       41694  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41695  +
            http_response.status()
       41696  +
        );
       41697  +
        let expected_headers = [
       41698  +
            ("X-Byte", "1"),
       41699  +
            ("X-Double", "1.1"),
       41700  +
            ("X-Float", "1.1"),
       41701  +
            ("X-Integer", "123"),
       41702  +
            ("X-IntegerList", "1, 2, 3"),
       41703  +
            ("X-Long", "123"),
       41704  +
            ("X-Short", "123"),
       41705  +
        ];
       41706  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41707  +
            http_response.headers(),
       41708  +
            expected_headers,
       41709  +
        ));
41083  41710   
    }
41084         -
}
41085         -
impl
41086         -
    ::aws_smithy_http_server::response::IntoResponse<
41087         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
41088         -
    > for crate::output::NullAndEmptyHeadersClientOutput
41089         -
{
41090         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
41091         -
        match crate::protocol_serde::shape_null_and_empty_headers_client::ser_null_and_empty_headers_client_http_response(self) {
41092         -
                        Ok(response) => response,
41093         -
                        Err(e) => {
41094         -
                            ::tracing::error!(error = %e, "failed to serialize response");
41095         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
       41711  +
    /// Tests responses with boolean header bindings
       41712  +
    /// Test ID: RestJsonInputAndOutputWithBooleanHeaders
       41713  +
    #[::tokio::test]
       41714  +
    #[::tracing_test::traced_test]
       41715  +
    async fn rest_json_input_and_output_with_boolean_headers_response() {
       41716  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41717  +
            header_true_bool: ::std::option::Option::Some(true),
       41718  +
            header_false_bool: ::std::option::Option::Some(false),
       41719  +
            header_boolean_list: ::std::option::Option::Some(vec![true, false, true]),
       41720  +
            header_string: ::std::option::Option::None,
       41721  +
            header_byte: ::std::option::Option::None,
       41722  +
            header_short: ::std::option::Option::None,
       41723  +
            header_integer: ::std::option::Option::None,
       41724  +
            header_long: ::std::option::Option::None,
       41725  +
            header_float: ::std::option::Option::None,
       41726  +
            header_double: ::std::option::Option::None,
       41727  +
            header_string_list: ::std::option::Option::None,
       41728  +
            header_string_set: ::std::option::Option::None,
       41729  +
            header_integer_list: ::std::option::Option::None,
       41730  +
            header_timestamp_list: ::std::option::Option::None,
       41731  +
            header_enum: ::std::option::Option::None,
       41732  +
            header_enum_list: ::std::option::Option::None,
       41733  +
            header_integer_enum: ::std::option::Option::None,
       41734  +
            header_integer_enum_list: ::std::option::Option::None,
       41735  +
        };
       41736  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41737  +
        let http_response = output.into_response();
       41738  +
        ::pretty_assertions::assert_eq!(
       41739  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41740  +
            http_response.status()
       41741  +
        );
       41742  +
        let expected_headers = [
       41743  +
            ("X-Boolean1", "true"),
       41744  +
            ("X-Boolean2", "false"),
       41745  +
            ("X-BooleanList", "true, false, true"),
       41746  +
        ];
       41747  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41748  +
            http_response.headers(),
       41749  +
            expected_headers,
       41750  +
        ));
41096  41751   
    }
       41752  +
    /// Tests responses with timestamp header bindings
       41753  +
    /// Test ID: RestJsonInputAndOutputWithTimestampHeaders
       41754  +
    #[::tokio::test]
       41755  +
    #[::tracing_test::traced_test]
       41756  +
    async fn rest_json_input_and_output_with_timestamp_headers_response() {
       41757  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41758  +
            header_timestamp_list: ::std::option::Option::Some(vec![
       41759  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       41760  +
                ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
       41761  +
            ]),
       41762  +
            header_string: ::std::option::Option::None,
       41763  +
            header_byte: ::std::option::Option::None,
       41764  +
            header_short: ::std::option::Option::None,
       41765  +
            header_integer: ::std::option::Option::None,
       41766  +
            header_long: ::std::option::Option::None,
       41767  +
            header_float: ::std::option::Option::None,
       41768  +
            header_double: ::std::option::Option::None,
       41769  +
            header_true_bool: ::std::option::Option::None,
       41770  +
            header_false_bool: ::std::option::Option::None,
       41771  +
            header_string_list: ::std::option::Option::None,
       41772  +
            header_string_set: ::std::option::Option::None,
       41773  +
            header_integer_list: ::std::option::Option::None,
       41774  +
            header_boolean_list: ::std::option::Option::None,
       41775  +
            header_enum: ::std::option::Option::None,
       41776  +
            header_enum_list: ::std::option::Option::None,
       41777  +
            header_integer_enum: ::std::option::Option::None,
       41778  +
            header_integer_enum_list: ::std::option::Option::None,
       41779  +
        };
       41780  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41781  +
        let http_response = output.into_response();
       41782  +
        ::pretty_assertions::assert_eq!(
       41783  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41784  +
            http_response.status()
       41785  +
        );
       41786  +
        let expected_headers = [(
       41787  +
            "X-TimestampList",
       41788  +
            "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT",
       41789  +
        )];
       41790  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41791  +
            http_response.headers(),
       41792  +
            expected_headers,
       41793  +
        ));
41097  41794   
    }
       41795  +
    /// Tests responses with enum header bindings
       41796  +
    /// Test ID: RestJsonInputAndOutputWithEnumHeaders
       41797  +
    #[::tokio::test]
       41798  +
    #[::tracing_test::traced_test]
       41799  +
    async fn rest_json_input_and_output_with_enum_headers_response() {
       41800  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41801  +
            header_enum: ::std::option::Option::Some(
       41802  +
                "Foo"
       41803  +
                    .parse::<crate::model::FooEnum>()
       41804  +
                    .expect("static value validated to member"),
       41805  +
            ),
       41806  +
            header_enum_list: ::std::option::Option::Some(vec![
       41807  +
                "Foo"
       41808  +
                    .parse::<crate::model::FooEnum>()
       41809  +
                    .expect("static value validated to member"),
       41810  +
                "Bar"
       41811  +
                    .parse::<crate::model::FooEnum>()
       41812  +
                    .expect("static value validated to member"),
       41813  +
                "Baz"
       41814  +
                    .parse::<crate::model::FooEnum>()
       41815  +
                    .expect("static value validated to member"),
       41816  +
            ]),
       41817  +
            header_string: ::std::option::Option::None,
       41818  +
            header_byte: ::std::option::Option::None,
       41819  +
            header_short: ::std::option::Option::None,
       41820  +
            header_integer: ::std::option::Option::None,
       41821  +
            header_long: ::std::option::Option::None,
       41822  +
            header_float: ::std::option::Option::None,
       41823  +
            header_double: ::std::option::Option::None,
       41824  +
            header_true_bool: ::std::option::Option::None,
       41825  +
            header_false_bool: ::std::option::Option::None,
       41826  +
            header_string_list: ::std::option::Option::None,
       41827  +
            header_string_set: ::std::option::Option::None,
       41828  +
            header_integer_list: ::std::option::Option::None,
       41829  +
            header_boolean_list: ::std::option::Option::None,
       41830  +
            header_timestamp_list: ::std::option::Option::None,
       41831  +
            header_integer_enum: ::std::option::Option::None,
       41832  +
            header_integer_enum_list: ::std::option::Option::None,
       41833  +
        };
       41834  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41835  +
        let http_response = output.into_response();
       41836  +
        ::pretty_assertions::assert_eq!(
       41837  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41838  +
            http_response.status()
       41839  +
        );
       41840  +
        let expected_headers = [("X-Enum", "Foo"), ("X-EnumList", "Foo, Bar, Baz")];
       41841  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41842  +
            http_response.headers(),
       41843  +
            expected_headers,
       41844  +
        ));
41098  41845   
    }
41099         -
}
41100         -
41101         -
const CONTENT_TYPE_INPUTANDOUTPUTWITHHEADERS: ::mime::Mime = ::mime::APPLICATION_JSON;
41102         -
::pin_project_lite::pin_project! {
41103         -
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
41104         -
    /// [`InputAndOutputWithHeadersInput`](crate::input::InputAndOutputWithHeadersInput) using modelled bindings.
41105         -
    pub struct InputAndOutputWithHeadersInputFuture {
41106         -
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::InputAndOutputWithHeadersInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
       41846  +
    /// Tests responses with intEnum header bindings
       41847  +
    /// Test ID: RestJsonInputAndOutputWithIntEnumHeaders
       41848  +
    #[::tokio::test]
       41849  +
    #[::tracing_test::traced_test]
       41850  +
    async fn rest_json_input_and_output_with_int_enum_headers_response() {
       41851  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41852  +
            header_integer_enum: ::std::option::Option::Some(1),
       41853  +
            header_integer_enum_list: ::std::option::Option::Some(vec![1, 2, 3]),
       41854  +
            header_string: ::std::option::Option::None,
       41855  +
            header_byte: ::std::option::Option::None,
       41856  +
            header_short: ::std::option::Option::None,
       41857  +
            header_integer: ::std::option::Option::None,
       41858  +
            header_long: ::std::option::Option::None,
       41859  +
            header_float: ::std::option::Option::None,
       41860  +
            header_double: ::std::option::Option::None,
       41861  +
            header_true_bool: ::std::option::Option::None,
       41862  +
            header_false_bool: ::std::option::Option::None,
       41863  +
            header_string_list: ::std::option::Option::None,
       41864  +
            header_string_set: ::std::option::Option::None,
       41865  +
            header_integer_list: ::std::option::Option::None,
       41866  +
            header_boolean_list: ::std::option::Option::None,
       41867  +
            header_timestamp_list: ::std::option::Option::None,
       41868  +
            header_enum: ::std::option::Option::None,
       41869  +
            header_enum_list: ::std::option::Option::None,
       41870  +
        };
       41871  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41872  +
        let http_response = output.into_response();
       41873  +
        ::pretty_assertions::assert_eq!(
       41874  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41875  +
            http_response.status()
       41876  +
        );
       41877  +
        let expected_headers = [("X-IntegerEnum", "1"), ("X-IntegerEnumList", "1, 2, 3")];
       41878  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41879  +
            http_response.headers(),
       41880  +
            expected_headers,
       41881  +
        ));
41107  41882   
    }
41108         -
}
41109         -
41110         -
impl std::future::Future for InputAndOutputWithHeadersInputFuture {
41111         -
    type Output = Result<
41112         -
        crate::input::InputAndOutputWithHeadersInput,
41113         -
        ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError,
41114         -
    >;
41115         -
41116         -
    fn poll(
41117         -
        self: std::pin::Pin<&mut Self>,
41118         -
        cx: &mut std::task::Context<'_>,
41119         -
    ) -> std::task::Poll<Self::Output> {
41120         -
        let this = self.project();
41121         -
        this.inner.as_mut().poll(cx)
       41883  +
    /// Supports handling NaN float header values.
       41884  +
    /// Test ID: RestJsonSupportsNaNFloatHeaderOutputs
       41885  +
    #[::tokio::test]
       41886  +
    #[::tracing_test::traced_test]
       41887  +
    async fn rest_json_supports_na_n_float_header_outputs_response() {
       41888  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41889  +
            header_float: ::std::option::Option::Some(
       41890  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
       41891  +
                    .expect("invalid string for number"),
       41892  +
            ),
       41893  +
            header_double: ::std::option::Option::Some(
       41894  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN")
       41895  +
                    .expect("invalid string for number"),
       41896  +
            ),
       41897  +
            header_string: ::std::option::Option::None,
       41898  +
            header_byte: ::std::option::Option::None,
       41899  +
            header_short: ::std::option::Option::None,
       41900  +
            header_integer: ::std::option::Option::None,
       41901  +
            header_long: ::std::option::Option::None,
       41902  +
            header_true_bool: ::std::option::Option::None,
       41903  +
            header_false_bool: ::std::option::Option::None,
       41904  +
            header_string_list: ::std::option::Option::None,
       41905  +
            header_string_set: ::std::option::Option::None,
       41906  +
            header_integer_list: ::std::option::Option::None,
       41907  +
            header_boolean_list: ::std::option::Option::None,
       41908  +
            header_timestamp_list: ::std::option::Option::None,
       41909  +
            header_enum: ::std::option::Option::None,
       41910  +
            header_enum_list: ::std::option::Option::None,
       41911  +
            header_integer_enum: ::std::option::Option::None,
       41912  +
            header_integer_enum_list: ::std::option::Option::None,
       41913  +
        };
       41914  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41915  +
        let http_response = output.into_response();
       41916  +
        ::pretty_assertions::assert_eq!(
       41917  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41918  +
            http_response.status()
       41919  +
        );
       41920  +
        let expected_headers = [("X-Double", "NaN"), ("X-Float", "NaN")];
       41921  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41922  +
            http_response.headers(),
       41923  +
            expected_headers,
       41924  +
        ));
41122  41925   
    }
41123         -
}
41124         -
41125         -
impl<B>
41126         -
    ::aws_smithy_http_server::request::FromRequest<
41127         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
41128         -
        B,
41129         -
    > for crate::input::InputAndOutputWithHeadersInput
41130         -
where
41131         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
41132         -
    B: 'static,
41133         -
41134         -
    B::Data: Send,
41135         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
41136         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
41137         -
{
41138         -
    type Rejection = ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError;
41139         -
    type Future = InputAndOutputWithHeadersInputFuture;
41140         -
41141         -
    fn from_request(request: ::http::Request<B>) -> Self::Future {
41142         -
        let fut = async move {
41143         -
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
41144         -
                request.headers(),
41145         -
                &CONTENT_TYPE_INPUTANDOUTPUTWITHHEADERS,
41146         -
            ) {
41147         -
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
       41926  +
    /// Supports handling Infinity float header values.
       41927  +
    /// Test ID: RestJsonSupportsInfinityFloatHeaderOutputs
       41928  +
    #[::tokio::test]
       41929  +
    #[::tracing_test::traced_test]
       41930  +
    async fn rest_json_supports_infinity_float_header_outputs_response() {
       41931  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41932  +
            header_float: ::std::option::Option::Some(
       41933  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
       41934  +
                    .expect("invalid string for number"),
       41935  +
            ),
       41936  +
            header_double: ::std::option::Option::Some(
       41937  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity")
       41938  +
                    .expect("invalid string for number"),
       41939  +
            ),
       41940  +
            header_string: ::std::option::Option::None,
       41941  +
            header_byte: ::std::option::Option::None,
       41942  +
            header_short: ::std::option::Option::None,
       41943  +
            header_integer: ::std::option::Option::None,
       41944  +
            header_long: ::std::option::Option::None,
       41945  +
            header_true_bool: ::std::option::Option::None,
       41946  +
            header_false_bool: ::std::option::Option::None,
       41947  +
            header_string_list: ::std::option::Option::None,
       41948  +
            header_string_set: ::std::option::Option::None,
       41949  +
            header_integer_list: ::std::option::Option::None,
       41950  +
            header_boolean_list: ::std::option::Option::None,
       41951  +
            header_timestamp_list: ::std::option::Option::None,
       41952  +
            header_enum: ::std::option::Option::None,
       41953  +
            header_enum_list: ::std::option::Option::None,
       41954  +
            header_integer_enum: ::std::option::Option::None,
       41955  +
            header_integer_enum_list: ::std::option::Option::None,
       41956  +
        };
       41957  +
        use ::aws_smithy_http_server::response::IntoResponse;
       41958  +
        let http_response = output.into_response();
       41959  +
        ::pretty_assertions::assert_eq!(
       41960  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       41961  +
            http_response.status()
       41962  +
        );
       41963  +
        let expected_headers = [("X-Double", "Infinity"), ("X-Float", "Infinity")];
       41964  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       41965  +
            http_response.headers(),
       41966  +
            expected_headers,
       41967  +
        ));
41148  41968   
    }
41149         -
            crate::protocol_serde::shape_input_and_output_with_headers::de_input_and_output_with_headers_http_request(request)
41150         -
                            .await
41151         -
                            .map_err(Into::into)
       41969  +
    /// Supports handling -Infinity float header values.
       41970  +
    /// Test ID: RestJsonSupportsNegativeInfinityFloatHeaderOutputs
       41971  +
    #[::tokio::test]
       41972  +
    #[::tracing_test::traced_test]
       41973  +
    async fn rest_json_supports_negative_infinity_float_header_outputs_response() {
       41974  +
        let output = crate::output::InputAndOutputWithHeadersOutput {
       41975  +
            header_float: ::std::option::Option::Some(
       41976  +
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
       41977  +
                    .expect("invalid string for number"),
       41978  +
            ),
       41979  +
            header_double: ::std::option::Option::Some(
       41980  +
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity")
       41981  +
                    .expect("invalid string for number"),
       41982  +
            ),
       41983  +
            header_string: ::std::option::Option::None,
       41984  +
            header_byte: ::std::option::Option::None,
       41985  +
            header_short: ::std::option::Option::None,
       41986  +
            header_integer: ::std::option::Option::None,
       41987  +
            header_long: ::std::option::Option::None,
       41988  +
            header_true_bool: ::std::option::Option::None,
       41989  +
            header_false_bool: ::std::option::Option::None,
       41990  +
            header_string_list: ::std::option::Option::None,
       41991  +
            header_string_set: ::std::option::Option::None,
       41992  +
            header_integer_list: ::std::option::Option::None,
       41993  +
            header_boolean_list: ::std::option::Option::None,
       41994  +
            header_timestamp_list: ::std::option::Option::None,
       41995  +
            header_enum: ::std::option::Option::None,
       41996  +
            header_enum_list: ::std::option::Option::None,
       41997  +
            header_integer_enum: ::std::option::Option::None,
       41998  +
            header_integer_enum_list: ::std::option::Option::None,
41152  41999   
        };
41153         -
        use ::futures_util::future::TryFutureExt;
41154         -
        let fut = fut.map_err(
41155         -
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
41156         -
                ::tracing::debug!(error = %e, "failed to deserialize request");
41157         -
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
41158         -
                    e,
41159         -
                )
41160         -
            },
       42000  +
        use ::aws_smithy_http_server::response::IntoResponse;
       42001  +
        let http_response = output.into_response();
       42002  +
        ::pretty_assertions::assert_eq!(
       42003  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       42004  +
            http_response.status()
41161  42005   
        );
41162         -
        InputAndOutputWithHeadersInputFuture {
41163         -
            inner: Box::pin(fut),
41164         -
        }
41165         -
    }
41166         -
}
41167         -
impl
41168         -
    ::aws_smithy_http_server::response::IntoResponse<
41169         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
41170         -
    > for crate::output::InputAndOutputWithHeadersOutput
41171         -
{
41172         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
41173         -
        match crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_http_response(self) {
41174         -
                        Ok(response) => response,
41175         -
                        Err(e) => {
41176         -
                            ::tracing::error!(error = %e, "failed to serialize response");
41177         -
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
41178         -
                        }
41179         -
                    }
41180         -
    }
41181         -
}
41182         -
impl
41183         -
    ::aws_smithy_http_server::response::IntoResponse<
41184         -
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
41185         -
    > for crate::error::InputAndOutputWithHeadersError
41186         -
{
41187         -
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
41188         -
        match crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_http_error(&self) {
41189         -
            Ok(mut response) => {
41190         -
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
41191         -
                response
41192         -
            },
41193         -
            Err(e) => {
41194         -
                ::tracing::error!(error = %e, "failed to serialize response");
41195         -
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
41196         -
            }
41197         -
        }
       42006  +
        let expected_headers = [("X-Double", "-Infinity"), ("X-Float", "-Infinity")];
       42007  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       42008  +
            http_response.headers(),
       42009  +
            expected_headers,
       42010  +
        ));
41198  42011   
    }
41199  42012   
}
41200  42013   
41201  42014   
const CONTENT_TYPE_UNITINPUTANDOUTPUT: ::mime::Mime = ::mime::APPLICATION_JSON;
41202  42015   
::pin_project_lite::pin_project! {
41203  42016   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
41204  42017   
    /// [`UnitInputAndOutputInput`](crate::input::UnitInputAndOutputInput) using modelled bindings.
41205  42018   
    pub struct UnitInputAndOutputInputFuture {
41206  42019   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::UnitInputAndOutputInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
41207  42020   
    }
@@ -41253,42066 +41312,42233 @@
41273  42086   
        match crate::protocol_serde::shape_unit_input_and_output::ser_unit_input_and_output_http_response(self) {
41274  42087   
                        Ok(response) => response,
41275  42088   
                        Err(e) => {
41276  42089   
                            ::tracing::error!(error = %e, "failed to serialize response");
41277  42090   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
41278  42091   
                        }
41279  42092   
                    }
41280  42093   
    }
41281  42094   
}
41282  42095   
       42096  +
#[allow(unreachable_code, unused_variables)]
       42097  +
#[cfg(test)]
       42098  +
mod unit_input_and_output_test {
       42099  +
       42100  +
    /// A unit type input serializes no payload. When clients do not
       42101  +
    /// need to serialize any data in the payload, they should omit
       42102  +
    /// a payload altogether.
       42103  +
    /// Test ID: RestJsonUnitInputAndOutput
       42104  +
    #[::tokio::test]
       42105  +
    #[::tracing_test::traced_test]
       42106  +
    async fn rest_json_unit_input_and_output_request() {
       42107  +
        #[allow(unused_mut)]
       42108  +
        let mut http_request = http::Request::builder()
       42109  +
            .uri("/UnitInputAndOutput")
       42110  +
            .method("POST")
       42111  +
            .body(::aws_smithy_http_server::body::Body::from(
       42112  +
                ::bytes::Bytes::from_static("".as_bytes()),
       42113  +
            ))
       42114  +
            .unwrap();
       42115  +
        #[allow(unused_mut)]
       42116  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42117  +
        let config = crate::service::RestJsonConfig::builder().build();
       42118  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42119  +
            .unit_input_and_output(move |input: crate::input::UnitInputAndOutputInput| {
       42120  +
                let sender = sender.clone();
       42121  +
                async move {
       42122  +
                    let result = {
       42123  +
                        let expected = crate::input::UnitInputAndOutputInput {};
       42124  +
                        ::pretty_assertions::assert_eq!(input, expected);
       42125  +
                        let response = crate::output::UnitInputAndOutputOutput {};
       42126  +
                        response
       42127  +
                    };
       42128  +
                    sender.send(()).await.expect("receiver dropped early");
       42129  +
                    result
       42130  +
                }
       42131  +
            })
       42132  +
            .build_unchecked();
       42133  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42134  +
            .await
       42135  +
            .expect("unable to make an HTTP request");
       42136  +
        assert!(
       42137  +
            receiver.recv().await.is_some(),
       42138  +
            "we expected operation handler to be invoked but it was not entered"
       42139  +
        );
       42140  +
    }
       42141  +
    /// Servers should allow the accept header to be set to the
       42142  +
    /// default content-type.
       42143  +
    /// Test ID: RestJsonUnitInputAllowsAccept
       42144  +
    #[::tokio::test]
       42145  +
    #[::tracing_test::traced_test]
       42146  +
    async fn rest_json_unit_input_allows_accept_request() {
       42147  +
        #[allow(unused_mut)]
       42148  +
        let mut http_request = http::Request::builder()
       42149  +
            .uri("/UnitInputAndOutput")
       42150  +
            .method("POST")
       42151  +
            .header("Accept", "application/json")
       42152  +
            .body(::aws_smithy_http_server::body::Body::from(
       42153  +
                ::bytes::Bytes::from_static("".as_bytes()),
       42154  +
            ))
       42155  +
            .unwrap();
       42156  +
        #[allow(unused_mut)]
       42157  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42158  +
        let config = crate::service::RestJsonConfig::builder().build();
       42159  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42160  +
            .unit_input_and_output(move |input: crate::input::UnitInputAndOutputInput| {
       42161  +
                let sender = sender.clone();
       42162  +
                async move {
       42163  +
                    let result = {
       42164  +
                        let expected = crate::input::UnitInputAndOutputInput {};
       42165  +
                        ::pretty_assertions::assert_eq!(input, expected);
       42166  +
                        let response = crate::output::UnitInputAndOutputOutput {};
       42167  +
                        response
       42168  +
                    };
       42169  +
                    sender.send(()).await.expect("receiver dropped early");
       42170  +
                    result
       42171  +
                }
       42172  +
            })
       42173  +
            .build_unchecked();
       42174  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42175  +
            .await
       42176  +
            .expect("unable to make an HTTP request");
       42177  +
        assert!(
       42178  +
            receiver.recv().await.is_some(),
       42179  +
            "we expected operation handler to be invoked but it was not entered"
       42180  +
        );
       42181  +
    }
       42182  +
    /// When an operation defines Unit output, the service will respond
       42183  +
    /// with an empty payload, and may optionally include the content-type
       42184  +
    /// header.
       42185  +
    /// Test ID: RestJsonUnitInputAndOutputNoOutput
       42186  +
    #[::tokio::test]
       42187  +
    #[::tracing_test::traced_test]
       42188  +
    async fn rest_json_unit_input_and_output_no_output_response() {
       42189  +
        let output = crate::output::UnitInputAndOutputOutput {};
       42190  +
        use ::aws_smithy_http_server::response::IntoResponse;
       42191  +
        let http_response = output.into_response();
       42192  +
        ::pretty_assertions::assert_eq!(
       42193  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       42194  +
            http_response.status()
       42195  +
        );
       42196  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       42197  +
            .await
       42198  +
            .expect("unable to extract body to bytes");
       42199  +
        // No body.
       42200  +
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       42201  +
    }
       42202  +
}
       42203  +
41283  42204   
const CONTENT_TYPE_EMPTYINPUTANDEMPTYOUTPUT: ::mime::Mime = ::mime::APPLICATION_JSON;
41284  42205   
::pin_project_lite::pin_project! {
41285  42206   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
41286  42207   
    /// [`EmptyInputAndEmptyOutputInput`](crate::input::EmptyInputAndEmptyOutputInput) using modelled bindings.
41287  42208   
    pub struct EmptyInputAndEmptyOutputInputFuture {
41288  42209   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::EmptyInputAndEmptyOutputInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
41289  42210   
    }
41290  42211   
}
41291  42212   
41292  42213   
impl std::future::Future for EmptyInputAndEmptyOutputInputFuture {
@@ -41335,42256 +41394,42435 @@
41355  42276   
        match crate::protocol_serde::shape_empty_input_and_empty_output::ser_empty_input_and_empty_output_http_response(self) {
41356  42277   
                        Ok(response) => response,
41357  42278   
                        Err(e) => {
41358  42279   
                            ::tracing::error!(error = %e, "failed to serialize response");
41359  42280   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
41360  42281   
                        }
41361  42282   
                    }
41362  42283   
    }
41363  42284   
}
41364  42285   
       42286  +
#[allow(unreachable_code, unused_variables)]
       42287  +
#[cfg(test)]
       42288  +
mod empty_input_and_empty_output_test {
       42289  +
       42290  +
    /// Clients should not serialize a JSON payload when no parameters
       42291  +
    /// are given that are sent in the body. A service will tolerate
       42292  +
    /// clients that omit a payload or that send a JSON object.
       42293  +
    /// Test ID: RestJsonEmptyInputAndEmptyOutput
       42294  +
    #[::tokio::test]
       42295  +
    #[::tracing_test::traced_test]
       42296  +
    async fn rest_json_empty_input_and_empty_output_request() {
       42297  +
        #[allow(unused_mut)]
       42298  +
        let mut http_request = http::Request::builder()
       42299  +
            .uri("/EmptyInputAndEmptyOutput")
       42300  +
            .method("POST")
       42301  +
            .body(::aws_smithy_http_server::body::Body::from(
       42302  +
                ::bytes::Bytes::from_static("".as_bytes()),
       42303  +
            ))
       42304  +
            .unwrap();
       42305  +
        #[allow(unused_mut)]
       42306  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42307  +
        let config = crate::service::RestJsonConfig::builder().build();
       42308  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42309  +
            .empty_input_and_empty_output(
       42310  +
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
       42311  +
                    let sender = sender.clone();
       42312  +
                    async move {
       42313  +
                        let result = {
       42314  +
                            let expected = crate::input::EmptyInputAndEmptyOutputInput {};
       42315  +
                            ::pretty_assertions::assert_eq!(input, expected);
       42316  +
                            let response = crate::output::EmptyInputAndEmptyOutputOutput {};
       42317  +
                            response
       42318  +
                        };
       42319  +
                        sender.send(()).await.expect("receiver dropped early");
       42320  +
                        result
       42321  +
                    }
       42322  +
                },
       42323  +
            )
       42324  +
            .build_unchecked();
       42325  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42326  +
            .await
       42327  +
            .expect("unable to make an HTTP request");
       42328  +
        assert!(
       42329  +
            receiver.recv().await.is_some(),
       42330  +
            "we expected operation handler to be invoked but it was not entered"
       42331  +
        );
       42332  +
    }
       42333  +
    /// Similar to RestJsonEmptyInputAndEmptyOutput, but ensures that
       42334  +
    /// services gracefully handles receiving a JSON object.
       42335  +
    /// Test ID: RestJsonEmptyInputAndEmptyOutputWithJson
       42336  +
    #[::tokio::test]
       42337  +
    #[::tracing_test::traced_test]
       42338  +
    async fn rest_json_empty_input_and_empty_output_with_json_request() {
       42339  +
        #[allow(unused_mut)]
       42340  +
        let mut http_request = http::Request::builder()
       42341  +
            .uri("/EmptyInputAndEmptyOutput")
       42342  +
            .method("POST")
       42343  +
            .header("Content-Type", "application/json")
       42344  +
            .body(::aws_smithy_http_server::body::Body::from(
       42345  +
                ::bytes::Bytes::from_static("{}".as_bytes()),
       42346  +
            ))
       42347  +
            .unwrap();
       42348  +
        #[allow(unused_mut)]
       42349  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42350  +
        let config = crate::service::RestJsonConfig::builder().build();
       42351  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42352  +
            .empty_input_and_empty_output(
       42353  +
                move |input: crate::input::EmptyInputAndEmptyOutputInput| {
       42354  +
                    let sender = sender.clone();
       42355  +
                    async move {
       42356  +
                        let result = {
       42357  +
                            let expected = crate::input::EmptyInputAndEmptyOutputInput {};
       42358  +
                            ::pretty_assertions::assert_eq!(input, expected);
       42359  +
                            let response = crate::output::EmptyInputAndEmptyOutputOutput {};
       42360  +
                            response
       42361  +
                        };
       42362  +
                        sender.send(()).await.expect("receiver dropped early");
       42363  +
                        result
       42364  +
                    }
       42365  +
                },
       42366  +
            )
       42367  +
            .build_unchecked();
       42368  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42369  +
            .await
       42370  +
            .expect("unable to make an HTTP request");
       42371  +
        assert!(
       42372  +
            receiver.recv().await.is_some(),
       42373  +
            "we expected operation handler to be invoked but it was not entered"
       42374  +
        );
       42375  +
    }
       42376  +
    /// As of January 2021, server implementations are expected to
       42377  +
    /// respond with a JSON object regardless of if the output
       42378  +
    /// parameters are empty.
       42379  +
    /// Test ID: RestJsonEmptyInputAndEmptyOutput
       42380  +
    #[::tokio::test]
       42381  +
    #[::tracing_test::traced_test]
       42382  +
    async fn rest_json_empty_input_and_empty_output_response() {
       42383  +
        let output = crate::output::EmptyInputAndEmptyOutputOutput {};
       42384  +
        use ::aws_smithy_http_server::response::IntoResponse;
       42385  +
        let http_response = output.into_response();
       42386  +
        ::pretty_assertions::assert_eq!(
       42387  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       42388  +
            http_response.status()
       42389  +
        );
       42390  +
        let expected_headers = [("Content-Type", "application/json")];
       42391  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       42392  +
            http_response.headers(),
       42393  +
            expected_headers,
       42394  +
        ));
       42395  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       42396  +
            .await
       42397  +
            .expect("unable to extract body to bytes");
       42398  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       42399  +
            &body,
       42400  +
            "{}",
       42401  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       42402  +
        ));
       42403  +
    }
       42404  +
}
       42405  +
41365  42406   
const CONTENT_TYPE_NOINPUTANDOUTPUT: ::mime::Mime = ::mime::APPLICATION_JSON;
41366  42407   
::pin_project_lite::pin_project! {
41367  42408   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
41368  42409   
    /// [`NoInputAndOutputInput`](crate::input::NoInputAndOutputInput) using modelled bindings.
41369  42410   
    pub struct NoInputAndOutputInputFuture {
41370  42411   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::NoInputAndOutputInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
41371  42412   
    }
41372  42413   
}
41373  42414   
41374  42415   
impl std::future::Future for NoInputAndOutputInputFuture {
@@ -41419,42460 +41478,42634 @@
41439  42480   
        match crate::protocol_serde::shape_no_input_and_output::ser_no_input_and_output_http_response(self) {
41440  42481   
                        Ok(response) => response,
41441  42482   
                        Err(e) => {
41442  42483   
                            ::tracing::error!(error = %e, "failed to serialize response");
41443  42484   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
41444  42485   
                        }
41445  42486   
                    }
41446  42487   
    }
41447  42488   
}
41448  42489   
       42490  +
#[allow(unreachable_code, unused_variables)]
       42491  +
#[cfg(test)]
       42492  +
mod no_input_and_output_test {
       42493  +
       42494  +
    /// No input serializes no payload. When clients do not need to
       42495  +
    /// serialize any data in the payload, they should omit a payload
       42496  +
    /// altogether.
       42497  +
    /// Test ID: RestJsonNoInputAndOutput
       42498  +
    #[::tokio::test]
       42499  +
    #[::tracing_test::traced_test]
       42500  +
    async fn rest_json_no_input_and_output_request() {
       42501  +
        #[allow(unused_mut)]
       42502  +
        let mut http_request = http::Request::builder()
       42503  +
            .uri("/NoInputAndOutputOutput")
       42504  +
            .method("POST")
       42505  +
            .body(::aws_smithy_http_server::body::Body::from(
       42506  +
                ::bytes::Bytes::from_static("".as_bytes()),
       42507  +
            ))
       42508  +
            .unwrap();
       42509  +
        #[allow(unused_mut)]
       42510  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42511  +
        let config = crate::service::RestJsonConfig::builder().build();
       42512  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42513  +
            .no_input_and_output(move |input: crate::input::NoInputAndOutputInput| {
       42514  +
                let sender = sender.clone();
       42515  +
                async move {
       42516  +
                    let result = {
       42517  +
                        let expected = crate::input::NoInputAndOutputInput {};
       42518  +
                        ::pretty_assertions::assert_eq!(input, expected);
       42519  +
                        let response = crate::output::NoInputAndOutputOutput {};
       42520  +
                        response
       42521  +
                    };
       42522  +
                    sender.send(()).await.expect("receiver dropped early");
       42523  +
                    result
       42524  +
                }
       42525  +
            })
       42526  +
            .build_unchecked();
       42527  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42528  +
            .await
       42529  +
            .expect("unable to make an HTTP request");
       42530  +
        assert!(
       42531  +
            receiver.recv().await.is_some(),
       42532  +
            "we expected operation handler to be invoked but it was not entered"
       42533  +
        );
       42534  +
    }
       42535  +
    /// Servers should allow the accept header to be set to the
       42536  +
    /// default content-type.
       42537  +
    /// Test ID: RestJsonNoInputAndOutputAllowsAccept
       42538  +
    #[::tokio::test]
       42539  +
    #[::tracing_test::traced_test]
       42540  +
    async fn rest_json_no_input_and_output_allows_accept_request() {
       42541  +
        #[allow(unused_mut)]
       42542  +
        let mut http_request = http::Request::builder()
       42543  +
            .uri("/NoInputAndOutputOutput")
       42544  +
            .method("POST")
       42545  +
            .header("Accept", "application/json")
       42546  +
            .body(::aws_smithy_http_server::body::Body::from(
       42547  +
                ::bytes::Bytes::from_static("".as_bytes()),
       42548  +
            ))
       42549  +
            .unwrap();
       42550  +
        #[allow(unused_mut)]
       42551  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42552  +
        let config = crate::service::RestJsonConfig::builder().build();
       42553  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42554  +
            .no_input_and_output(move |input: crate::input::NoInputAndOutputInput| {
       42555  +
                let sender = sender.clone();
       42556  +
                async move {
       42557  +
                    let result = {
       42558  +
                        let expected = crate::input::NoInputAndOutputInput {};
       42559  +
                        ::pretty_assertions::assert_eq!(input, expected);
       42560  +
                        let response = crate::output::NoInputAndOutputOutput {};
       42561  +
                        response
       42562  +
                    };
       42563  +
                    sender.send(()).await.expect("receiver dropped early");
       42564  +
                    result
       42565  +
                }
       42566  +
            })
       42567  +
            .build_unchecked();
       42568  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42569  +
            .await
       42570  +
            .expect("unable to make an HTTP request");
       42571  +
        assert!(
       42572  +
            receiver.recv().await.is_some(),
       42573  +
            "we expected operation handler to be invoked but it was not entered"
       42574  +
        );
       42575  +
    }
       42576  +
    /// Operations that define output and do not bind anything to
       42577  +
    /// the payload return a JSON object in the response.
       42578  +
    /// Test ID: RestJsonNoInputAndOutputWithJson
       42579  +
    #[::tokio::test]
       42580  +
    #[::tracing_test::traced_test]
       42581  +
    async fn rest_json_no_input_and_output_with_json_response() {
       42582  +
        let output = crate::output::NoInputAndOutputOutput {};
       42583  +
        use ::aws_smithy_http_server::response::IntoResponse;
       42584  +
        let http_response = output.into_response();
       42585  +
        ::pretty_assertions::assert_eq!(
       42586  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       42587  +
            http_response.status()
       42588  +
        );
       42589  +
        let expected_headers = [("Content-Type", "application/json")];
       42590  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
       42591  +
            http_response.headers(),
       42592  +
            expected_headers,
       42593  +
        ));
       42594  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       42595  +
            .await
       42596  +
            .expect("unable to extract body to bytes");
       42597  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
       42598  +
            &body,
       42599  +
            "{}",
       42600  +
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
       42601  +
        ));
       42602  +
    }
       42603  +
}
       42604  +
41449  42605   
const CONTENT_TYPE_NOINPUTANDNOOUTPUT: ::mime::Mime = ::mime::APPLICATION_JSON;
41450  42606   
::pin_project_lite::pin_project! {
41451  42607   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
41452  42608   
    /// [`NoInputAndNoOutputInput`](crate::input::NoInputAndNoOutputInput) using modelled bindings.
41453  42609   
    pub struct NoInputAndNoOutputInputFuture {
41454  42610   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::NoInputAndNoOutputInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
41455  42611   
    }
41456  42612   
}
41457  42613   
41458  42614   
impl std::future::Future for NoInputAndNoOutputInputFuture {
@@ -41500,42656 +0,42793 @@
41520  42676   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
41521  42677   
        match crate::protocol_serde::shape_no_input_and_no_output::ser_no_input_and_no_output_http_response(self) {
41522  42678   
                        Ok(response) => response,
41523  42679   
                        Err(e) => {
41524  42680   
                            ::tracing::error!(error = %e, "failed to serialize response");
41525  42681   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
41526  42682   
                        }
41527  42683   
                    }
41528  42684   
    }
41529  42685   
}
       42686  +
       42687  +
#[allow(unreachable_code, unused_variables)]
       42688  +
#[cfg(test)]
       42689  +
mod no_input_and_no_output_test {
       42690  +
       42691  +
    /// No input serializes no payload. When clients do not need to
       42692  +
    /// serialize any data in the payload, they should omit a payload
       42693  +
    /// altogether.
       42694  +
    /// Test ID: RestJsonNoInputAndNoOutput
       42695  +
    #[::tokio::test]
       42696  +
    #[::tracing_test::traced_test]
       42697  +
    async fn rest_json_no_input_and_no_output_request() {
       42698  +
        #[allow(unused_mut)]
       42699  +
        let mut http_request = http::Request::builder()
       42700  +
            .uri("/NoInputAndNoOutput")
       42701  +
            .method("POST")
       42702  +
            .body(::aws_smithy_http_server::body::Body::from(
       42703  +
                ::bytes::Bytes::from_static("".as_bytes()),
       42704  +
            ))
       42705  +
            .unwrap();
       42706  +
        #[allow(unused_mut)]
       42707  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42708  +
        let config = crate::service::RestJsonConfig::builder().build();
       42709  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42710  +
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
       42711  +
                let sender = sender.clone();
       42712  +
                async move {
       42713  +
                    let result = {
       42714  +
                        let expected = crate::input::NoInputAndNoOutputInput {};
       42715  +
                        ::pretty_assertions::assert_eq!(input, expected);
       42716  +
                        let response = crate::output::NoInputAndNoOutputOutput {};
       42717  +
                        response
       42718  +
                    };
       42719  +
                    sender.send(()).await.expect("receiver dropped early");
       42720  +
                    result
       42721  +
                }
       42722  +
            })
       42723  +
            .build_unchecked();
       42724  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42725  +
            .await
       42726  +
            .expect("unable to make an HTTP request");
       42727  +
        assert!(
       42728  +
            receiver.recv().await.is_some(),
       42729  +
            "we expected operation handler to be invoked but it was not entered"
       42730  +
        );
       42731  +
    }
       42732  +
    /// Servers should allow the accept header to be set to the
       42733  +
    /// default content-type.
       42734  +
    /// Test ID: RestJsonNoInputAllowsAccept
       42735  +
    #[::tokio::test]
       42736  +
    #[::tracing_test::traced_test]
       42737  +
    async fn rest_json_no_input_allows_accept_request() {
       42738  +
        #[allow(unused_mut)]
       42739  +
        let mut http_request = http::Request::builder()
       42740  +
            .uri("/NoInputAndNoOutput")
       42741  +
            .method("POST")
       42742  +
            .header("Accept", "application/json")
       42743  +
            .body(::aws_smithy_http_server::body::Body::from(
       42744  +
                ::bytes::Bytes::from_static("".as_bytes()),
       42745  +
            ))
       42746  +
            .unwrap();
       42747  +
        #[allow(unused_mut)]
       42748  +
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
       42749  +
        let config = crate::service::RestJsonConfig::builder().build();
       42750  +
        let service = crate::service::RestJson::builder::<::hyper::body::Body, _, _, _>(config)
       42751  +
            .no_input_and_no_output(move |input: crate::input::NoInputAndNoOutputInput| {
       42752  +
                let sender = sender.clone();
       42753  +
                async move {
       42754  +
                    let result = {
       42755  +
                        let expected = crate::input::NoInputAndNoOutputInput {};
       42756  +
                        ::pretty_assertions::assert_eq!(input, expected);
       42757  +
                        let response = crate::output::NoInputAndNoOutputOutput {};
       42758  +
                        response
       42759  +
                    };
       42760  +
                    sender.send(()).await.expect("receiver dropped early");
       42761  +
                    result
       42762  +
                }
       42763  +
            })
       42764  +
            .build_unchecked();
       42765  +
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
       42766  +
            .await
       42767  +
            .expect("unable to make an HTTP request");
       42768  +
        assert!(
       42769  +
            receiver.recv().await.is_some(),
       42770  +
            "we expected operation handler to be invoked but it was not entered"
       42771  +
        );
       42772  +
    }
       42773  +
    /// When an operation does not define output, the service will respond
       42774  +
    /// with an empty payload, and may optionally include the content-type
       42775  +
    /// header.
       42776  +
    /// Test ID: RestJsonNoInputAndNoOutput
       42777  +
    #[::tokio::test]
       42778  +
    #[::tracing_test::traced_test]
       42779  +
    async fn rest_json_no_input_and_no_output_response() {
       42780  +
        let output = crate::output::NoInputAndNoOutputOutput {};
       42781  +
        use ::aws_smithy_http_server::response::IntoResponse;
       42782  +
        let http_response = output.into_response();
       42783  +
        ::pretty_assertions::assert_eq!(
       42784  +
            http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
       42785  +
            http_response.status()
       42786  +
        );
       42787  +
        let body = ::hyper::body::to_bytes(http_response.into_body())
       42788  +
            .await
       42789  +
            .expect("unable to extract body to bytes");
       42790  +
        // No body.
       42791  +
        ::pretty_assertions::assert_eq!(std::str::from_utf8(&body).unwrap(), "");
       42792  +
    }
       42793  +
}